diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-06-19 14:04:53 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-06-19 14:04:53 +0400 |
commit | f5b128dfad1f46bf73916bc9c803a7152fdd6809 (patch) | |
tree | 447ef763592b99402ced91dd6e6203f2b3c5368f /sql | |
parent | f7b1b2bc5d6e1f923aca0ee8c5232cf095075c7b (diff) | |
parent | c450f7d8d5bfdc0d3ae0fbc634eb22d4b75e7322 (diff) | |
download | mariadb-git-f5b128dfad1f46bf73916bc9c803a7152fdd6809.tar.gz |
Merge remote-tracking branch 'origin/10.0' into 10.1
Diffstat (limited to 'sql')
-rw-r--r-- | sql/opt_subselect.cc | 3 | ||||
-rw-r--r-- | sql/sql_select.cc | 1 | ||||
-rw-r--r-- | sql/table.cc | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 89338928cb5..732ed91fe00 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5955,6 +5955,7 @@ bool JOIN::choose_tableless_subquery_plan() functions produce empty subquery result. There is no need to further rewrite the subquery because it will not be executed at all. */ + exec_const_cond= 0; return FALSE; } @@ -5986,6 +5987,6 @@ bool JOIN::choose_tableless_subquery_plan() tmp_having= having; } } - exec_const_cond= conds; + exec_const_cond= zero_result_cause ? 0 : conds; return FALSE; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c52f74fbd4a..2f2780d7358 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1261,7 +1261,6 @@ JOIN::optimize_inner() { DBUG_PRINT("info", ("Zero limit")); zero_result_cause= "Zero limit"; - conds= 0; } table_count= top_join_tab_count= 0; error= 0; diff --git a/sql/table.cc b/sql/table.cc index 4407d631db8..c3ddc75ede7 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1533,7 +1533,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if ((uchar)field_type == (uchar)MYSQL_TYPE_VIRTUAL) { - DBUG_ASSERT(interval_nr); // Expect non-null expression + if (!interval_nr) // Expect non-null expression + goto err; /* The interval_id byte in the .frm file stores the length of the expression statement for a virtual column. |