Skip to content
Permalink
Browse files
Adjust storage_engine suite according to server changes in 10.2
  • Loading branch information
elenst committed Jun 2, 2017
1 parent aad8cef commit 36e020a
Show file tree
Hide file tree
Showing 35 changed files with 338 additions and 840 deletions.
@@ -13,7 +13,7 @@ ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT '0',
`a` int(11) DEFAULT 0,
`c` char(8) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1
@@ -10,7 +10,7 @@ a
2
ALTER TABLE t1 DISCARD TABLESPACE;
SELECT a FROM t1;
ERROR HY000: Tablespace has been discarded for table 't1'
ERROR HY000: Tablespace has been discarded for table `t1`
ALTER TABLE t1 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1.cfg', will attempt to import without schema verification
@@ -27,7 +27,7 @@ CREATE TABLE t1 ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AS SELECT 1 UNION
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`1` bigint(20) NOT NULL DEFAULT '0'
`1` bigint(20) NOT NULL DEFAULT 0
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1
SELECT * FROM t1;
1
@@ -0,0 +1,12 @@
alter_table_online : MDEV-9705 - Field type conversion warnings have changed to worse
col_opt_null : MDEV-10252 - Row count in 'out of range' warnings is off
col_opt_not_null : MDEV-10252 - Row count in 'out of range' warnings is off
col_opt_unsigned : MDEV-10252 - Row count in 'out of range' warnings is off
col_opt_zerofill : MDEV-10252 - Row count in 'out of range' warnings is off
type_binary : MDEV-10252 - Row count in 'out of range' warnings is off
type_char : MDEV-10252 - Row count in 'out of range' warnings is off
type_fixed : MDEV-10252 - Row count in 'out of range' warnings is off
type_float : MDEV-10252 - Row count in 'out of range' warnings is off
type_int : MDEV-10252 - Row count in 'out of range' warnings is off
type_varbinary : MDEV-10252 - Row count in 'out of range' warnings is off
type_varchar : MDEV-10252 - Row count in 'out of range' warnings is off
@@ -1,4 +1,4 @@
#
#
# INSERT DELAYED
#

@@ -91,6 +91,9 @@ if ($have_default_index)
call mtr.add_suppression(" '\..test.t1'");
call mtr.add_suppression("Couldn't repair table: test.t1");

# In 10.2 with log_warnings=2 the error message is printed to the error log
call mtr.add_suppression("Table 't1' is marked as crashed.*");

--let $create_definition = a $int_indexed_col, b $char_col, $default_index (a)
--source create_table.inc
REPAIR TABLE t1;
@@ -59,6 +59,7 @@ call mtr.add_suppression("Got an error from thread_id=.*");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
call mtr.add_suppression("Couldn't repair table: test.t1");
call mtr.add_suppression("Table 't1' is marked as crashed.*");
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
@@ -85,7 +86,7 @@ Table Op Msg_type Msg_text
test.t1 check error Size of datafile is: 39 Should be: 65
test.t1 check error Corrupt
SELECT a,b FROM t1;
ERROR HY000: Incorrect key file for table 't1'; try to repair it
ERROR HY000: Index for table 't1' is corrupt; try to repair it
# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144).
# If you got a difference in error message, just add it to rdiff file
INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o');
@@ -1,16 +1,19 @@
DROP TABLE IF EXISTS t1;
# Running CREATE TABLE .. DATA DIRECTORY = <>
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>'
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR_1>'
# For ALTER TABLE the option is ignored
# Running ALTER TABLE .. DATA DIRECTORY = <>
Warnings:
Warning 1618 <INDEX DIRECTORY> option ignored
Warning 1618 <DATA DIRECTORY> option ignored
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>'
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR_1>'
DROP TABLE t1;
@@ -0,0 +1,52 @@
#
# Check whether DATA DIRECTORY is supported in CREATE and ALTER TABLE
#
# Note: the test does not check whether the option
# has any real effect on the table, only that it is accepted
#

--source include/have_symlink.inc
--source have_engine.inc

--let $data_dir1 = $MYSQLTEST_VARDIR/storage_engine_data_dir1/
--let $data_dir2 = $MYSQLTEST_VARDIR/storage_engine_data_dir2/
--mkdir $data_dir1
--mkdir $data_dir2

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

--let $table_options = DATA DIRECTORY = '$data_dir1'
# We cannot mask the folder name here and further, but we can switch off query logging
--let $disable_query_log = 1
--echo # Running CREATE TABLE .. DATA DIRECTORY = <>
--source create_table.inc

--source mask_engine.inc
--replace_result $data_dir1 <DATA_DIR_1>
SHOW CREATE TABLE t1;

--echo # For ALTER TABLE the option is ignored

--let $alter_definition = DATA DIRECTORY = '$data_dir2'
--disable_query_log
--echo # Running ALTER TABLE .. DATA DIRECTORY = <>
--source alter_table.inc
if ($mysql_errname)
{
--let $my_last_stmt = $alter_statement
--let $functionality = ALTER TABLE
--source unexpected_result.inc
}
--enable_query_log
--source mask_engine.inc
--replace_result $data_dir1 <DATA_DIR_1>
SHOW CREATE TABLE t1;

DROP TABLE t1;

--source cleanup_engine.inc

--rmdir $data_dir1
--rmdir $data_dir2

This file was deleted.

@@ -0,0 +1,19 @@
DROP TABLE IF EXISTS t1;
# Running CREATE TABLE .. INDEX DIRECTORY = <>
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INDEX DIRECTORY='<INDEX_DIR_1>'
# For ALTER TABLE the option is ignored
# Running ALTER TABLE .. INDEX DIRECTORY = <>
Warnings:
Warning 1618 <INDEX DIRECTORY> option ignored
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INDEX DIRECTORY='<INDEX_DIR_1>'
DROP TABLE t1;
@@ -0,0 +1,52 @@
#
# Check whether INDEX DIRECTORY is supported in CREATE and ALTER TABLE
#
# Note: the test does not check whether the option
# has any real effect on the table, only that it is accepted
#

--source include/have_symlink.inc
--source have_engine.inc

--let $index_dir1 = $MYSQLTEST_VARDIR/storage_engine_index_dir1/
--let $index_dir2 = $MYSQLTEST_VARDIR/storage_engine_index_dir2/
--mkdir $index_dir1
--mkdir $index_dir2

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

--let $table_options = INDEX DIRECTORY = '$index_dir1'
# We cannot mask the folder name here and further, but we can switch off query logging
--let $disable_query_log = 1
--echo # Running CREATE TABLE .. INDEX DIRECTORY = <>
--source create_table.inc

--source mask_engine.inc
--replace_result $index_dir1 <INDEX_DIR_1>
SHOW CREATE TABLE t1;

--echo # For ALTER TABLE the option is ignored

--let $alter_definition = INDEX DIRECTORY = '$index_dir2'
--disable_query_log
--echo # Running ALTER TABLE .. INDEX DIRECTORY = <>
--source alter_table.inc
if ($mysql_errname)
{
--let $my_last_stmt = $alter_statement
--let $functionality = ALTER TABLE
--source unexpected_result.inc
}
--enable_query_log
--source mask_engine.inc
--replace_result $index_dir1 <INDEX_DIR_1>
SHOW CREATE TABLE t1;

DROP TABLE t1;

--source cleanup_engine.inc

--rmdir $index_dir1
--rmdir $index_dir2
@@ -1,16 +1,30 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED;
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=DYNAMIC;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
ALTER TABLE t1 ROW_FORMAT=FIXED;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
ALTER TABLE t1 ROW_FORMAT=PAGE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=PAGE
ALTER TABLE t1 ROW_FORMAT=COMPACT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL
) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
DROP TABLE t1;
@@ -13,12 +13,12 @@
DROP TABLE IF EXISTS t1;
--enable_warnings

--let $table_options = ROW_FORMAT=FIXED
--let $table_options = ROW_FORMAT=DYNAMIC
--source create_table.inc
--source mask_engine.inc
SHOW CREATE TABLE t1;

--let $alter_definition = ROW_FORMAT=DYNAMIC
--let $alter_definition = ROW_FORMAT=FIXED
--source alter_table.inc
if ($mysql_errname)
{
@@ -29,6 +29,30 @@ if ($mysql_errname)
--source mask_engine.inc
SHOW CREATE TABLE t1;

--let $alter_definition = ROW_FORMAT=PAGE
--source alter_table.inc
if ($mysql_errname)
{
--let $my_last_stmt = $alter_statement
--let $functionality = ALTER TABLE
--source unexpected_result.inc
}
--source mask_engine.inc
SHOW CREATE TABLE t1;


--let $alter_definition = ROW_FORMAT=COMPACT
--source alter_table.inc
if ($mysql_errname)
{
--let $my_last_stmt = $alter_statement
--let $functionality = ALTER TABLE
--source unexpected_result.inc
}
--source mask_engine.inc
SHOW CREATE TABLE t1;


DROP TABLE t1;

--source cleanup_engine.inc
@@ -97,7 +97,7 @@ varchar2b 1
varchar3b 1
SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
Warnings:
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release.
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
id select_type table type possible_keys key key_len ref rows Extra
# # # range c_v c_v # # # Using index condition
@@ -13,7 +13,7 @@ SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d date # # #
dt datetime # # #
ts timestamp # # # on update CURRENT_TIMESTAMP
ts timestamp # # # on update current_timestamp()
t time # # #
y year(4) # # #
y4 year(4) # # #

0 comments on commit 36e020a

Please sign in to comment.