Skip to content

Commit 064bedc

Browse files
author
Nisha Gopalakrishnan
committed
BUG18985760 - "FAST" ALTER TABLE CHANGE ON ENUM COLUMN
TRIGGERS FULL TABLE REBUILD. Fixing PB2 test failure which resurfaced due to missing clean up.
1 parent 9414c70 commit 064bedc

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

mysql-test/suite/rpl/r/rpl_avoid_temporal_upgrade.result

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ Warning 1287 '@@avoid_temporal_upgrade' is deprecated and will be removed in a f
1919
START SLAVE;
2020
# ALTER TABLE on the master.
2121
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
22-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
22+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
2323
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
2424
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 818A92 0000124821911312 7468F975
2525
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 00001230A2EA8AB5 3A6AFC05
2626
01:01:10 2020-01-01 01:01:01 1980-11-21 18:06:01 80277E 0000125F33D85AB5 147BF1D9
2727
NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 00001230A2EA8AB5 56507B75
2828
00:00:00 NULL 2011-11-21 17:11:01 800000 NULL 4ECA5BF5
29-
ALTER TABLE t1 ADD COLUMN fld1 INT;
29+
ALTER TABLE t21 ADD COLUMN fld1 INT;
3030
Warnings:
3131
Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
32-
INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
32+
INSERT INTO t21 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
3333
# Since the global variable 'avoid_temporal_upgrade' is disabled on
3434
# the master, the temporal columns of old format are upgraded to the
3535
# new format.
3636
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
37-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
37+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
3838
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
3939
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 80A28A 998714A28A 7468F975
4040
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 9964421041 3A6AFC05
@@ -49,7 +49,7 @@ SET @saved_show_old_temporals= @@session.show_old_temporals;
4949
Warnings:
5050
Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release.
5151
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
52-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
52+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
5353
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
5454
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 818A92 0000124821911312 7468F975
5555
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 00001230A2EA8AB5 3A6AFC05
@@ -60,15 +60,15 @@ NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 00001230A2EA8AB5 56507B75
6060
SET SESSION show_old_temporals= ON;
6161
Warnings:
6262
Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release.
63-
SHOW CREATE TABLE t1;
63+
SHOW CREATE TABLE t21;
6464
Table Create Table
65-
t1 CREATE TABLE `t1` (
65+
t21 CREATE TABLE `t21` (
6666
`f_time` time /* 5.5 binary format */ DEFAULT NULL,
6767
`f_timestamp` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
6868
`f_datetime` datetime /* 5.5 binary format */ DEFAULT NULL,
6969
`fld1` int(11) DEFAULT NULL
7070
) ENGINE=MyISAM DEFAULT CHARSET=latin1
71-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
71+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t21';
7272
COLUMN_TYPE
7373
time /* 5.5 binary format */
7474
timestamp /* 5.5 binary format */
@@ -78,7 +78,7 @@ SET @@session.show_old_temporals= @saved_show_old_temporals;
7878
Warnings:
7979
Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release.
8080
#Cleanup
81-
DROP TABLE t1;
81+
DROP TABLE t21;
8282
include/sync_slave_sql_with_master.inc
8383
# Testcase to ensure that the temporal columns of old format
8484
# are upgraded on the slave since 'avoid_temporal_column'
@@ -93,37 +93,37 @@ Warning 1287 '@@avoid_temporal_upgrade' is deprecated and will be removed in a f
9393
START SLAVE;
9494
# ALTER TABLE on the master.
9595
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
96-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
96+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
9797
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
9898
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 818A92 0000124821911312 7468F975
9999
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 00001230A2EA8AB5 3A6AFC05
100100
01:01:10 2020-01-01 01:01:01 1980-11-21 18:06:01 80277E 0000125F33D85AB5 147BF1D9
101101
NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 00001230A2EA8AB5 56507B75
102102
00:00:00 NULL 2011-11-21 17:11:01 800000 NULL 4ECA5BF5
103-
ALTER TABLE t1 ADD COLUMN fld1 INT;
103+
ALTER TABLE t31 ADD COLUMN fld1 INT;
104104
Warnings:
105105
Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
106-
INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
106+
INSERT INTO t31 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
107107
# Since the default value of 'avoid_temporal_upgrade' is FALSE,
108108
# the old temporal will be upgraded on the master.
109109
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
110-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
110+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
111111
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
112112
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 80A28A 998714A28A 7468F975
113113
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 9964421041 3A6AFC05
114114
01:01:10 2020-01-01 01:01:01 1980-11-21 18:06:01 80104A 99A5421041 147BF1D9
115115
NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 9964421041 56507B75
116116
00:00:00 NULL 2011-11-21 17:11:01 800000 NULL 4ECA5BF5
117117
22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE
118-
SHOW CREATE TABLE t1;
118+
SHOW CREATE TABLE t31;
119119
Table Create Table
120-
t1 CREATE TABLE `t1` (
120+
t31 CREATE TABLE `t31` (
121121
`f_time` time DEFAULT NULL,
122122
`f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
123123
`f_datetime` datetime DEFAULT NULL,
124124
`fld1` int(11) DEFAULT NULL
125125
) ENGINE=MyISAM DEFAULT CHARSET=latin1
126-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
126+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
127127
COLUMN_TYPE
128128
time
129129
timestamp
@@ -139,23 +139,23 @@ SET SESSION show_old_temporals= ON;
139139
Warnings:
140140
Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release.
141141
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
142-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
142+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
143143
f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp))
144144
10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 80A28A 998714A28A 7468F975
145145
00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 9964421041 3A6AFC05
146146
01:01:10 2020-01-01 01:01:01 1980-11-21 18:06:01 80104A 99A5421041 147BF1D9
147147
NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 9964421041 56507B75
148148
00:00:00 NULL 2011-11-21 17:11:01 800000 NULL 4ECA5BF5
149149
22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE
150-
SHOW CREATE TABLE t1;
150+
SHOW CREATE TABLE t31;
151151
Table Create Table
152-
t1 CREATE TABLE `t1` (
152+
t31 CREATE TABLE `t31` (
153153
`f_time` time DEFAULT NULL,
154154
`f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
155155
`f_datetime` datetime DEFAULT NULL,
156156
`fld1` int(11) DEFAULT NULL
157157
) ENGINE=MyISAM DEFAULT CHARSET=latin1
158-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
158+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
159159
COLUMN_TYPE
160160
time
161161
timestamp
@@ -165,6 +165,6 @@ SET @@session.show_old_temporals= @saved_show_old_temporals;
165165
Warnings:
166166
Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release.
167167
# cleanup
168-
DROP TABLE t1;
168+
DROP TABLE t31;
169169
include/sync_slave_sql_with_master.inc
170170
include/rpl_end.inc

mysql-test/suite/rpl/t/rpl_avoid_temporal_upgrade.test

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
--echo # Copy the table containing the old Mysql-5.5 temporal format
1717
--echo # to the master and slave.
1818

19-
--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
20-
--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
21-
--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
19+
--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t21.frm
20+
--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t21.MYD
21+
--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t21.MYI
2222

23-
--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
24-
--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
25-
--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
23+
--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t21.frm
24+
--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t21.MYD
25+
--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t21.MYI
2626

2727
--echo # Enable the 'avoid_temporal_column' global variable on slave.
2828
--connection slave
@@ -33,30 +33,30 @@ START SLAVE;
3333
--echo # ALTER TABLE on the master.
3434
--connection master
3535
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
36-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
37-
ALTER TABLE t1 ADD COLUMN fld1 INT;
38-
INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
36+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
37+
ALTER TABLE t21 ADD COLUMN fld1 INT;
38+
INSERT INTO t21 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
3939
--echo # Since the global variable 'avoid_temporal_upgrade' is disabled on
4040
--echo # the master, the temporal columns of old format are upgraded to the
4141
--echo # new format.
4242
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
43-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
43+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
4444
--source include/sync_slave_sql_with_master.inc
4545

4646
--echo # Since 'avoid_temporal_upgrade' is enabled on the slave,
4747
--echo # the old temporal will not be upgraded on the slave.
4848
--connection slave
4949
SET @saved_show_old_temporals= @@session.show_old_temporals;
5050
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
51-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
51+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t21;
5252
SET SESSION show_old_temporals= ON;
53-
SHOW CREATE TABLE t1;
54-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
53+
SHOW CREATE TABLE t21;
54+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t21';
5555
SET @@session.show_old_temporals= @saved_show_old_temporals;
5656

5757
--echo #Cleanup
5858
--connection master
59-
DROP TABLE t1;
59+
DROP TABLE t21;
6060
--source include/sync_slave_sql_with_master.inc
6161

6262
--echo # Testcase to ensure that the temporal columns of old format
@@ -66,13 +66,13 @@ DROP TABLE t1;
6666
--echo # Copy the table containing the old Mysql-5.5 temporal format
6767
--echo # to the master and slave.
6868

69-
--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t1.frm
70-
--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t1.MYD
71-
--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t1.MYI
69+
--copy_file std_data/55_temporal.frm $MASTER_DATADIR/test/t31.frm
70+
--copy_file std_data/55_temporal.MYD $MASTER_DATADIR/test/t31.MYD
71+
--copy_file std_data/55_temporal.MYI $MASTER_DATADIR/test/t31.MYI
7272

73-
--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t1.frm
74-
--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t1.MYD
75-
--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t1.MYI
73+
--copy_file std_data/55_temporal.frm $SLAVE_DATADIR/test/t31.frm
74+
--copy_file std_data/55_temporal.MYD $SLAVE_DATADIR/test/t31.MYD
75+
--copy_file std_data/55_temporal.MYI $SLAVE_DATADIR/test/t31.MYI
7676

7777
--echo # Disable the 'avoid_temporal_column' global variable on slave.
7878
--connection slave
@@ -83,16 +83,16 @@ START SLAVE;
8383
--echo # ALTER TABLE on the master.
8484
--connection master
8585
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
86-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
87-
ALTER TABLE t1 ADD COLUMN fld1 INT;
88-
INSERT INTO t1 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
86+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
87+
ALTER TABLE t31 ADD COLUMN fld1 INT;
88+
INSERT INTO t31 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22', 0);
8989

9090
--echo # Since the default value of 'avoid_temporal_upgrade' is FALSE,
9191
--echo # the old temporal will be upgraded on the master.
9292
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
93-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
94-
SHOW CREATE TABLE t1;
95-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
93+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
94+
SHOW CREATE TABLE t31;
95+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
9696

9797
--source include/sync_slave_sql_with_master.inc
9898

@@ -102,14 +102,14 @@ SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
102102
SET @saved_show_old_temporals= @@session.show_old_temporals;
103103
SET SESSION show_old_temporals= ON;
104104
SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)),
105-
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1;
106-
SHOW CREATE TABLE t1;
107-
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1';
105+
HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t31;
106+
SHOW CREATE TABLE t31;
107+
SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t31';
108108
SET @@session.show_old_temporals= @saved_show_old_temporals;
109109

110110
--echo # cleanup
111111
--connection master
112-
DROP TABLE t1;
112+
DROP TABLE t31;
113113
--source include/sync_slave_sql_with_master.inc
114114

115115

0 commit comments

Comments
 (0)