Skip to content

Commit

Permalink
MDEV-17959 Assertion `opt_bootstrap || mysql_parse_status || thd->lex…
Browse files Browse the repository at this point in the history
…->select_stack_top == 0' failed in parse_sql upon DELETE HISTORY under ORACLE mode
  • Loading branch information
abarkov committed Dec 27, 2018
1 parent 829fce9 commit f409eb4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mysql-test/suite/compat/oracle/r/versioning.result
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ SELECT * FROM t1 FOR SYSTEM_TIME AS OF (NOW()+INTERVAL 10 YEAR);
a
20
DROP TABLE t1;
#
# MDEV-17959 Assertion `opt_bootstrap || mysql_parse_status || thd->lex->select_stack_top == 0' failed in parse_sql upon DELETE HISTORY under ORACLE mode
#
SET SQL_MODE= ORACLE;
CREATE TABLE t1 (a INT);
DELETE HISTORY FROM t1;
ERROR HY000: Table `t1` is not system-versioned
DROP TABLE t1;
10 changes: 10 additions & 0 deletions mysql-test/suite/compat/oracle/t/versioning.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ INSERT INTO t1 VALUES (20);
SELECT * FROM t1 FOR SYSTEM_TIME ALL;
SELECT * FROM t1 FOR SYSTEM_TIME AS OF (NOW()+INTERVAL 10 YEAR);
DROP TABLE t1;

--echo #
--echo # MDEV-17959 Assertion `opt_bootstrap || mysql_parse_status || thd->lex->select_stack_top == 0' failed in parse_sql upon DELETE HISTORY under ORACLE mode
--echo #

SET SQL_MODE= ORACLE;
CREATE TABLE t1 (a INT);
--error ER_VERS_NOT_VERSIONED
DELETE HISTORY FROM t1;
DROP TABLE t1;
1 change: 1 addition & 0 deletions sql/sql_yacc_ora.yy
Original file line number Diff line number Diff line change
Expand Up @@ -13679,6 +13679,7 @@ delete_part2:
| HISTORY_SYM delete_single_table opt_delete_system_time
{
Lex->last_table()->vers_conditions= Lex->vers_conditions;
Lex->pop_select(); //main select
}
;

Expand Down

0 comments on commit f409eb4

Please sign in to comment.