Commit 39cc2545 authored by Oleg Smirnov's avatar Oleg Smirnov

MDEV-24529 Assertion failed in vers_select_conds_t::print

This commit adds processing of SYSTEM_TIME_BEFORE and SYSTEM_TIME_HISTORY
to vers_select_conds_t::print().
parent 8a322b6b
......@@ -187,3 +187,15 @@ x
1
drop prepare stmt;
drop table t1;
#
# MDEV-28201 Server crashes upon SHOW ANALYZE/EXPLAIN FORMAT=JSON
#
CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
SET optimizer_trace= 'enabled=on';
DELETE HISTORY FROM v1 BEFORE SYSTEM_TIME '2021-01-01';
ERROR HY000: The target table v1 of the DELETE is not updatable
DELETE HISTORY FROM v1;
ERROR HY000: The target table v1 of the DELETE is not updatable
DROP VIEW v1;
DROP TABLE t1;
......@@ -192,4 +192,17 @@ select * from t1;
drop prepare stmt;
drop table t1;
--echo #
--echo # MDEV-28201 Server crashes upon SHOW ANALYZE/EXPLAIN FORMAT=JSON
--echo #
CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
SET optimizer_trace= 'enabled=on';
--error ER_NON_UPDATABLE_TABLE
DELETE HISTORY FROM v1 BEFORE SYSTEM_TIME '2021-01-01';
--error ER_NON_UPDATABLE_TABLE
DELETE HISTORY FROM v1;
DROP VIEW v1;
DROP TABLE t1;
--source suite/versioning/common_finish.inc
......@@ -790,8 +790,10 @@ void vers_select_conds_t::print(String *str, enum_query_type query_type) const
end.print(str, query_type, STRING_WITH_LEN(" AND "));
break;
case SYSTEM_TIME_BEFORE:
start.print(str, query_type, STRING_WITH_LEN(" FOR SYSTEM_TIME BEFORE "));
break;
case SYSTEM_TIME_HISTORY:
DBUG_ASSERT(0);
// nothing to add
break;
case SYSTEM_TIME_ALL:
str->append(" FOR SYSTEM_TIME ALL");
......
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