diff options
Diffstat (limited to 'mysql-test/suite/innodb_zip/include')
8 files changed, 186 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_zip/include/have_no_undo_tablespaces.inc b/mysql-test/suite/innodb_zip/include/have_no_undo_tablespaces.inc new file mode 100644 index 00000000..4c163e7c --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/have_no_undo_tablespaces.inc @@ -0,0 +1,4 @@ +if (`select count(*) = 0 from information_schema.global_variables where variable_name like 'innodb_undo_tablespaces' and variable_value = 0`) +{ + --skip Test requires innodb_undo_tablespaces=0 +} diff --git a/mysql-test/suite/innodb_zip/include/innodb-wl6045.inc b/mysql-test/suite/innodb_zip/include/innodb-wl6045.inc new file mode 100644 index 00000000..26ce7e72 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb-wl6045.inc @@ -0,0 +1,20 @@ +--echo ===> Testing size=$size +--disable_warnings +--eval CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$size +--enable_warnings + +insert into t1 values(1,"I"); +insert into t1 values(2,"AM"); +insert into t1 values(3,"COMPRESSED"); + +--source include/shutdown_mysqld.inc + +--exec $INNOCHECKSUM $MYSQLD_DATADIR/test/t1.ibd +--exec $INNOCHECKSUM --write=crc32 $MYSQLD_DATADIR/test/t1.ibd +--exec $INNOCHECKSUM --strict-check=crc32 $MYSQLD_DATADIR/test/t1.ibd +--exec $INNOCHECKSUM --write=none $MYSQLD_DATADIR/test/t1.ibd +--exec $INNOCHECKSUM --strict-check=none $MYSQLD_DATADIR/test/t1.ibd + +--source include/start_mysqld.inc +select * from t1; +drop table t1; diff --git a/mysql-test/suite/innodb_zip/include/innodb_create_tab_indx.inc b/mysql-test/suite/innodb_zip/include/innodb_create_tab_indx.inc new file mode 100644 index 00000000..413a0262 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_create_tab_indx.inc @@ -0,0 +1,16 @@ +--echo # Create table & Index + +eval CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(255)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$block_size; + + +let $i = 9; +while ($i) { + +eval CREATE INDEX idx$i ON tab5(col_$i(10)); +dec $i; +} + + diff --git a/mysql-test/suite/innodb_zip/include/innodb_dml_ops.inc b/mysql-test/suite/innodb_zip/include/innodb_dml_ops.inc new file mode 100644 index 00000000..4908dfb6 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_dml_ops.inc @@ -0,0 +1,82 @@ +delimiter |; +create procedure populate_t1() +begin + declare i int default 1; + while (i <= 200) do + insert into t1 values (i, 'a', 'b'); + set i = i + 1; + end while; +end| +create procedure populate_t1_small() +begin + declare i int default 1; + while (i <= 20) do + insert into t1 values (i, 'c', 'd'); + set i = i + 1; + end while; +end| +create procedure populate_t1_small2() +begin + declare i int default 30; + while (i <= 50) do + insert into t1 values (i, 'e', 'f'); + set i = i + 1; + end while; +end| +delimiter ;| +# +begin; +select count(*) from t1; +call populate_t1(); +select count(*) from t1; +select * from t1 limit 10; +rollback; +select count(*) from t1; +# +begin; +call populate_t1(); +select count(*) from t1; +commit; +select count(*) from t1; +# +truncate table t1; +select count(*) from t1; +# +call populate_t1_small(); +select count(*) from t1; +rollback; +select count(*) from t1; +truncate table t1; +# +call populate_t1(); +select count(*) from t1; +delete from t1 where keyc <= 60; +select count(*) from t1; +call populate_t1_small(); +select count(*) from t1; +select * from t1 limit 10; +begin; +call populate_t1_small2(); +select count(*) from t1; +select * from t1 where keyc > 30 limit 10; +rollback; +select count(*) from t1; +select * from t1 where keyc > 30 limit 10; +# +update t1 set keyc = keyc + 2000; +select * from t1 limit 10; +rollback; +begin; +update t1 set keyc = keyc + 2000; +select * from t1 limit 10; +rollback; +select * from t1 limit 10; +commit; +select * from t1 limit 10; +# +insert into t2 select * from t1 where keyc < 2101; +select count(*) from t2; +# +drop procedure populate_t1; +drop procedure populate_t1_small; +drop procedure populate_t1_small2; diff --git a/mysql-test/suite/innodb_zip/include/innodb_fetch_records.inc b/mysql-test/suite/innodb_zip/include/innodb_fetch_records.inc new file mode 100644 index 00000000..5e55293c --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_fetch_records.inc @@ -0,0 +1,7 @@ +--echo =============== +--echo Fetch Records +--echo =============== + +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; diff --git a/mysql-test/suite/innodb_zip/include/innodb_load_data.inc b/mysql-test/suite/innodb_zip/include/innodb_load_data.inc new file mode 100644 index 00000000..1bcb3013 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_load_data.inc @@ -0,0 +1,19 @@ +--echo # Load the data + +SET @col_1 = repeat('a', 100); +SET @col_2 = repeat('b', 100); +SET @col_3 = repeat('c', 100); +SET @col_4 = repeat('d', 100); +SET @col_5 = repeat('e', 100); +SET @col_6 = repeat('f', 100); +SET @col_7 = repeat('g', 100); +SET @col_8 = repeat('h', 100); +SET @col_9 = repeat('i', 100); + +while ($i) { + +eval INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +dec $i; +} +commit; diff --git a/mysql-test/suite/innodb_zip/include/innodb_stats_comp_index.inc b/mysql-test/suite/innodb_zip/include/innodb_stats_comp_index.inc new file mode 100644 index 00000000..d2fe05e5 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_stats_comp_index.inc @@ -0,0 +1,26 @@ +--echo # Check the stats of the table +--echo # Check the size of the ibd file + +-- echo # testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; + +perl; + my $dir = $ENV{'MYSQLD_DATADIR'}."test"; + my $size; + opendir(DIR, $dir) or die $!; + while (my $file = readdir(DIR)) + { + + next unless ($file =~ m/\.ibd$/); + $size = -s "$dir/$file"; + print "The size of the tab5.ibd file: $size\n"; + } + close(DIR); + exit(0) +EOF diff --git a/mysql-test/suite/innodb_zip/include/innodb_stats_restart.inc b/mysql-test/suite/innodb_zip/include/innodb_stats_restart.inc new file mode 100644 index 00000000..13952459 --- /dev/null +++ b/mysql-test/suite/innodb_zip/include/innodb_stats_restart.inc @@ -0,0 +1,12 @@ +--echo =============== +--echo After Restart Chekc the stats of the table +--echo =============== + +-- echo # testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; |