summaryrefslogtreecommitdiffstats
path: root/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result
blob: 604e5572eab66ed97894deef252b8c857f303f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#
# Testing upgrading from server without merges for auto_increment
# to new server with such support.
#
set debug_dbug='+d,myrocks_autoinc_upgrade';
create table t (i int primary key auto_increment);
insert into t values ();
insert into t values ();
insert into t values ();
select * from t;
i
1
2
3
delete from t where i > 1;
select * from t;
i
1
select table_name, index_name, auto_increment
from information_schema.rocksdb_ddl where table_name = 't';
table_name	index_name	auto_increment
t	PRIMARY	NULL
set debug_dbug='-d,myrocks_autoinc_upgrade';
insert into t values ();
insert into t values ();
insert into t values ();
select * from t;
i
1
2
3
4
select table_name, index_name, auto_increment
from information_schema.rocksdb_ddl where table_name = 't';
table_name	index_name	auto_increment
t	PRIMARY	5
delete from t where i > 1;
insert into t values ();
insert into t values ();
insert into t values ();
select * from t;
i
1
5
6
7
drop table t;
#
# Testing crash safety of transactions.
#
create table t (i int primary key auto_increment);
insert into t values ();
insert into t values ();
insert into t values ();
# Before anything
begin;
insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_before";
commit;
ERROR HY000: Lost connection to MySQL server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema	table_name	auto_increment > @row_max
test	t	1
# After engine prepare
begin;
insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after_prepare";
commit;
ERROR HY000: Lost connection to MySQL server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema	table_name	auto_increment > @row_max
test	t	1
# After binlog
begin;
insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after_log";
commit;
ERROR HY000: Lost connection to MySQL server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema	table_name	auto_increment > @row_max
test	t	1
# After everything
begin;
insert into t values ();
insert into t values ();
set debug_dbug="+d,crash_commit_after";
commit;
ERROR HY000: Lost connection to MySQL server during query
select max(i) into @row_max from t;
select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't';
table_schema	table_name	auto_increment > @row_max
test	t	1
drop table t;