Skip to content

Commit 8152c52

Browse files
committed
Merge remote-tracking branch '10.0' into 10.1
2 parents 782fb1e + 3d5dff6 commit 8152c52

File tree

7 files changed

+75
-3
lines changed

7 files changed

+75
-3
lines changed

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Build-Depends: bison,
2727
libjemalloc-dev (>= 3.0.0~) [linux-any]
2828
Standards-Version: 3.8.2
2929
Homepage: http://mariadb.org/
30-
Vcs-Git: https://github.com/MariaDB/server.git
3130
Vcs-Browser: https://github.com/MariaDB/server/
31+
Vcs-Git: https://github.com/MariaDB/server.git
3232

3333
Package: libmariadbclient18
3434
Architecture: any
@@ -450,4 +450,4 @@ Package: mariadb-backup-10.1
450450
Section: database
451451
Architecture: any
452452
Depends: libarchive12 | libarchive13
453-
Description: Backup tool for MariaDB server
453+
Description: Backup tool for MariaDB server

mysql-test/r/func_time.result

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,6 +2904,30 @@ NULL
29042904
Warnings:
29052905
Warning 1441 Datetime function: datetime field overflow
29062906
#
2907+
# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
2908+
#
2909+
CREATE TABLE t1 (i INT, d DATE);
2910+
INSERT INTO t1 VALUES (1, '1970-01-01');
2911+
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
2912+
MAX(NULLIF(i,1))
2913+
NULL
2914+
Warnings:
2915+
Warning 1441 Datetime function: datetime field overflow
2916+
DROP TABLE t1;
2917+
CREATE TABLE t1 (i INT, d DATE);
2918+
INSERT INTO t1 VALUES (1, '1970-01-01');
2919+
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
2920+
CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR))
2921+
NULL
2922+
Warnings:
2923+
Warning 1441 Datetime function: datetime field overflow
2924+
DROP TABLE t1;
2925+
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
2926+
CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR))
2927+
NULL
2928+
Warnings:
2929+
Warning 1441 Datetime function: datetime field overflow
2930+
#
29072931
# End of 10.0 tests
29082932
#
29092933
#

mysql-test/r/subselect_mat.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,21 @@ a b sq
27572757
4 2 1
27582758
drop table t1, t2;
27592759
#
2760+
# MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
2761+
#
2762+
CREATE TABLE t1 (i INT);
2763+
INSERT INTO t1 VALUES (1),(2);
2764+
CREATE TABLE t2 (f CHAR(1));
2765+
INSERT INTO t2 VALUES ('a'),('b');
2766+
explain
2767+
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
2768+
id select_type table type possible_keys key key_len ref rows Extra
2769+
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2770+
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2
2771+
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
2772+
f
2773+
DROP TABLE t1, t2;
2774+
#
27602775
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
27612776
# UNION ALL
27622777
#

mysql-test/t/func_time.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,22 @@ SELECT ADDDATE(DATE'0000-01-01', INTERVAL '3652423:0:0:315569433559' DAY_SECOND)
17621762
SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:87658175:0:315569433559' DAY_SECOND);
17631763
SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:0:5259490559:315569433599' DAY_SECOND);
17641764

1765+
--echo #
1766+
--echo # MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
1767+
--echo #
1768+
1769+
CREATE TABLE t1 (i INT, d DATE);
1770+
INSERT INTO t1 VALUES (1, '1970-01-01');
1771+
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
1772+
DROP TABLE t1;
1773+
1774+
CREATE TABLE t1 (i INT, d DATE);
1775+
INSERT INTO t1 VALUES (1, '1970-01-01');
1776+
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
1777+
DROP TABLE t1;
1778+
1779+
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
1780+
17651781

17661782
--echo #
17671783
--echo # End of 10.0 tests

mysql-test/t/subselect_mat.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,19 @@ FROM t1;
255255

256256
drop table t1, t2;
257257

258+
--echo #
259+
--echo # MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
260+
--echo #
261+
262+
CREATE TABLE t1 (i INT);
263+
INSERT INTO t1 VALUES (1),(2);
264+
CREATE TABLE t2 (f CHAR(1));
265+
INSERT INTO t2 VALUES ('a'),('b');
266+
explain
267+
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
268+
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
269+
DROP TABLE t1, t2;
270+
258271
--echo #
259272
--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
260273
--echo # UNION ALL

sql/opt_subselect.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,10 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
875875
Make sure that create_tmp_table will not fail due to too long keys.
876876
See MDEV-7122. This check is performed inside create_tmp_table also and
877877
we must do it so that we know the table has keys created.
878+
Make sure that the length of the key for the temp_table is atleast
879+
greater than 0.
878880
*/
879-
if (total_key_length > tmp_table_max_key_length() ||
881+
if (!total_key_length || total_key_length > tmp_table_max_key_length() ||
880882
elements > tmp_table_max_key_parts())
881883
DBUG_RETURN(FALSE);
882884

sql/sql_time.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,8 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type,
959959
ltime->day= 0;
960960
return 0;
961961
}
962+
else if (ltime->neg)
963+
goto invalid_date;
962964

963965
if (int_type != INTERVAL_DAY)
964966
ltime->time_type= MYSQL_TIMESTAMP_DATETIME; // Return full date

0 commit comments

Comments
 (0)