Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d60e5fe3
Commit
d60e5fe3
authored
May 24, 2017
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple replication test for sequences
parent
e5145a5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
189 additions
and
0 deletions
+189
-0
mysql-test/suite/rpl/r/sequence.result
mysql-test/suite/rpl/r/sequence.result
+129
-0
mysql-test/suite/rpl/t/sequence.cnf
mysql-test/suite/rpl/t/sequence.cnf
+8
-0
mysql-test/suite/rpl/t/sequence.test
mysql-test/suite/rpl/t/sequence.test
+52
-0
No files found.
mysql-test/suite/rpl/r/sequence.result
0 → 100644
View file @
d60e5fe3
include/rpl_init.inc [topology=1->2->3]
include/rpl_connect.inc [creating master]
include/rpl_connect.inc [creating slave]
include/rpl_connect.inc [creating slave2]
connection master;
set @@default_storage_engine="aria";
CREATE SEQUENCE s1 cache=10;
create table t1 select * from s1;
select NEXT VALUE for s1,seq from seq_1_to_20;
NEXT VALUE for s1 seq
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 20
insert into t1 select * from s1;
do setval(s1,5, 1, 0);
insert into t1 select * from s1;
do setval(s1, 5000, 1 ,0);
insert into t1 select * from s1;
alter sequence s1 minvalue=-1 start=-1 restart=-1;
insert into t1 select * from s1;
insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0);
insert into t1 select * from s1;
select * from t1;
next_value min_value max_value start increment cache cycle round
1 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
5001 1 9223372036854775806 1 1 10 0 0
-1 -1 9223372036854775806 -1 1 10 0 0
-100 -1000 9223372036854775806 1 1 1000 0 0
connection slave;
select * from t1;
next_value min_value max_value start increment cache cycle round
1 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
5001 1 9223372036854775806 1 1 10 0 0
-1 -1 9223372036854775806 -1 1 10 0 0
-100 -1000 9223372036854775806 1 1 1000 0 0
connection slave2;
select * from t1;
next_value min_value max_value start increment cache cycle round
1 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
21 1 9223372036854775806 1 1 10 0 0
5001 1 9223372036854775806 1 1 10 0 0
-1 -1 9223372036854775806 -1 1 10 0 0
-100 -1000 9223372036854775806 1 1 1000 0 0
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE SEQUENCE s1 cache=10
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
`min_value` bigint(21) NOT NULL COMMENT 'min value',
`max_value` bigint(21) NOT NULL COMMENT 'max value',
`start` bigint(21) NOT NULL COMMENT 'start value',
`increment` bigint(21) NOT NULL COMMENT 'increment value',
`cache` bigint(21) NOT NULL COMMENT 'cache size',
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
) PAGE_CHECKSUM=1
master-bin.000001 # Annotate_rows # # create table t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # select NEXT VALUE for s1,seq from seq_1_to_20
master-bin.000001 # Table_map # # table_id: # (test.s1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # do setval(s1, 5000, 1 ,0)
master-bin.000001 # Table_map # # table_id: # (test.s1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; alter sequence s1 minvalue=-1 start=-1 restart=-1
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into s1 values(-100,-1000,9223372036854775806,1,1,1000,0,0)
master-bin.000001 # Table_map # # table_id: # (test.s1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Annotate_rows # # insert into t1 select * from s1
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
connection master;
drop table s1,t1;
include/rpl_end.inc
mysql-test/suite/rpl/t/sequence.cnf
0 → 100644
View file @
d60e5fe3
!include ../my.cnf
[mysqld.3]
log-slave-updates
[ENV]
SERVER_MYPORT_3= @mysqld.3.port
SERVER_MYSOCK_3= @mysqld.3.socket
mysql-test/suite/rpl/t/sequence.test
0 → 100644
View file @
d60e5fe3
#
# Testing sequences with replication
#
--
source
include
/
have_binlog_format_row
.
inc
--
source
include
/
have_aria
.
inc
--
source
include
/
have_sequence
.
inc
--
let
$rpl_topology
=
1
->
2
->
3
--
source
include
/
rpl_init
.
inc
--
let
$rpl_connection_name
=
master
--
let
$rpl_server_number
=
1
--
source
include
/
rpl_connect
.
inc
--
let
$rpl_connection_name
=
slave
--
let
$rpl_server_number
=
2
--
source
include
/
rpl_connect
.
inc
--
let
$rpl_connection_name
=
slave2
--
let
$rpl_server_number
=
3
--
source
include
/
rpl_connect
.
inc
--
connection
master
set
@@
default_storage_engine
=
"aria"
;
CREATE
SEQUENCE
s1
cache
=
10
;
create
table
t1
select
*
from
s1
;
select
NEXT
VALUE
for
s1
,
seq
from
seq_1_to_20
;
insert
into
t1
select
*
from
s1
;
do
setval
(
s1
,
5
,
1
,
0
);
insert
into
t1
select
*
from
s1
;
do
setval
(
s1
,
5000
,
1
,
0
);
insert
into
t1
select
*
from
s1
;
alter
sequence
s1
minvalue
=-
1
start
=-
1
restart
=-
1
;
insert
into
t1
select
*
from
s1
;
insert
into
s1
values
(
-
100
,
-
1000
,
9223372036854775806
,
1
,
1
,
1000
,
0
,
0
);
insert
into
t1
select
*
from
s1
;
select
*
from
t1
;
--
sync_slave_with_master
select
*
from
t1
;
--
sync_slave_with_master
slave2
select
*
from
t1
;
--
let
$binlog_file
=
LAST
source
include
/
show_binlog_events
.
inc
;
connection
master
;
drop
table
s1
,
t1
;
--
source
include
/
rpl_end
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment