Updated tests for MySQL 5.7

This commit is contained in:
Carlos Salguero
2017-12-16 20:54:03 -03:00
parent 806caff5f5
commit bb3334de08
6 changed files with 65 additions and 94 deletions

View File

@@ -193,13 +193,13 @@ SKIP: {
# Ignore some dbs and tbls.
test_so(
filters => ['--ignore-databases', 'mysql,sakila,d1,d3,percona_test'],
filters => ['--ignore-databases', 'mysql,sakila,d1,d3,percona_test,sys'],
result => "d2.t1 ",
test_name => '--ignore-databases',
);
test_so(
filters => ['--ignore-databases', 'mysql,sakila,d2,d3,percona_test',
filters => ['--ignore-databases', 'mysql,sakila,d2,d3,percona_test,sys',
'--ignore-tables', 't1,t2'],
result => "d1.t3 ",
test_name => '--ignore-databases and --ignore-tables',
@@ -233,7 +233,7 @@ SKIP: {
);
test_so(
filters => ['--ignore-databases-regex', '(?:^d[23]|mysql|info|sakila|percona_test)',
filters => ['--ignore-databases-regex', '(?:^d[23]|mysql|info|sakila|percona_test|sys)',
'--ignore-tables-regex', 't[^23]'],
result => "d1.t2 d1.t3 ",
test_name => '--ignore-databases-regex',
@@ -266,6 +266,7 @@ SKIP: {
# ########################################################################
# Filter by db-qualified table. There is t1 in both d1 and d2.
# We want only d1.t1.
test_so(
filters => [qw(-t d1.t1)],
result => "d1.t1 ",
@@ -290,10 +291,11 @@ SKIP: {
test_name => '-t d1.t1,d1.t3 (issue 806)',
);
my $want = $sandbox_version le '5.6' ? "d1.t1 " : 'd1.t2 d1.t3 d2.t1 sys.sys_config ';
test_so(
filters => ['--ignore-databases', 'mysql,sakila,percona_test',
'--ignore-tables', 'd1.t1'],
result => "d1.t2 d1.t3 d2.t1 ",
result => $want,
test_name => '--ignore-databases and --ignore-tables d1.t1 (issue 806)',
);
@@ -420,7 +422,7 @@ test_so(
# ############################################################################
test_so(
filters => ['--ignore-databases', 'sakila,mysql'],
filters => ['--ignore-databases', 'sakila,mysql,sys'],
result => "",
lives_ok => 1,
resume => 'sakila.payment',
@@ -430,7 +432,7 @@ test_so(
$dbh->do("CREATE DATABASE zakila");
$dbh->do("CREATE TABLE zakila.bug_911385 (i int)");
test_so(
filters => ['--ignore-databases', 'sakila,mysql'],
filters => ['--ignore-databases', 'sakila,mysql,sys'],
result => "zakila.bug_911385 ",
resume => 'sakila.payment',
test_name => "Bug 911385: ...and continues to the next db"
@@ -438,7 +440,7 @@ test_so(
$dbh->do("DROP DATABASE zakila");
test_so(
filters => [qw(--ignore-tables-regex payment --ignore-databases mysql)],
filters => ['--ignore-tables-regex', 'payment', '--ignore-databases', 'mysql,sys'],
result => "",
lives_ok => 1,
resume => 'sakila.payment',
@@ -446,7 +448,7 @@ test_so(
);
test_so(
filters => [qw(--ignore-tables-regex payment --ignore-databases mysql)],
filters => ['--ignore-tables-regex', 'payment', '--ignore-databases', 'mysql,sys'],
result => "sakila.rental sakila.staff sakila.store ",
resume => 'sakila.payment',
test_name => "Bug 911385: ...and continues to the next table"

View File

@@ -85,14 +85,6 @@ CREATE TABLE `func` (
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
mysql.gtid_executed
CREATE TABLE `gtid_executed` (
`source_uuid` char(36) NOT NULL COMMENT 'uuid of the source where the transaction was originally executed.',
`interval_start` bigint(20) NOT NULL COMMENT 'First number of interval.',
`interval_end` bigint(20) NOT NULL COMMENT 'Last number of interval.',
PRIMARY KEY (`source_uuid`,`interval_start`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
mysql.help_category
CREATE TABLE `help_category` (
`help_category_id` smallint(5) unsigned NOT NULL,
@@ -147,6 +139,38 @@ CREATE TABLE `ndb_binlog_index` (
PRIMARY KEY (`epoch`,`orig_server_id`,`orig_epoch`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
mysql.plugin
CREATE TABLE `plugin` (
`name` varchar(64) NOT NULL DEFAULT '',
`dl` varchar(128) NOT NULL DEFAULT '',
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='MySQL plugins'
mysql.proc
CREATE TABLE `proc` (
`db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`name` char(64) NOT NULL DEFAULT '',
`type` enum('FUNCTION','PROCEDURE') NOT NULL,
`specific_name` char(64) NOT NULL DEFAULT '',
`language` enum('SQL') NOT NULL DEFAULT 'SQL',
`sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
`is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
`security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
`param_list` blob NOT NULL,
`returns` longblob NOT NULL,
`body` longblob NOT NULL,
`definer` char(93) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`body_utf8` longblob,
PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
mysql.procs_priv
CREATE TABLE `procs_priv` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
@@ -535,3 +559,12 @@ CREATE TABLE `store` (
CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
sys.sys_config
CREATE TABLE `sys_config` (
`variable` varchar(128) NOT NULL,
`value` varchar(128) DEFAULT NULL,
`set_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`set_by` varchar(128) DEFAULT NULL,
PRIMARY KEY (`variable`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

File diff suppressed because one or more lines are too long

View File

@@ -22,6 +22,10 @@ use File::Temp qw/ tempdir /;
plan tests => 4;
our $delay = 30;
my $tmp_file = File::Temp->new();
my $tmp_file_name = $tmp_file->filename;
unlink $tmp_file_name;
require "$trunk/bin/pt-online-schema-change";
my $dp = new DSNParser(opts=>$dsn_opts);
@@ -51,6 +55,10 @@ $slave_dbh->do('START SLAVE');
diag('Loading test data');
$sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql");
my $num_rows = 10000;
diag("Loading $num_rows into the table. This might take some time.");
diag(`util/mysql_random_data_load_linux_amd64 --host=127.1 --port=12345 --user=msandbox --password=msandbox test pt178 $num_rows`);
# Run a full table scan query to ensure the slave is behind the master
$master_dbh->do('RESET QUERY CACHE');
$slave_dbh->do('RESET QUERY CACHE');
@@ -60,8 +68,9 @@ $master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
# pt-online-schema-change will wait on the slave at port 12346
my $max_lag = $delay / 2;
my $args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' ";
my $args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' --pid $tmp_file_name";
diag("Starting base test. This is going to take some time due to the delay in the slave");
diag("pid: $tmp_file_name");
my $output = `$trunk/bin/pt-online-schema-change $args 2>&1`;
like(

View File

@@ -1,3 +1,5 @@
if all tables be ...
checksum ...
ERRORS DIFFS ROWS SKIPPED TABLE
0 0 0 0 mysql.columns_priv
0 0 0 0 mysql.db

View File

@@ -1,3 +1,5 @@
if all tables can be ...
checksum ...
ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
0 0 0 1 0 mysql.columns_priv
0 0 0 1 0 mysql.db