Skip to content

Commit 7ac059b

Browse files
Alexey KopytovAlexey Kopytov
Alexey Kopytov
authored and
Alexey Kopytov
committed
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts: Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test Text conflict in sql/item_func.cc
2 parents acc2b9e + a4332c2 commit 7ac059b

20 files changed

+260
-168
lines changed

mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test

+44-9
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,53 @@
33
# The common part of the "rpl_get_master_version_and_clock" test.
44
# Restart slave under network disconnection between slave and master
55
# following the steps:
6-
# 1 - Got DBUG_SYNC_POINT lock
7-
# 2 - Set DBUG_SYNC_POINT before call mysql_real_query(...) function in get_master_version_and_clock(...) function and hang here
8-
# 3 - shutdown master server for simulating network disconnection
9-
# 4 - Release DBUG_SYNC_POINT lock
10-
# 5 - Check if the slave I/O thread tries to reconnect to master.
6+
# 0 - Set DEBUG_SYNC_ACTION to wait
7+
# before call mysql_real_query(...) function in get_master_version_and_clock(...)
8+
# function and hang here
9+
# 1 - activate a sync-point through the $dbug_sync_point argument of the test
10+
# 2 - shutdown master server for simulating network disconnection
11+
# 3 - signal to the IO thread through $debug_sync_action to unhold from the sync-point
12+
# 4 - check if the slave I/O thread tries to reconnect to master.
1113
#
12-
# Note: Please make sure initialize the $debug_lock when call the test script.
14+
# Note: make sure to initialize the $debug_sync_action and $dbug_sync_point
15+
# before calling the test script.
1316
#
17+
# Pattern of usage:
18+
#
19+
# The caller test supplies the DBUG_EXECUTE_IF name
20+
#
21+
# let $dbug_sync_point = 'dbug_execute_if_name';
22+
#
23+
# as well as the action list for DEBUG_SYNC
24+
#
25+
# let $debug_sync_action= 'now signal signal_name';
26+
#
27+
# The $dbug_sync_point becomes the value of @@global.debug generating
28+
# a newly started IO-slave thread's session value.
29+
# Notice incremental operations to add and remove dbug_execute_if_name
30+
# from the global variable allows propagation more dbug arguments
31+
# out of mtr.
32+
# The action list is to fire at proper time according to test logics
33+
# (see pp 0-4 above).
34+
#
35+
1436
connection slave;
15-
if (`SELECT '$debug_lock' = ''`)
37+
if (`SELECT $debug_sync_action = ''`)
1638
{
17-
--die Cannot continue. Please set value for $debug_lock.
39+
--die Cannot continue. Please set value for debug_sync_action.
1840
}
1941

2042
# Restart slave
2143
--disable_warnings
2244
stop slave;
2345
source include/wait_for_slave_to_stop.inc;
46+
47+
eval SET @@global.debug= "+d,$dbug_sync_point";
48+
2449
start slave;
2550
source include/wait_for_slave_to_start.inc;
51+
--echo slave is going to hang in get_master_version_and_clock
52+
2653
connection master;
2754
# Write file to make mysql-test-run.pl expect the "crash", but don't start
2855
# it until it's told to
@@ -35,7 +62,9 @@ EOF
3562
shutdown_server 10;
3663

3764
connection slave;
38-
eval SELECT RELEASE_LOCK($debug_lock);
65+
--echo slave is unblocked
66+
67+
eval SET DEBUG_SYNC=$debug_sync_action;
3968

4069
# Show slave last IO errno
4170
connection slave;
@@ -53,6 +82,12 @@ if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
5382
--echo NETWORK ERROR
5483
}
5584

85+
# deactivate the sync point of get_master_version_and_clock()
86+
# now to avoid restarting IO-thread to re-enter it.
87+
# There will be a new IO thread forked out with its @@session.debug
88+
# unset.
89+
eval set @@global.debug = "-d,$dbug_sync_point";
90+
5691
# Write file to make mysql-test-run.pl start up the server again
5792
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
5893
restart

mysql-test/r/ctype_ldml.result

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ SELECT * FROM t1 WHERE LOWER(a)=LOWER('N');
4949
a
5050
DROP TABLE t1;
5151
#
52+
# Bug#51976 LDML collations issue (cyrillic example)
53+
#
54+
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
55+
INSERT INTO t1 (a) VALUES ('Hello');
56+
SELECT a, UPPER(a), LOWER(a) FROM t1;
57+
a UPPER(a) LOWER(a)
58+
Hello HELLO hello
59+
DROP TABLE t1;
60+
#
5261
# Bug#43827 Server closes connections and restarts
5362
#
5463
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);

mysql-test/r/mysqlbinlog_row_innodb.result

+16-16
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ BEGIN
23652365
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
23662366
### INSERT INTO test.t1
23672367
### SET
2368-
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
2368+
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
23692369
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
23702370
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
23712371
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2458,7 +2458,7 @@ BEGIN
24582458
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
24592459
### INSERT INTO test.t1
24602460
### SET
2461-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
2461+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
24622462
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
24632463
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
24642464
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2553,7 +2553,7 @@ BEGIN
25532553
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
25542554
### INSERT INTO test.t1
25552555
### SET
2556-
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
2556+
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
25572557
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
25582558
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
25592559
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -2634,7 +2634,7 @@ BEGIN
26342634
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
26352635
### INSERT INTO test.t1
26362636
### SET
2637-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
2637+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
26382638
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
26392639
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
26402640
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2727,7 +2727,7 @@ BEGIN
27272727
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
27282728
### UPDATE test.t1
27292729
### WHERE
2730-
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
2730+
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
27312731
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
27322732
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
27332733
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2807,7 +2807,7 @@ BEGIN
28072807
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
28082808
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
28092809
### SET
2810-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
2810+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
28112811
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
28122812
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
28132813
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2900,7 +2900,7 @@ BEGIN
29002900
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
29012901
### UPDATE test.t1
29022902
### WHERE
2903-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
2903+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
29042904
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
29052905
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
29062906
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2980,7 +2980,7 @@ BEGIN
29802980
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
29812981
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
29822982
### SET
2983-
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
2983+
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
29842984
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
29852985
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
29862986
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3073,7 +3073,7 @@ BEGIN
30733073
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
30743074
### UPDATE test.t1
30753075
### WHERE
3076-
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
3076+
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
30773077
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
30783078
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
30793079
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -3153,7 +3153,7 @@ BEGIN
31533153
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
31543154
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
31553155
### SET
3156-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
3156+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
31573157
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
31583158
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
31593159
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3246,7 +3246,7 @@ BEGIN
32463246
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
32473247
### UPDATE test.t1
32483248
### WHERE
3249-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
3249+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
32503250
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
32513251
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
32523252
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3326,7 +3326,7 @@ BEGIN
33263326
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
33273327
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
33283328
### SET
3329-
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
3329+
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
33303330
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
33313331
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
33323332
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -3419,7 +3419,7 @@ BEGIN
34193419
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
34203420
### DELETE FROM test.t1
34213421
### WHERE
3422-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
3422+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
34233423
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
34243424
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
34253425
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3512,7 +3512,7 @@ BEGIN
35123512
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
35133513
### DELETE FROM test.t1
35143514
### WHERE
3515-
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
3515+
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
35163516
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
35173517
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
35183518
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3605,7 +3605,7 @@ BEGIN
36053605
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
36063606
### DELETE FROM test.t1
36073607
### WHERE
3608-
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
3608+
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
36093609
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
36103610
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
36113611
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3698,7 +3698,7 @@ BEGIN
36983698
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
36993699
### DELETE FROM test.t1
37003700
### WHERE
3701-
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
3701+
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
37023702
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
37033703
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
37043704
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */

mysql-test/r/type_year.result

+32
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,36 @@ yyyy c4
309309
2069 2069
310310
DROP TABLE t2, t4;
311311
#
312+
# Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type
313+
#
314+
CREATE TABLE t1 (y YEAR NOT NULL, s VARCHAR(4));
315+
INSERT INTO t1 (s) VALUES ('bad');
316+
Warnings:
317+
Warning 1364 Field 'y' doesn't have a default value
318+
INSERT INTO t1 (y, s) VALUES (0, 0), (2000, 2000), (2001, 2001);
319+
SELECT * FROM t1 ta, t1 tb WHERE ta.y = tb.y;
320+
y s y s
321+
0000 bad 0000 bad
322+
0000 0 0000 bad
323+
0000 bad 0000 0
324+
0000 0 0000 0
325+
2000 2000 2000 2000
326+
2001 2001 2001 2001
327+
SELECT * FROM t1 WHERE t1.y = 0;
328+
y s
329+
0000 bad
330+
0000 0
331+
SELECT * FROM t1 WHERE t1.y = 2000;
332+
y s
333+
2000 2000
334+
SELECT ta.y AS ta_y, ta.s, tb.y AS tb_y, tb.s FROM t1 ta, t1 tb HAVING ta_y = tb_y;
335+
ta_y s tb_y s
336+
0000 bad 0000 bad
337+
0000 0 0000 bad
338+
0000 bad 0000 0
339+
0000 0 0000 0
340+
2000 2000 2000 2000
341+
2001 2001 2001 2001
342+
DROP TABLE t1;
343+
#
312344
End of 5.1 tests

mysql-test/r/udf.result

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ ERROR HY000: Can't initialize function 'reverse_lookup'; Wrong number of argumen
3838
select reverse_lookup("127.0.0.1");
3939
select reverse_lookup(127,0,0,1);
4040
select reverse_lookup("localhost");
41-
reverse_lookup("localhost")
42-
NULL
4341
select avgcost();
4442
ERROR HY000: Can't initialize function 'avgcost'; wrong number of arguments: AVGCOST() requires two arguments
4543
select avgcost(100,23.76);

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

+11-20
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,24 @@ start slave;
77
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
88
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
99
call mtr.add_suppression("Slave I/O thread .* register on master");
10-
SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
11-
IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
12-
1
13-
SELECT GET_LOCK("debug_lock.before_get_UNIX_TIMESTAMP", 1000);
14-
GET_LOCK("debug_lock.before_get_UNIX_TIMESTAMP", 1000)
15-
1
16-
set global debug= 'd,debug_lock.before_get_UNIX_TIMESTAMP';
1710
stop slave;
11+
SET @@global.debug= "+d,'debug_lock.before_get_UNIX_TIMESTAMP'";
1812
start slave;
19-
SELECT RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
20-
RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
21-
1
13+
slave is going to hang in get_master_version_and_clock
14+
slave is unblocked
15+
SET DEBUG_SYNC='now SIGNAL signal.get_unix_timestamp';
2216
Check network error happened here
2317
NETWORK ERROR
24-
SELECT IS_FREE_LOCK("debug_lock.before_get_SERVER_ID");
25-
IS_FREE_LOCK("debug_lock.before_get_SERVER_ID")
26-
1
27-
SELECT GET_LOCK("debug_lock.before_get_SERVER_ID", 1000);
28-
GET_LOCK("debug_lock.before_get_SERVER_ID", 1000)
29-
1
30-
set global debug= 'd,debug_lock.before_get_SERVER_ID';
18+
set @@global.debug = "-d,'debug_lock.before_get_UNIX_TIMESTAMP'";
3119
stop slave;
20+
SET @@global.debug= "+d,'debug_lock.before_get_SERVER_ID'";
3221
start slave;
33-
SELECT RELEASE_LOCK("debug_lock.before_get_SERVER_ID");
34-
RELEASE_LOCK("debug_lock.before_get_SERVER_ID")
35-
1
22+
slave is going to hang in get_master_version_and_clock
23+
slave is unblocked
24+
SET DEBUG_SYNC='now SIGNAL signal.get_server_id';
3625
Check network error happened here
3726
NETWORK ERROR
27+
set @@global.debug = "-d,'debug_lock.before_get_SERVER_ID'";
3828
set global debug= '';
3929
reset master;
4030
include/stop_slave.inc
@@ -43,3 +33,4 @@ start slave;
4333
*** must be having the replicate-same-server-id IO thread error ***
4434
Slave_IO_Errno= 1593
4535
Slave_IO_Error= Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
36+
SET DEBUG_SYNC= 'RESET';

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

+4-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ reset master;
44
reset slave;
55
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
66
start slave;
7+
SET DEBUG_SYNC= 'RESET';
78
include/stop_slave.inc
8-
SELECT GET_LOCK("debug_lock.before_get_running_status_yes", 1000);
9-
GET_LOCK("debug_lock.before_get_running_status_yes", 1000)
10-
1
11-
set global debug= 'd,debug_lock.before_get_running_status_yes';
9+
set global debug= 'd,dbug.before_get_running_status_yes';
1210
Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
1311
SHOW STATUS LIKE 'Slave_running';
1412
Variable_name Value
@@ -22,9 +20,7 @@ Variable_name Value
2220
Slave_running OFF
2321
Slave_IO_Running= No
2422
Slave_SQL_Running= No
25-
SELECT RELEASE_LOCK("debug_lock.before_get_running_status_yes");
26-
RELEASE_LOCK("debug_lock.before_get_running_status_yes")
27-
1
23+
SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running';
2824
Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
2925
SHOW STATUS LIKE 'Slave_running';
3026
Variable_name Value
@@ -39,4 +35,5 @@ Slave_running ON
3935
Slave_IO_Running= Yes
4036
Slave_SQL_Running= Yes
4137
set global debug= '';
38+
SET DEBUG_SYNC= 'RESET';
4239
End of tests

0 commit comments

Comments
 (0)