1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-28566 Assertion `!expr->is_fixed()' failed in bool virtual_column_info::fix_session_expr(THD*)

The problem was that table->vcol_cleanup_expr() was not called in case
of error in open_table().
This commit is contained in:
Monty
2023-11-24 20:54:43 +02:00
parent 08e6431c8c
commit 06f7ed4dcd
3 changed files with 75 additions and 0 deletions

View File

@ -745,3 +745,41 @@ SELECT id, ts, vc INTO OUTFILE 'load_t1' FROM t1;
LOAD DATA INFILE 'load_t1' REPLACE INTO TABLE t1 (id, ts, vc);
INSERT IGNORE INTO t1 (id) VALUES (2);
DROP TABLE t1;
#
# MDEV-28566 Assertion `!expr->is_fixed()' failed in bool
# Virtual_column_info::fix_session_expr(THD*)
#
CREATE TABLE t1 (c1 CHAR(1));
FLUSH TABLES WITH READ LOCK;
UPDATE t1 SET c1=1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
SELECT * FROM t1;
c1
DROP TABLE t1;
CREATE TABLE t1 (c1 CHAR AS (CONCAT (0,DAYNAME (0))));
FLUSH TABLES WITH READ LOCK;
UPDATE t1 SET c1=1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
UPDATE t1 SET c1=1;
SELECT * FROM t1;
c1
DROP TABLE t1;
CREATE TABLE t1 (a int primary key, c1 CHAR AS (CONCAT (0,DAYNAME (0))));
insert into t1 (a) values (1);
FLUSH TABLES WITH READ LOCK;
UPDATE t1 SET c1=1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
UPDATE t1 SET a=2;
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
UPDATE t1 SET a=2;
UPDATE t1 SET c1=1;
ERROR HY000: The value specified for generated column 'c1' in table 't1' has been ignored
SELECT * FROM t1;
a c1
2 NULL
Warnings:
Warning 1292 Incorrect datetime value: '0'
DROP TABLE t1;

View File

@ -724,3 +724,38 @@ DROP TABLE t1;
--remove_file $datadir/test/load_t1
--echo #
--echo # MDEV-28566 Assertion `!expr->is_fixed()' failed in bool
--echo # Virtual_column_info::fix_session_expr(THD*)
--echo #
CREATE TABLE t1 (c1 CHAR(1));
FLUSH TABLES WITH READ LOCK;
--error ER_CANT_UPDATE_WITH_READLOCK
UPDATE t1 SET c1=1;
unlock tables;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (c1 CHAR AS (CONCAT (0,DAYNAME (0))));
FLUSH TABLES WITH READ LOCK;
--error ER_CANT_UPDATE_WITH_READLOCK
UPDATE t1 SET c1=1;
unlock tables;
UPDATE t1 SET c1=1;
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a int primary key, c1 CHAR AS (CONCAT (0,DAYNAME (0))));
insert into t1 (a) values (1);
FLUSH TABLES WITH READ LOCK;
--error ER_CANT_UPDATE_WITH_READLOCK
UPDATE t1 SET c1=1;
--error ER_CANT_UPDATE_WITH_READLOCK
UPDATE t1 SET a=2;
unlock tables;
UPDATE t1 SET a=2;
--error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
UPDATE t1 SET c1=1;
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -2191,6 +2191,7 @@ retry_share:
if (thd->has_read_only_protection())
{
MYSQL_UNBIND_TABLE(table->file);
table->vcol_cleanup_expr(thd);
tc_release_table(table);
DBUG_RETURN(TRUE);
}
@ -2210,6 +2211,7 @@ retry_share:
if (result)
{
MYSQL_UNBIND_TABLE(table->file);
table->vcol_cleanup_expr(thd);
tc_release_table(table);
DBUG_RETURN(TRUE);
}