MDEV-24545 Sequence created by one connection remains invisible to another
row_merge_is_index_usable(): Allow access to any SEQUENCE, even if it was created after the read view. SQL sequences are no-rollback tables with no history at all.
This commit is contained in:
parent
0785771e57
commit
29b2f3dbb5
@ -31,3 +31,16 @@ connection con1;
|
|||||||
disconnect con1;
|
disconnect con1;
|
||||||
connection default;
|
connection default;
|
||||||
DROP TABLE s1,s2;
|
DROP TABLE s1,s2;
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||||
|
connect con1,localhost,root,,test;
|
||||||
|
CREATE SEQUENCE s1 ENGINE=InnoDB;
|
||||||
|
FLUSH TABLES;
|
||||||
|
disconnect con1;
|
||||||
|
connection default;
|
||||||
|
SELECT NEXTVAL(s1);
|
||||||
|
NEXTVAL(s1)
|
||||||
|
1
|
||||||
|
COMMIT;
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP SEQUENCE s1;
|
||||||
|
@ -56,3 +56,22 @@ FLUSH TABLES;
|
|||||||
--connection default
|
--connection default
|
||||||
|
|
||||||
DROP TABLE s1,s2;
|
DROP TABLE s1,s2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-24545 Sequence created by one connection remains invisible to another
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||||
|
|
||||||
|
--connect (con1,localhost,root,,test)
|
||||||
|
CREATE SEQUENCE s1 ENGINE=InnoDB;
|
||||||
|
FLUSH TABLES;
|
||||||
|
--disconnect con1
|
||||||
|
|
||||||
|
--connection default
|
||||||
|
SELECT NEXTVAL(s1);
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP SEQUENCE s1;
|
||||||
|
@ -4478,7 +4478,7 @@ row_merge_is_index_usable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return(!index->is_corrupted()
|
return(!index->is_corrupted()
|
||||||
&& (index->table->is_temporary()
|
&& (index->table->is_temporary() || index->table->no_rollback()
|
||||||
|| index->trx_id == 0
|
|| index->trx_id == 0
|
||||||
|| !trx->read_view.is_open()
|
|| !trx->read_view.is_open()
|
||||||
|| trx->read_view.changes_visible(
|
|| trx->read_view.changes_visible(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user