mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Fixed assertion Assertion `!table->pos_in_locked_tables' failed
MDEV-19591 Assertion `!table->pos_in_locked_tables' failed in tc_release_table upon altering table into S3 under lock. The problem was that thd->open_tables->pos_in_locked_tables was not reset when alter table failed to reopen a locked table.
This commit is contained in:
parent
2e665fb294
commit
bb6d674df9
2 changed files with 36 additions and 0 deletions
|
|
@ -89,6 +89,25 @@ count(*) sum(a) sum(b) sum(c) sum(d)
|
|||
10 55 155 NULL NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Test ALTER TABLE with locked table for S3
|
||||
#
|
||||
create table t1 (a int, b int) engine=aria select seq as a,seq+10 as b from seq_1_to_10;
|
||||
lock table t1 write;
|
||||
alter table t1 add column c int, engine=s3;
|
||||
ERROR HY000: Table 't1' is read only
|
||||
unlock tables;
|
||||
select count(*), sum(a), sum(b), sum(c) from t1;
|
||||
count(*) sum(a) sum(b) sum(c)
|
||||
10 55 155 NULL
|
||||
lock table t1 write;
|
||||
ERROR HY000: Table 't1' is read only
|
||||
lock table t1 read;
|
||||
select count(*), sum(a), sum(b), sum(c) from t1;
|
||||
count(*) sum(a) sum(b) sum(c)
|
||||
10 55 155 NULL
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
#
|
||||
# Test RENAME TABLE
|
||||
#
|
||||
create table t1 (a int, b int) engine=aria select seq as a, seq+10 as b from seq_1_to_10;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,23 @@ show create table t1;
|
|||
select count(*), sum(a), sum(b), sum(c), sum(d) from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Test ALTER TABLE with locked table for S3
|
||||
--echo #
|
||||
|
||||
create table t1 (a int, b int) engine=aria select seq as a,seq+10 as b from seq_1_to_10;
|
||||
lock table t1 write;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
alter table t1 add column c int, engine=s3;
|
||||
unlock tables;
|
||||
select count(*), sum(a), sum(b), sum(c) from t1;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
lock table t1 write;
|
||||
lock table t1 read;
|
||||
select count(*), sum(a), sum(b), sum(c) from t1;
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Test RENAME TABLE
|
||||
--echo #
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue