config root man

Current Path : /usr/opt/mysql57/mysql-test/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/t/wl6219-upgrade.test

#
# WL#6219: Deprecate and remove YEAR(2) type
#
--disable_query_log
CALL mtr.add_suppression("Found incompatible YEAR");
--enable_query_log

--source include/mysql_upgrade_preparation.inc
--source include/have_innodb.inc
let $MYSQLD_DATADIR= `select @@datadir`;

--echo #
--echo # Test with a saved MyISAM table from 4.1
--echo #

--copy_file std_data/wl6219_41.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_41.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_41.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

--echo # Everything _looks_ fine
SHOW CREATE TABLE t1;

--echo # Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;

--error ER_CRASHED_ON_USAGE
SELECT * FROM t1;
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 () VALUES ();
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (i) VALUES (10);
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (y2) VALUES (10);
--error ER_CRASHED_ON_USAGE
UPDATE t1 SET y2=10;
--error ER_CRASHED_ON_USAGE
DELETE FROM t1 LIMIT 1;

CHECK TABLE t1 FOR UPGRADE;

--echo # Run REPAIR TABLE to alter the table and repair the YEAR(2) fields
REPAIR TABLE t1;

--echo # Now check it's back to normal
SHOW CREATE TABLE t1;
SELECT * FROM t1;
INSERT INTO t1 () VALUES ();
UPDATE t1 SET y2=10;
DELETE FROM t1 LIMIT 1;

DROP TABLE t1;

--echo # ALTER TABLE ... FORCE should convert YEAR(2) to YEAR(4)

--copy_file std_data/wl6219_41.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_41.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_41.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

ALTER TABLE t1 FORCE;
SHOW CREATE TABLE t1;

DROP TABLE t1;


--echo #
--echo # Test with a saved MyISAM table from 5.5
--echo #

--copy_file std_data/wl6219_55.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_55.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_55.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

--echo # Everything _looks_ fine
SHOW CREATE TABLE t1;

--echo # Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;

--error ER_CRASHED_ON_USAGE
SELECT * FROM t1;
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 () VALUES ();
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (i) VALUES (10);
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (y2) VALUES (10);
--error ER_CRASHED_ON_USAGE
UPDATE t1 SET y2=10;
--error ER_CRASHED_ON_USAGE
DELETE FROM t1 LIMIT 1;

--echo # Run REPAIR TABLE to alter the table and repair the YEAR(2) fields
REPAIR TABLE t1;

--echo # Now check it's back to normal
SHOW CREATE TABLE t1;
SELECT * FROM t1;

DROP TABLE t1;

--echo # ALTER TABLE ... FORCE should convert YEAR(2) to YEAR(4)

--copy_file std_data/wl6219_55.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_55.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_55.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

--error ER_CRASHED_ON_USAGE
SELECT * FROM t1;
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 () VALUES ();
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (i) VALUES (10);
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (y2) VALUES (10);
--error ER_CRASHED_ON_USAGE
UPDATE t1 SET y2=10;
--error ER_CRASHED_ON_USAGE
DELETE FROM t1 LIMIT 1;

ALTER TABLE t1 FORCE;
SHOW CREATE TABLE t1;

DROP TABLE t1;

--echo #
--echo # Test with InnoDB table (with fake .frm file)
--echo #

--copy_file std_data/wl6219_55.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_55.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_55.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

--echo # Create InnoDB table with YEAR(4) columns

--error ER_CRASHED_ON_USAGE
SELECT * FROM t1;
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 () VALUES ();
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (i) VALUES (10);
--error ER_CRASHED_ON_USAGE
INSERT INTO t1 (y2) VALUES (10);
--error ER_CRASHED_ON_USAGE
UPDATE t1 SET y2=10;
--error ER_CRASHED_ON_USAGE
DELETE FROM t1 LIMIT 1;
SHOW WARNINGS;

ALTER TABLE t1 ENGINE=InnoDB;
SHOW CREATE TABLE t1;

FLUSH TABLE t1;

--echo # Replace YEAR(4) column metadata with YEAR(2) metadata

--remove_file $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_55_innodb.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm

SHOW CREATE TABLE t1;

--echo # Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;

--echo # Run ALTER TABLE ... FORCE to alter the table and repair the YEAR(2) fields
ALTER TABLE t1 FORCE;

SHOW CREATE TABLE t1;

DROP TABLE t1;

--echo #
--echo # Test mysql_upgrade tool
--echo #

--copy_file std_data/wl6219_55.frm $MYSQLD_DATADIR/test/t1.frm
--chmod 0777 $MYSQLD_DATADIR/test/t1.frm
--copy_file std_data/wl6219_55.MYD $MYSQLD_DATADIR/test/t1.MYD
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYD
--copy_file std_data/wl6219_55.MYI $MYSQLD_DATADIR/test/t1.MYI
--chmod 0777 $MYSQLD_DATADIR/test/t1.MYI

--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1

--source include/mysql_upgrade_cleanup.inc

SHOW CREATE TABLE t1;

DROP TABLE t1;


--echo # 

Man Man