Commit 914245cc authored by Sergey Petrunya's avatar Sergey Petrunya

BUG#934597: Assertion `! is_set()' failed in Diagnostics_area::set_ok_status(THD...

- After the exec_const_cond->val_int() call, check for error and return.
  (if we don't do it, we will eventually hit an error when trying to set status OK in 
   the diagnostics area, which already has an error status).
parent 567d871f
...@@ -2141,6 +2141,20 @@ WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.a < ANY (SELECT t4.a FROM t4) and t3 ...@@ -2141,6 +2141,20 @@ WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.a < ANY (SELECT t4.a FROM t4) and t3
c a b c a b
10 7 0 10 7 0
drop table t2, t3, t4; drop table t2, t3, t4;
#
# BUG#934597: Assertion `! is_set()' failed in Diagnostics_area::set_ok_status(THD...
#
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('u'),('k');
CREATE TABLE t2 AS
SELECT a AS field1 FROM t1
WHERE ( SELECT alias1.a
FROM t1 AS alias1
) IS NOT NULL;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t2;
ERROR 42S02: Unknown table 't2'
DROP TABLE t1;
set optimizer_switch=@subselect4_tmp; set optimizer_switch=@subselect4_tmp;
SET optimizer_switch= @@global.optimizer_switch; SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size; set @@tmp_table_size= @@global.tmp_table_size;
...@@ -1779,6 +1779,22 @@ WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.a < ANY (SELECT t4.a FROM t4) and t3 ...@@ -1779,6 +1779,22 @@ WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.a < ANY (SELECT t4.a FROM t4) and t3
drop table t2, t3, t4; drop table t2, t3, t4;
--echo #
--echo # BUG#934597: Assertion `! is_set()' failed in Diagnostics_area::set_ok_status(THD...
--echo #
CREATE TABLE t1 ( a VARCHAR(1) );
INSERT INTO t1 VALUES ('u'),('k');
--error ER_SUBQUERY_NO_1_ROW
CREATE TABLE t2 AS
SELECT a AS field1 FROM t1
WHERE ( SELECT alias1.a
FROM t1 AS alias1
) IS NOT NULL;
--error ER_BAD_TABLE_ERROR
DROP TABLE t2;
DROP TABLE t1;
set optimizer_switch=@subselect4_tmp; set optimizer_switch=@subselect4_tmp;
SET optimizer_switch= @@global.optimizer_switch; SET optimizer_switch= @@global.optimizer_switch;
......
...@@ -2161,6 +2161,15 @@ JOIN::exec() ...@@ -2161,6 +2161,15 @@ JOIN::exec()
!exec_const_cond->val_int()) !exec_const_cond->val_int())
zero_result_cause= "Impossible WHERE noticed after reading const tables"; zero_result_cause= "Impossible WHERE noticed after reading const tables";
/*
We've called exec_const_cond->val_int(). This may have caused an error.
*/
if (thd->is_error())
{
error= thd->is_error();
DBUG_VOID_RETURN;
}
if (zero_result_cause) if (zero_result_cause)
{ {
(void) return_zero_rows(this, result, select_lex->leaf_tables, (void) return_zero_rows(this, result, select_lex->leaf_tables,
......
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