mirror of
https://github.com/MariaDB/server.git
synced 2025-06-03 07:02:23 +03:00
- 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
28 lines
670 B
Plaintext
28 lines
670 B
Plaintext
--source include/have_udf.inc
|
|
--source include/have_log_bin.inc
|
|
--source include/binlog_start_pos.inc
|
|
|
|
#
|
|
# Testing binary logging of sequences
|
|
#
|
|
|
|
--disable_query_log
|
|
reset master; # get rid of previous tests binlog
|
|
--enable_query_log
|
|
|
|
create or replace sequence s1 cache 3;
|
|
select next value for s1, min_value from s1 where max_value> 1;
|
|
select next value for s1, min_value from s1 where max_value> 2;
|
|
select next value for s1, min_value from s1 where max_value> 3;
|
|
select next value for s1, min_value from s1 where max_value> 4;
|
|
|
|
#
|
|
# Alter sequence
|
|
#
|
|
alter sequence s1 maxvalue 1000;
|
|
|
|
drop sequence s1;
|
|
|
|
--let $binlog_file = LAST
|
|
source include/show_binlog_events.inc;
|