Commit dbfd8709 authored by Rich Prohaska's avatar Rich Prohaska

refs #5371 add tests for frm discover on partitioned tables

git-svn-id: file:///svn/mysql/tests/mysql-test@47682 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6113f4bb
DROP TABLE IF EXISTS foo, bar;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE foo (id INT PRIMARY KEY);
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
CREATE TABLE bar LIKE foo;
SHOW CREATE TABLE bar;
Table Create Table
bar CREATE TABLE `bar` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE foo ADD COLUMN a INT;
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
FLUSH TABLES;
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
DROP TABLE foo, bar;
DROP TABLE IF EXISTS foo, bar;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE foo (id INT PRIMARY KEY) PARTITION BY HASH(id) PARTITIONS 2;
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (id)
PARTITIONS 2 */
CREATE TABLE bar LIKE foo;
SHOW CREATE TABLE bar;
Table Create Table
bar CREATE TABLE `bar` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (id)
PARTITIONS 2 */
ALTER TABLE foo ADD COLUMN a INT;
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (id)
PARTITIONS 2 */
FLUSH TABLES;
SHOW CREATE TABLE foo;
Table Create Table
foo CREATE TABLE `foo` (
`id` int(11) NOT NULL,
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (id)
PARTITIONS 2 */
DROP TABLE foo, bar;
# test that tokudb discover on simple tables works when there is an frm mismatch
--disable_warnings
DROP TABLE IF EXISTS foo, bar;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
let $MYSQLD_DATADIR= `SELECT @@datadir`;
CREATE TABLE foo (id INT PRIMARY KEY);
SHOW CREATE TABLE foo;
CREATE TABLE bar LIKE foo;
SHOW CREATE TABLE bar;
ALTER TABLE foo ADD COLUMN a INT;
SHOW CREATE TABLE foo;
FLUSH TABLES;
remove_file $MYSQLD_DATADIR/test/foo.frm;
copy_file $MYSQLD_DATADIR/test/bar.frm $MYSQLD_DATADIR/test/foo.frm;
SHOW CREATE TABLE foo;
DROP TABLE foo, bar;
# test that tokudb discover on partitioned tokudb tables works when there is an frm mismatch
--source include/have_partition.inc
--disable_warnings
DROP TABLE IF EXISTS foo, bar;
--enable_warnings
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
let $MYSQLD_DATADIR= `SELECT @@datadir`;
CREATE TABLE foo (id INT PRIMARY KEY) PARTITION BY HASH(id) PARTITIONS 2;
SHOW CREATE TABLE foo;
CREATE TABLE bar LIKE foo;
SHOW CREATE TABLE bar;
ALTER TABLE foo ADD COLUMN a INT;
SHOW CREATE TABLE foo;
FLUSH TABLES;
remove_file $MYSQLD_DATADIR/test/foo.frm;
copy_file $MYSQLD_DATADIR/test/bar.frm $MYSQLD_DATADIR/test/foo.frm;
# frm discovery happens here
SHOW CREATE TABLE foo;
DROP TABLE foo, bar;
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