Skip to content

Commit

Permalink
More test fixes - #6 [RocksDB part]
Browse files Browse the repository at this point in the history
Summary:
1. Disable rpl_skip_tx_api and read_free_rpl related tests
2. Add analyze table t to force information_schema update
3. Add missing MYSQL_SST_DUMP environment variable.

Reviewed By: lloyd

Differential Revision: D17622876
  • Loading branch information
yizhang82 authored and inikep committed Jan 17, 2022
1 parent d155d38 commit 9e17e8b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 19 deletions.
8 changes: 8 additions & 0 deletions mysql-test/suite/rocksdb/include/autoinc_crash_safe.inc
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ insert into t values (123);
alter table t modify i int auto_increment;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

--echo # Add column j.
alter table t add column j int;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

--echo # Rename tables.
Expand All @@ -111,33 +113,39 @@ rename table t2 to t;

--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

--echo # Change auto_increment property
alter table t auto_increment = 1000;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

alter table t auto_increment = 1;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

alter table t drop primary key, add key (i), auto_increment = 1;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

alter table t add key (j), auto_increment = 1;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

alter table t modify i int;
alter table t add column (k int auto_increment), add key(k), auto_increment=15;
--let $rpl_server_number = 1
--source include/rpl_restart_server.inc
analyze table t;
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';

--echo # Drop table.
Expand Down
58 changes: 41 additions & 17 deletions mysql-test/suite/rocksdb/r/autoinc_crash_safe.result
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ commit;
delete from t;
# Master value before restart
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 7
# Slave value before restart
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 6
include/stop_slave.inc
include/rpl_restart_server.inc [server_number=1]
# Master value after restart
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
test t 6
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 7
include/rpl_restart_server.inc [server_number=2]
include/start_slave.inc
# Slave value after restart
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 6
#
# Testing interaction of merge markers with various DDL statements.
Expand All @@ -51,60 +51,84 @@ alter table t add primary key (i);
alter table t modify i int auto_increment;
include/rpl_restart_server.inc [server_number=1]
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
test t 6
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 7
# Remove auto_increment property.
alter table t modify i int;
include/rpl_restart_server.inc [server_number=1]
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
test t NULL
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 7
# Add auto_increment property.
insert into t values (123);
alter table t modify i int auto_increment;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
# Add column j.
alter table t add column j int;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
# Rename tables.
rename table t to t2;
rename table t2 to t;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
# Change auto_increment property
alter table t auto_increment = 1000;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 1000
alter table t auto_increment = 1;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
alter table t drop primary key, add key (i), auto_increment = 1;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
alter table t add key (j), auto_increment = 1;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 124
alter table t modify i int;
alter table t add column (k int auto_increment), add key(k), auto_increment=15;
include/rpl_restart_server.inc [server_number=1]
analyze table t;
Table Op Msg_type Msg_text
test.t analyze status OK
select table_schema, table_name, auto_increment from information_schema.tables where table_name = 't';
table_schema table_name auto_increment
TABLE_SCHEMA TABLE_NAME AUTO_INCREMENT
test t 16
# Drop table.
drop table t;
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/rocksdb/t/autoinc_crash_safe.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ binlog_format=row
[mysqld.2]
binlog_format=row
slave_parallel_workers=1
rpl_skip_tx_api=ON
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ binlog_format=row
[mysqld.2]
binlog_format=row
slave_parallel_workers=1
rpl_skip_tx_api=ON

0 comments on commit 9e17e8b

Please sign in to comment.