Commit 14315744 authored by Christian Rober's avatar Christian Rober

[t:5090] Added MySQL Tests to cover different compression type changes as part...

[t:5090] Added MySQL Tests to cover different compression type changes as part of complex ALTER TABLE statements.

git-svn-id: file:///svn/mysql/tests/mysql-test@44736 c7de825b-a66e-492c-adef-691d508d4ae1
parent 13ab0477
SET STORAGE_ENGINE='tokudb';
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (c1 int not null primary key) engine=TokuDB;
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
NULL test foo BASE TABLE TokuDB 10 Fixed 1 0 0 9223372036854775807 0 12288 NULL 2012-06-20 22:48:30 2012-06-20 22:48:30 NULL latin1_swedish_ci NULL
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE foo row_format=tokudb_lzma, add column c2 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_LZMA
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_LZMA
ALTER TABLE foo row_format=TOKUDB_QUICKLZ, add column c3 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_QUICKLZ
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`c3` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_QUICKLZ
ALTER TABLE foo row_format=TOKUDB_UNCOMPRESSED, add column c4 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_UNCOMPRESSED
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`c3` int(11) NOT NULL,
`c4` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_UNCOMPRESSED
ALTER TABLE foo row_format=TOKUDB_ZLIB, add column c5 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_ZLIB
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`c3` int(11) NOT NULL,
`c4` int(11) NOT NULL,
`c5` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_ZLIB
ALTER TABLE foo row_format=TOKUDB_FAST, add column c6 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_FAST
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`c3` int(11) NOT NULL,
`c4` int(11) NOT NULL,
`c5` int(11) NOT NULL,
`c6` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_FAST
ALTER TABLE foo row_format=TOKUDB_SMALL, add column c7 int not null;
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
CREATE_OPTIONS
row_format=TOKUDB_SMALL
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`c1` int(11) NOT NULL,
`c2` int(11) NOT NULL,
`c3` int(11) NOT NULL,
`c4` int(11) NOT NULL,
`c5` int(11) NOT NULL,
`c6` int(11) NOT NULL,
`c7` int(11) NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1 ROW_FORMAT=TOKUDB_SMALL
DROP TABLE foo;
#--source include/have_tokudb.inc
#
# Attempt to change row format with and without
# other ALTER TABLE statements.
#
SET STORAGE_ENGINE='tokudb';
--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings
CREATE TABLE foo (c1 int not null primary key) engine=TokuDB;
# Sanity check for default values.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=tokudb_lzma, add column c2 int not null;
# Check to see that the row format was changed.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=TOKUDB_QUICKLZ, add column c3 int not null;
# Check to see that QuickLZ was selected.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=TOKUDB_UNCOMPRESSED, add column c4 int not null;
# Check to see that it is now uncompressed.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=TOKUDB_ZLIB, add column c5 int not null;
# Check to see that we are using zlib.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=TOKUDB_FAST, add column c6 int not null;
# Check for 'fast' compression mode.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
ALTER TABLE foo row_format=TOKUDB_SMALL, add column c7 int not null;
# Check for small compression type.
SELECT CREATE_OPTIONS
FROM INFORMATION_SCHEMA.TABLES WHERE (table_name LIKE 'foo');
SHOW CREATE TABLE foo;
DROP TABLE foo;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment