mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-29021 add test case from MDEV-29013
This test case was also fixed by adding update_virtual_columns.
This commit is contained in:
committed by
Sergei Golubchik
parent
b0db7239b1
commit
aa9e173e9e
@ -650,7 +650,7 @@ set debug_sync= reset;
|
|||||||
#
|
#
|
||||||
# MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
|
# MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
|
||||||
#
|
#
|
||||||
create table t1 (a char(9), b char(9) as (a) stored) engine=InnoDB;
|
create table t1 (a char(9), b char(9) as (a) stored);
|
||||||
insert into t1(a) values ('foobar');
|
insert into t1(a) values ('foobar');
|
||||||
set debug_sync= 'now wait_for downgraded';
|
set debug_sync= 'now wait_for downgraded';
|
||||||
connection con2;
|
connection con2;
|
||||||
@ -708,6 +708,24 @@ connection default;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
set debug_sync= reset;
|
set debug_sync= reset;
|
||||||
#
|
#
|
||||||
|
# DELETE with added virtual column
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a CHAR(3), b CHAR(3) AS (a));
|
||||||
|
INSERT INTO t1 (a) VALUES ('foo'),('bar');
|
||||||
|
set debug_sync= 'now wait_for downgraded';
|
||||||
|
connection con2;
|
||||||
|
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||||
|
ALTER TABLE t1 ADD c INT, ALGORITHM=COPY, LOCK=NONE;
|
||||||
|
connection default;
|
||||||
|
DELETE FROM t1;
|
||||||
|
set debug_sync= 'now signal goforit';
|
||||||
|
connection con2;
|
||||||
|
select * from t1;
|
||||||
|
a b c
|
||||||
|
connection default;
|
||||||
|
DROP TABLE t1;
|
||||||
|
set debug_sync= reset;
|
||||||
|
#
|
||||||
# Do not ignore sql_mode when replicating
|
# Do not ignore sql_mode when replicating
|
||||||
#
|
#
|
||||||
create table t1 (a int);
|
create table t1 (a int);
|
||||||
|
@ -804,7 +804,7 @@ set debug_sync= reset;
|
|||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
|
--echo # MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
|
||||||
--echo #
|
--echo #
|
||||||
create table t1 (a char(9), b char(9) as (a) stored) engine=InnoDB;
|
create table t1 (a char(9), b char(9) as (a) stored);
|
||||||
insert into t1(a) values ('foobar');
|
insert into t1(a) values ('foobar');
|
||||||
|
|
||||||
--send set debug_sync= 'now wait_for downgraded'
|
--send set debug_sync= 'now wait_for downgraded'
|
||||||
@ -875,6 +875,32 @@ show create table t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
set debug_sync= reset;
|
set debug_sync= reset;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # DELETE with added virtual column
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a CHAR(3), b CHAR(3) AS (a));
|
||||||
|
INSERT INTO t1 (a) VALUES ('foo'),('bar');
|
||||||
|
--send
|
||||||
|
set debug_sync= 'now wait_for downgraded';
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
|
||||||
|
--send
|
||||||
|
ALTER TABLE t1 ADD c INT, ALGORITHM=COPY, LOCK=NONE;
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
--reap
|
||||||
|
DELETE FROM t1;
|
||||||
|
set debug_sync= 'now signal goforit';
|
||||||
|
|
||||||
|
--connection con2
|
||||||
|
--reap
|
||||||
|
select * from t1;
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
DROP TABLE t1;
|
||||||
|
set debug_sync= reset;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Do not ignore sql_mode when replicating
|
--echo # Do not ignore sql_mode when replicating
|
||||||
--echo #
|
--echo #
|
||||||
|
Reference in New Issue
Block a user