Skip to content

Commit 7fd382f

Browse files
author
Nirbhay Choubey
committed
Merged r3466 from maria-5.5-galera.
1 parent 7b57c5e commit 7fd382f

14 files changed

+222
-8
lines changed

mysql-test/include/have_wsrep.inc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
-- require r/have_wsrep.require
2-
disable_query_log;
3-
show variables like 'wsrep_on';
4-
enable_query_log;
1+
# To be used in a test which requires server to be compiled with wsrep support
2+
# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
3+
4+
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
5+
{
6+
--skip Test required wsrep plugin.
7+
}
8+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
2+
# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
3+
4+
--source include/have_wsrep.inc
5+
6+
--require r/have_wsrep.require
7+
disable_query_log;
8+
SHOW VARIABLES LIKE 'wsrep_on';
9+
enable_query_log;

mysql-test/include/not_wsrep.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# To be used in a test which should be skipped if server is compiled with wsrep
2+
# support (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
3+
4+
-- require r/not_wsrep.require
5+
disable_query_log;
6+
SELECT VERSION() LIKE '%wsrep%' AS 'HAVE_WSREP';
7+
enable_query_log;

mysql-test/r/mysql_tzinfo_to_sql_symlink.result

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
33
#
44
SET SESSION wsrep_replicate_myisam=ON;
5+
# Verbose run
56
TRUNCATE TABLE time_zone;
67
TRUNCATE TABLE time_zone_name;
78
TRUNCATE TABLE time_zone_transition;
@@ -21,3 +22,38 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
2122
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
2223
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
2324
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
25+
# Silent run
26+
TRUNCATE TABLE time_zone;
27+
TRUNCATE TABLE time_zone_name;
28+
TRUNCATE TABLE time_zone_transition;
29+
TRUNCATE TABLE time_zone_transition_type;
30+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
31+
SET @time_zone_id= LAST_INSERT_ID();
32+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
33+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
34+
(@time_zone_id, 0, 0, 0, 'GMT')
35+
;
36+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
37+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
38+
SET @time_zone_id= LAST_INSERT_ID();
39+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
40+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
41+
(@time_zone_id, 0, 0, 0, 'GMT')
42+
;
43+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
44+
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
45+
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
46+
#
47+
# Testing with explicit timezonefile
48+
#
49+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
50+
SET @time_zone_id= LAST_INSERT_ID();
51+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
52+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
53+
(@time_zone_id, 0, 0, 0, 'GMT')
54+
;
55+
#
56+
# Testing --leap
57+
#
58+
TRUNCATE TABLE time_zone_leap_second;
59+
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;

mysql-test/r/not_wsrep.require

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
HAVE_WSREP
2+
0

mysql-test/suite/wsrep/r/binlog_format.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
2+
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
13
SHOW VARIABLES LIKE 'binlog_format';
24
Variable_name Value
35
binlog_format ROW
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
3+
#
4+
# Verbose run
5+
SET GLOBAL wsrep_replicate_myisam= ON;
6+
TRUNCATE TABLE time_zone;
7+
TRUNCATE TABLE time_zone_name;
8+
TRUNCATE TABLE time_zone_transition;
9+
TRUNCATE TABLE time_zone_transition_type;
10+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
11+
SET @time_zone_id= LAST_INSERT_ID();
12+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
13+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
14+
(@time_zone_id, 0, 0, 0, 'GMT')
15+
;
16+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
17+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/ignored.tab' as time zone. Skipping it.
18+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
19+
SET @time_zone_id= LAST_INSERT_ID();
20+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
21+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
22+
(@time_zone_id, 0, 0, 0, 'GMT')
23+
;
24+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
25+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/ignored.tab' as time zone. Skipping it.
26+
Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid infinite symlink recursion.
27+
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
28+
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
29+
SET GLOBAL wsrep_replicate_myisam= OFF;
30+
# Silent run
31+
SET GLOBAL wsrep_replicate_myisam= ON;
32+
TRUNCATE TABLE time_zone;
33+
TRUNCATE TABLE time_zone_name;
34+
TRUNCATE TABLE time_zone_transition;
35+
TRUNCATE TABLE time_zone_transition_type;
36+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
37+
SET @time_zone_id= LAST_INSERT_ID();
38+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id);
39+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
40+
(@time_zone_id, 0, 0, 0, 'GMT')
41+
;
42+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/garbage' as time zone. Skipping it.
43+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
44+
SET @time_zone_id= LAST_INSERT_ID();
45+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('posix/GMT', @time_zone_id);
46+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
47+
(@time_zone_id, 0, 0, 0, 'GMT')
48+
;
49+
Warning: Unable to load 'MYSQLTEST_VARDIR/zoneinfo/posix/garbage' as time zone. Skipping it.
50+
ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time;
51+
ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
52+
SET GLOBAL wsrep_replicate_myisam= OFF;
53+
#
54+
# Testing with explicit timezonefile
55+
#
56+
SET GLOBAL wsrep_replicate_myisam= ON;
57+
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
58+
SET @time_zone_id= LAST_INSERT_ID();
59+
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
60+
INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES
61+
(@time_zone_id, 0, 0, 0, 'GMT')
62+
;
63+
SET GLOBAL wsrep_replicate_myisam= OFF;
64+
#
65+
# Testing --leap
66+
#
67+
SET GLOBAL wsrep_replicate_myisam= ON;
68+
TRUNCATE TABLE time_zone_leap_second;
69+
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
70+
SET GLOBAL wsrep_replicate_myisam= OFF;

mysql-test/suite/wsrep/r/variables.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2+
# MDEV#5534: mysql_tzinfo_to_sql generates wrong query
3+
#
4+
# Testing wsrep_replicate_myisam variable.
5+
SELECT @@session.wsrep_replicate_myisam;
6+
ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable
7+
SELECT @@global.wsrep_replicate_myisam;
8+
@@global.wsrep_replicate_myisam
9+
0
10+
SET SESSION wsrep_replicate_myisam= ON;
11+
ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
12+
SET GLOBAL wsrep_replicate_myisam= ON;
13+
SET GLOBAL wsrep_replicate_myisam= OFF;
114
#
215
# MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
316
# variables when using "_"

mysql-test/suite/wsrep/t/binlog_format.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
--source include/have_wsrep.inc
1+
--source include/have_wsrep_enabled.inc
22
--source include/have_binlog_format_row.inc
33
#
44
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
55
#
6+
call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID");
7+
call mtr.add_suppression("WSREP: Could not open saved state file for reading:.*");
8+
69
SHOW VARIABLES LIKE 'binlog_format';
710
-- error ER_WRONG_VALUE_FOR_VAR
811
SET binlog_format=STATEMENT;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--source include/have_wsrep.inc
2+
--source include/have_symlink.inc
3+
--source include/not_windows.inc
4+
5+
--echo #
6+
--echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
7+
--echo #
8+
9+
--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
10+
--exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix
11+
--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT
12+
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage
13+
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab
14+
15+
--echo # Verbose run
16+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
17+
--exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1
18+
19+
--echo # Silent run
20+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
21+
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
22+
23+
--echo #
24+
--echo # Testing with explicit timezonefile
25+
--echo #
26+
27+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
28+
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1
29+
30+
--echo #
31+
--echo # Testing --leap
32+
--echo #
33+
34+
--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1
35+
36+
#
37+
# Cleanup
38+
#
39+
40+
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo

0 commit comments

Comments
 (0)