Commit d3d2acf4 authored by Rich Prohaska's avatar Rich Prohaska

refs #5333 add tests that require descriptors to be updated

git-svn-id: file:///svn/mysql/tests/mysql-test@47703 c7de825b-a66e-492c-adef-691d508d4ae1
parent a6d3d524
DROP TABLE IF EXISTS t, ti;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a BINARY(4), b BINARY(4), c BINARY(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a BINARY(255);
ALTER TABLE ti CHANGE COLUMN a a BINARY(255);
SELECT HEX(b) FROM t;
HEX(b)
62000000
65000000
68000000
SELECT HEX(b) FROM ti;
HEX(b)
62000000
65000000
68000000
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
SELECT HEX(b) FROM t;
HEX(b)
62000000
65000000
68000000
6B000000
SELECT HEX(b) FROM ti;
HEX(b)
62000000
65000000
68000000
6B000000
include/diff_tables.inc [test.t, test.ti]
DROP TABLE t, ti;
DROP TABLE IF EXISTS t, ti;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a CHAR(4), b CHAR(4), c CHAR(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a CHAR(255);
ALTER TABLE ti CHANGE COLUMN a a CHAR(255);
SELECT b FROM t;
b
b
e
h
SELECT b FROM ti;
b
b
e
h
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
SELECT b FROM t;
b
b
e
h
k
SELECT b FROM ti;
b
b
e
h
k
include/diff_tables.inc [test.t, test.ti]
DROP TABLE t, ti;
DROP TABLE IF EXISTS t, ti;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a INT, b INT, c INT, KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES (1,2,3,1),(4,5,6,2),(7,8,9,3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
SELECT b FROM t;
b
2
5
8
SELECT b FROM ti;
b
2
5
8
INSERT INTO t VALUES (10,11,12,4);
INSERT INTO ti VALUES (10,11,12,4);
SELECT b FROM t;
b
2
5
8
11
SELECT b FROM ti;
b
2
5
8
11
include/diff_tables.inc [test.t, test.ti]
DROP TABLE t, ti;
DROP TABLE IF EXISTS t, ti;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARBINARY(4), b VARBINARY(4), c VARBINARY(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a VARBINARY(256);
ALTER TABLE ti CHANGE COLUMN a a VARBINARY(256);
SELECT b FROM t;
b
b
e
h
SELECT b FROM ti;
b
b
e
h
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
SELECT b FROM t;
b
b
e
h
k
SELECT b FROM ti;
b
b
e
h
k
include/diff_tables.inc [test.t, test.ti]
DROP TABLE t, ti;
DROP TABLE IF EXISTS t, ti;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARCHAR(4), b VARCHAR(4), c VARCHAR(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a VARCHAR(256);
ALTER TABLE ti CHANGE COLUMN a a VARCHAR(256);
SELECT b FROM t;
b
b
e
h
SELECT b FROM ti;
b
b
e
h
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
SELECT b FROM t;
b
b
e
h
k
SELECT b FROM ti;
b
b
e
h
k
include/diff_tables.inc [test.t, test.ti]
DROP TABLE t, ti;
DROP TABLE IF EXISTS t;
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=ON;
CREATE TABLE t (a VARCHAR(100), b VARCHAR(100)) ENGINE=Tokudb;
INSERT INTO t VALUES ('hi','there'),('you','people');
SELECT * FROM t;
a b
hi there
you people
ALTER TABLE t CHANGE COLUMN a a VARCHAR(101);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` varchar(101) DEFAULT NULL,
`b` varchar(100) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a VARCHAR(200);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` varchar(200) DEFAULT NULL,
`b` varchar(100) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
SELECT * FROM t;
a b
hi there
you people
DROP TABLE t;
CREATE TABLE t (i INT, a VARCHAR(100), b VARCHAR(100)) ENGINE=Tokudb;
INSERT INTO t VALUES (1, 'hi','there'),(2, 'you','people');
SELECT * FROM t;
i a b
1 hi there
2 you people
ALTER TABLE t CHANGE COLUMN a a VARCHAR(101);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`i` int(11) DEFAULT NULL,
`a` varchar(101) DEFAULT NULL,
`b` varchar(100) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
ALTER TABLE t CHANGE COLUMN a a VARCHAR(200);
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`i` int(11) DEFAULT NULL,
`a` varchar(200) DEFAULT NULL,
`b` varchar(100) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
SELECT * FROM t;
i a b
1 hi there
2 you people
DROP TABLE t;
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a BINARY(4), b BINARY(4), c BINARY(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a BINARY(255);
ALTER TABLE ti CHANGE COLUMN a a BINARY(255);
SELECT HEX(b) FROM t;
SELECT HEX(b) FROM ti;
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
# should get the same result set
SELECT HEX(b) FROM t;
SELECT HEX(b) FROM ti;
# tables should be the same
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE t, ti;
\ No newline at end of file
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a CHAR(4), b CHAR(4), c CHAR(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a CHAR(255);
ALTER TABLE ti CHANGE COLUMN a a CHAR(255);
SELECT b FROM t;
SELECT b FROM ti;
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
# should get the same result set
SELECT b FROM t;
SELECT b FROM ti;
# tables should be the same
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE t, ti;
\ No newline at end of file
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a INT, b INT, c INT, KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES (1,2,3,1),(4,5,6,2),(7,8,9,3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a BIGINT;
ALTER TABLE ti CHANGE COLUMN a a BIGINT;
SELECT b FROM t;
SELECT b FROM ti;
INSERT INTO t VALUES (10,11,12,4);
INSERT INTO ti VALUES (10,11,12,4);
# should get the same result set
SELECT b FROM t;
SELECT b FROM ti;
# tables should be the same
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE t, ti;
\ No newline at end of file
...@@ -6,7 +6,7 @@ old_types = [ 'VARCHAR(1)', 'VARBINARY(1)', 'INT', 'CHAR(1)', 'BINARY(1)' ] ...@@ -6,7 +6,7 @@ old_types = [ 'VARCHAR(1)', 'VARBINARY(1)', 'INT', 'CHAR(1)', 'BINARY(1)' ]
new_types = [ 'VARCHAR(2)', 'VARBINARY(2)', 'BIGINT', 'CHAR(2)', 'BINARY(2)' ] new_types = [ 'VARCHAR(2)', 'VARBINARY(2)', 'BIGINT', 'CHAR(2)', 'BINARY(2)' ]
def main(): def main():
print "# this test generated by change_multiple.py" print "# this test generated by change_multiple_columns.py"
print "# this test generated multiple column changes which should all fail since we support only one at a time" print "# this test generated multiple column changes which should all fail since we support only one at a time"
print "--disable_warnings" print "--disable_warnings"
print "DROP TABLE IF EXISTS t;" print "DROP TABLE IF EXISTS t;"
......
# this test generated by change_multiple.py # this test generated by change_multiple_columns.py
# this test generated multiple column changes which should all fail since we support only one at a time # this test generated multiple column changes which should all fail since we support only one at a time
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
......
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARBINARY(4), b VARBINARY(4), c VARBINARY(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a VARBINARY(256);
ALTER TABLE ti CHANGE COLUMN a a VARBINARY(256);
SELECT b FROM t;
SELECT b FROM ti;
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
# should get the same result set
SELECT b FROM t;
SELECT b FROM ti;
# tables should be the same
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE t, ti;
\ No newline at end of file
--disable_warnings
DROP TABLE IF EXISTS t, ti;
--enable_warnings
SET SESSION TOKUDB_DISABLE_SLOW_ALTER=1;
SET SESSION DEFAULT_STORAGE_ENGINE='TokuDB';
CREATE TABLE t (a VARCHAR(4), b VARCHAR(4), c VARCHAR(4), KEY(b), id INT PRIMARY KEY);
INSERT INTO t VALUES ('a','b','c',1),('d','e','f',2),('g','h','i',3);
CREATE TABLE ti LIKE t;
ALTER TABLE ti ENGINE=myisam;
INSERT INTO ti SELECT * FROM t;
ALTER TABLE t CHANGE COLUMN a a VARCHAR(256);
ALTER TABLE ti CHANGE COLUMN a a VARCHAR(256);
SELECT b FROM t;
SELECT b FROM ti;
INSERT INTO t VALUES ('j','k','l',4);
INSERT INTO ti VALUES ('j','k','l',4);
# should get the same result set
SELECT b FROM t;
SELECT b FROM ti;
# tables should be the same
let $diff_tables = test.t, test.ti;
source include/diff_tables.inc;
DROP TABLE t, ti;
\ 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