summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-03-15 03:45:28 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-03-15 03:45:28 +0200
commit8152c52e1af608da5d288a4e6fc82e2d804e64cd (patch)
tree8ff56cdb8c9766b04b015f0c5c896a202122abb1 /sql
parent782fb1e016e0342074ca9938e412a14d20d6f793 (diff)
parent3d5dff6cae5cdefe376583f811c9af109ea08080 (diff)
downloadmariadb-git-8152c52e1af608da5d288a4e6fc82e2d804e64cd.tar.gz
Merge remote-tracking branch '10.0' into 10.1
Diffstat (limited to 'sql')
-rw-r--r--sql/opt_subselect.cc4
-rw-r--r--sql/sql_time.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index d7371fa7e3f..12ae3286159 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -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);
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index 2e2c5932c2a..6323538f193 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -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