Commit 8152c52e authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Merge remote-tracking branch '10.0' into 10.1

parents 782fb1e0 3d5dff6c
......@@ -27,8 +27,8 @@ Build-Depends: bison,
libjemalloc-dev (>= 3.0.0~) [linux-any]
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
Vcs-Git: https://github.com/MariaDB/server.git
Vcs-Browser: https://github.com/MariaDB/server/
Vcs-Git: https://github.com/MariaDB/server.git
Package: libmariadbclient18
Architecture: any
......@@ -450,4 +450,4 @@ Package: mariadb-backup-10.1
Section: database
Architecture: any
Depends: libarchive12 | libarchive13
Description: Backup tool for MariaDB server
\ No newline at end of file
Description: Backup tool for MariaDB server
......@@ -2904,6 +2904,30 @@ NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
#
# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
#
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
MAX(NULLIF(i,1))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
DROP TABLE t1;
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
DROP TABLE t1;
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR))
NULL
Warnings:
Warning 1441 Datetime function: datetime field overflow
#
# End of 10.0 tests
#
#
......
......@@ -2757,6 +2757,21 @@ a b sq
4 2 1
drop table t1, t2;
#
# MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
#
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (f CHAR(1));
INSERT INTO t2 VALUES ('a'),('b');
explain
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
f
DROP TABLE t1, t2;
#
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
# UNION ALL
#
......
......@@ -1762,6 +1762,22 @@ SELECT ADDDATE(DATE'0000-01-01', INTERVAL '3652423:0:0:315569433559' DAY_SECOND)
SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:87658175:0:315569433559' DAY_SECOND);
SELECT ADDDATE(DATE'0000-01-01', INTERVAL '0:0:5259490559:315569433599' DAY_SECOND);
--echo #
--echo # MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
--echo #
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
DROP TABLE t1;
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '1970-01-01');
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
DROP TABLE t1;
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
--echo #
--echo # End of 10.0 tests
......
......@@ -255,6 +255,19 @@ FROM t1;
drop table t1, t2;
--echo #
--echo # MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
--echo #
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (f CHAR(1));
INSERT INTO t2 VALUES ('a'),('b');
explain
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
DROP TABLE t1, t2;
--echo #
--echo # MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
--echo # UNION ALL
......
......@@ -875,8 +875,10 @@ bool subquery_types_allow_materialization(Item_in_subselect *in_subs)
Make sure that create_tmp_table will not fail due to too long keys.
See MDEV-7122. This check is performed inside create_tmp_table also and
we must do it so that we know the table has keys created.
Make sure that the length of the key for the temp_table is atleast
greater than 0.
*/
if (total_key_length > tmp_table_max_key_length() ||
if (!total_key_length || total_key_length > tmp_table_max_key_length() ||
elements > tmp_table_max_key_parts())
DBUG_RETURN(FALSE);
......
......@@ -959,6 +959,8 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type,
ltime->day= 0;
return 0;
}
else if (ltime->neg)
goto invalid_date;
if (int_type != INTERVAL_DAY)
ltime->time_type= MYSQL_TIMESTAMP_DATETIME; // Return full date
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment