This file is indexed.

/usr/lib/mysql-testsuite/t/wl6219-upgrade.test is in percona-server-test-5.6 5.6.22-rel71.0-0ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
# WL#6219: Deprecate and remove YEAR(2) type
#

--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;

--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_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;

--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

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

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
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info

SHOW CREATE TABLE t1;

DROP TABLE t1;


--echo #