summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence/next.result
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-05-23 17:18:31 +0300
committerMonty <monty@mariadb.org>2017-05-23 21:12:27 +0300
commit6a779a6d28fa69be4c89b72205a11398859f07ca (patch)
tree3989411d5e69eca72359ab909c10e37cf778378e /mysql-test/suite/sql_sequence/next.result
parentd9304914bed2d6d45dbc9f43aa1e2f7ea3bbeb13 (diff)
downloadmariadb-git-6a779a6d28fa69be4c89b72205a11398859f07ca.tar.gz
Make SEQUENCE working with replication
- 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
Diffstat (limited to 'mysql-test/suite/sql_sequence/next.result')
-rw-r--r--mysql-test/suite/sql_sequence/next.result87
1 files changed, 87 insertions, 0 deletions
diff --git a/mysql-test/suite/sql_sequence/next.result b/mysql-test/suite/sql_sequence/next.result
index 1e0b7e28a10..b7d3a8ff26d 100644
--- a/mysql-test/suite/sql_sequence/next.result
+++ b/mysql-test/suite/sql_sequence/next.result
@@ -287,6 +287,93 @@ select * from t9;
next_value min_value max_value start increment cache cycle round
6 1 10 1 1 5 1 2
drop sequence t9;
+CREATE SEQUENCE s1 cache=0;
+select * from s1;
+next_value min_value max_value start increment cache cycle round
+1 1 9223372036854775806 1 1 0 0 0
+select next value for s1;
+next value for s1
+1
+select next_value from s1;
+next_value
+2
+select next value for s1;
+next value for s1
+2
+select next_value from s1;
+next_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=1;
+select next_value from s1;
+next_value
+1
+select next value for s1;
+next value for s1
+1
+select next_value from s1;
+next_value
+2
+select next value for s1;
+next value for s1
+2
+select next_value from s1;
+next_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1 cache=2;
+select next_value from s1;
+next_value
+1
+select next value for s1;
+next value for s1
+1
+select next_value from s1;
+next_value
+3
+select next value for s1;
+next value for s1
+2
+select next_value from s1;
+next_value
+3
+DROP SEQUENCE s1;
+CREATE SEQUENCE s1;
+select next value for s1;
+next value for s1
+1
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+next value for s1
+3
+select next value for s1;
+next value for s1
+4
+alter sequence s1 increment -2;
+select * from s1;
+next_value min_value max_value start increment cache cycle round
+1001 1 9223372036854775806 1 -2 1000 0 0
+select next value for s1;
+next value for s1
+1001
+select next value for s1;
+next value for s1
+999
+alter sequence s1 restart 6;
+select next value for s1;
+next value for s1
+6
+select next value for s1;
+next value for s1
+4
+select next value for s1;
+next value for s1
+2
+select next value for s1;
+ERROR HY000: Sequence 'test.s1' has run out
+DROP SEQUENCE s1;
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
select next value for t1;
next value for t1