1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-03 05:41:09 +03:00

MDEV-23562 Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed upon SELECT from versioned table

The code in vers_select_conds_t::init_from_sysvar() assumed that
the value of the system_versioning_asof is DATETIME.
But it also could be DATE after a query like this:
  SET system_versioning_asof = DATE(NOW());

Fixing Sys_var_vers_asof::update() to convert the value
of the assignment source to DATETIME if it returned DATE.

Now vers_select_conds_t::init_from_sysvar() always gets a DATETIME value.
This commit is contained in:
Alexander Barkov
2020-08-24 22:55:39 +04:00
parent 056766c042
commit 329301d2e6
3 changed files with 24 additions and 1 deletions

View File

@@ -186,4 +186,13 @@ SELECT @@global.system_versioning_asof;
@@global.system_versioning_asof
2002-01-01 00:00:00.000000
SET @@global.system_versioning_asof= DEFAULT;
#
# MDEV-23562 Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed upon SELECT from versioned table
#
CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
SET system_versioning_asof= DATE(NOW());
SELECT * FROM t1;
a
DROP TABLE t1;
SET system_versioning_asof= DEFAULT;
# End of 10.4 tests