mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
6a779a6d28
- Old sequence code forced row based replication for any statements that refered to a sequence table. What is new is that row based replication is now sequence aware: - NEXT VALUE is now generating a short row based event with only next_value and round being replicated. - Short row based events are now on the slave updated as trough SET_VALUE(sequence_name) - Full row based events are on the slave updated with a full insert, which is practically same as ALTER SEQUENCE. - INSERT on a SEQUENCE table does now a EXCLUSIVE LOCK to ensure that it is logged in binary log before any following NEXT VALUE calls. - Enable all sequence tests and fixed found bugs - ALTER SEQUENCE doesn't anymore allow changes that makes the next_value outside of allowed range - SEQUENCE changes are done with TL_WRITE_ALLOW_WRITE. Because of this one can generate a statement for MyISAM with both TL_WRITE_CONCURRENT_INSERT and TL_WRITE_ALLOW_WRITE. To fix a warning I had to add an extra test in thr_lock.c for this. - Removed UPDATE of SEQUENCE (no need to support this as we have ALTER SEQUENCE, which takes the EXCLUSIVE lock properly. - Removed DBUG_ASSERT() in MDL_context::upgrade_shared_lock. This was removed upstream in MySQL 5.6 in 72f823de453. - Simplified test in decided_logging_format() by using sql_command_flags() - Fix that we log DROP SEQUENCE correctly. - Fixed that Aria works with SEQUENCE
43 lines
855 B
Text
43 lines
855 B
Text
--source include/have_sequence.inc
|
|
--source include/have_aria.inc
|
|
|
|
#
|
|
# Simple test of the aria engine
|
|
# As most test is above the engine, we only have to test base functionality
|
|
#
|
|
|
|
set @@default_storage_engine="aria";
|
|
|
|
CREATE SEQUENCE t1 cache=10;
|
|
show create sequence t1;
|
|
select NEXT VALUE for t1,seq from seq_1_to_20;
|
|
select * from t1;
|
|
drop sequence t1;
|
|
|
|
#
|
|
# Create and check
|
|
#
|
|
|
|
create sequence s1;
|
|
check table s1;
|
|
select next value for s1;
|
|
flush tables;
|
|
check table s1;
|
|
select next value for s1;
|
|
flush tables;
|
|
repair table s1;
|
|
select next value for s1;
|
|
drop sequence s1;
|
|
|
|
#
|
|
# ALTER and RENAME
|
|
|
|
CREATE SEQUENCE t1;
|
|
--error ER_SEQUENCE_INVALID_DATA
|
|
alter sequence t1 minvalue=100;
|
|
alter sequence t1 minvalue=100 start=100 restart=100;
|
|
rename table t1 to t2;
|
|
select next value for t2;
|
|
alter table t2 rename to t1;
|
|
select next value for t1;
|
|
drop table t1;
|