1
+ --source include/have_innodb.inc
1
2
--source include/have_symlink.inc
2
3
--source include/not_windows.inc
3
- --source include/not_embedded .inc
4
+ --source include/not_psprotocol .inc
4
5
5
- use mysql;
6
- RENAME TABLE time_zone TO time_zone_orig,
7
- time_zone_name TO time_zone_name_orig,
8
- time_zone_transition TO time_zone_transition_orig,
9
- time_zone_transition_type TO time_zone_transition_type_orig,
10
- time_zone_leap_second TO time_zone_leap_second_orig;
11
- CREATE TABLE time_zone LIKE time_zone_orig;
12
- CREATE TABLE time_zone_name LIKE time_zone_name_orig;
13
- CREATE TABLE time_zone_transition LIKE time_zone_transition_orig;
14
- CREATE TABLE time_zone_transition_type LIKE time_zone_transition_type_orig;
15
- CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig;
6
+ CREATE TABLE time_zone LIKE mysql.time_zone;
7
+ CREATE TABLE time_zone_name LIKE mysql.time_zone_name;
8
+ CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition;
9
+ CREATE TABLE time_zone_transition_type LIKE mysql.time_zone_transition_type;
10
+ CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second;
16
11
17
12
--echo #
18
13
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
@@ -27,16 +22,18 @@ CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig;
27
22
--echo # Verbose run
28
23
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
29
24
--exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1
30
- SELECT COUNT(*) FROM time_zone;
31
- SELECT COUNT(*) FROM time_zone_name;
32
- SELECT COUNT(*) FROM time_zone_transition;
33
- SELECT COUNT(*) FROM time_zone_transition_type;
34
- SELECT COUNT(*) FROM time_zone_leap_second;
25
+
26
+ --echo #
27
+ --echo # MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases
28
+ --echo #
35
29
36
30
--echo # Run on zoneinfo directory
37
31
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
38
32
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
39
- --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
33
+ --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo > $MYSQL_TMP_DIR/tz.sql
34
+ --disable_query_log
35
+ --source $MYSQL_TMP_DIR/tz.sql
36
+ --enable_query_log
40
37
SELECT COUNT(*) FROM time_zone;
41
38
SELECT COUNT(*) FROM time_zone_name;
42
39
SELECT COUNT(*) FROM time_zone_transition;
@@ -49,13 +46,27 @@ SELECT COUNT(*) FROM time_zone_leap_second;
49
46
50
47
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
51
48
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1
52
- --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
49
+ --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null > $MYSQL_TMP_DIR/tz.sql
50
+ --disable_query_log
51
+ CREATE TEMPORARY TABLE baseline AS
52
+ SELECT VARIABLE_NAME,VARIABLE_VALUE
53
+ FROM information_schema.global_status
54
+ WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE');
55
+ --source $MYSQL_TMP_DIR/tz.sql
56
+ --enable_query_log
57
+
53
58
SELECT COUNT(*) FROM time_zone;
54
59
SELECT COUNT(*) FROM time_zone_name;
55
60
SELECT COUNT(*) FROM time_zone_transition;
56
61
SELECT COUNT(*) FROM time_zone_transition_type;
57
62
SELECT COUNT(*) FROM time_zone_leap_second;
58
63
64
+ SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
65
+ SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
66
+ FROM information_schema.global_status g
67
+ JOIN baseline b USING (VARIABLE_NAME)
68
+ ORDER BY g.VARIABLE_NAME;
69
+
59
70
# Below tests don't include TRUNCATE TABLE so clear them.
60
71
TRUNCATE TABLE time_zone;
61
72
TRUNCATE TABLE time_zone_name;
@@ -69,13 +80,27 @@ TRUNCATE TABLE time_zone_leap_second;
69
80
70
81
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
71
82
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
72
- --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
83
+ --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null > $MYSQL_TMP_DIR/tz.sql
84
+ --disable_query_log
85
+ CREATE OR REPLACE TEMPORARY TABLE baseline AS
86
+ SELECT VARIABLE_NAME,VARIABLE_VALUE
87
+ FROM information_schema.global_status
88
+ WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE');
89
+ --source $MYSQL_TMP_DIR/tz.sql
90
+ --enable_query_log
91
+
73
92
SELECT COUNT(*) FROM time_zone;
74
93
SELECT COUNT(*) FROM time_zone_name;
75
94
SELECT COUNT(*) FROM time_zone_transition;
76
95
SELECT COUNT(*) FROM time_zone_transition_type;
77
96
SELECT COUNT(*) FROM time_zone_leap_second;
78
97
98
+ SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
99
+ SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
100
+ FROM information_schema.global_status g
101
+ JOIN baseline b USING (VARIABLE_NAME)
102
+ ORDER BY g.VARIABLE_NAME;
103
+
79
104
TRUNCATE TABLE time_zone;
80
105
TRUNCATE TABLE time_zone_name;
81
106
TRUNCATE TABLE time_zone_transition;
@@ -87,13 +112,27 @@ TRUNCATE TABLE time_zone_leap_second;
87
112
--echo #
88
113
89
114
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
90
- --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
115
+ --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null > $MYSQL_TMP_DIR/tz.sql
116
+ --disable_query_log
117
+ CREATE OR REPLACE TEMPORARY TABLE baseline AS
118
+ SELECT VARIABLE_NAME,VARIABLE_VALUE
119
+ FROM information_schema.global_status
120
+ WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE');
121
+ --source $MYSQL_TMP_DIR/tz.sql
122
+ --enable_query_log
123
+
91
124
SELECT COUNT(*) FROM time_zone;
92
125
SELECT COUNT(*) FROM time_zone_name;
93
126
SELECT COUNT(*) FROM time_zone_transition;
94
127
SELECT COUNT(*) FROM time_zone_transition_type;
95
128
SELECT COUNT(*) FROM time_zone_leap_second;
96
129
130
+ SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
131
+ SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
132
+ FROM information_schema.global_status g
133
+ JOIN baseline b USING (VARIABLE_NAME)
134
+ ORDER BY g.VARIABLE_NAME;
135
+
97
136
TRUNCATE TABLE time_zone;
98
137
TRUNCATE TABLE time_zone_name;
99
138
TRUNCATE TABLE time_zone_transition;
@@ -105,13 +144,27 @@ TRUNCATE TABLE time_zone_leap_second;
105
144
--echo #
106
145
107
146
--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
108
- --exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
147
+ --exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null > $MYSQL_TMP_DIR/tz.sql
148
+ --disable_query_log
149
+ CREATE OR REPLACE TEMPORARY TABLE baseline AS
150
+ SELECT VARIABLE_NAME,VARIABLE_VALUE
151
+ FROM information_schema.global_status
152
+ WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE');
153
+ --source $MYSQL_TMP_DIR/tz.sql
154
+ --enable_query_log
155
+
109
156
SELECT COUNT(*) FROM time_zone;
110
157
SELECT COUNT(*) FROM time_zone_name;
111
158
SELECT COUNT(*) FROM time_zone_transition;
112
159
SELECT COUNT(*) FROM time_zone_transition_type;
113
160
SELECT COUNT(*) FROM time_zone_leap_second;
114
161
162
+ SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
163
+ SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
164
+ FROM information_schema.global_status g
165
+ JOIN baseline b USING (VARIABLE_NAME)
166
+ ORDER BY g.VARIABLE_NAME;
167
+
115
168
TRUNCATE TABLE time_zone;
116
169
TRUNCATE TABLE time_zone_name;
117
170
TRUNCATE TABLE time_zone_transition;
@@ -123,37 +176,51 @@ TRUNCATE TABLE time_zone_leap_second;
123
176
--echo #
124
177
125
178
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
126
- --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql
179
+ --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT > $MYSQL_TMP_DIR/tz.sql
180
+ --disable_query_log
181
+ CREATE OR REPLACE TEMPORARY TABLE baseline AS
182
+ SELECT VARIABLE_NAME,VARIABLE_VALUE
183
+ FROM information_schema.global_status
184
+ WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE');
185
+ --source $MYSQL_TMP_DIR/tz.sql
186
+ --enable_query_log
187
+
127
188
SELECT COUNT(*) FROM time_zone;
128
189
SELECT COUNT(*) FROM time_zone_name;
129
190
SELECT COUNT(*) FROM time_zone_transition;
130
191
SELECT COUNT(*) FROM time_zone_transition_type;
131
192
SELECT COUNT(*) FROM time_zone_leap_second;
132
193
133
- #
134
- #
135
- # Cleanup
136
- #
137
-
138
- --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
194
+ SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
195
+ SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
196
+ FROM information_schema.global_status g
197
+ JOIN baseline b USING (VARIABLE_NAME)
198
+ ORDER BY g.VARIABLE_NAME;
139
199
140
200
--echo #
141
201
--echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
142
202
--echo #
203
+ --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
143
204
--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
144
205
--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory
145
206
146
207
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
147
208
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
148
209
210
+ #
211
+ #
212
+ # Cleanup
213
+ #
214
+
215
+ --remove_file $MYSQL_TMP_DIR/tz.sql
149
216
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
217
+ DROP TABLE baseline;
150
218
DROP TABLE time_zone;
151
219
DROP TABLE time_zone_name;
152
220
DROP TABLE time_zone_transition;
153
221
DROP TABLE time_zone_transition_type;
154
222
DROP TABLE time_zone_leap_second;
155
- RENAME TABLE time_zone_orig TO time_zone,
156
- time_zone_name_orig TO time_zone_name,
157
- time_zone_transition_orig TO time_zone_transition,
158
- time_zone_transition_type_orig TO time_zone_transition_type,
159
- time_zone_leap_second_orig TO time_zone_leap_second;
223
+
224
+ --echo #
225
+ --echo # End of 10.6 tests
226
+ --echo #
0 commit comments