1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-17 14:41:26 +03:00

Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0

into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
This commit is contained in:
unknown 2008-03-05 09:42:26 +01:00
commit d20bfbbef6
37 changed files with 477 additions and 21 deletions

View File

@ -0,0 +1,25 @@
#
# Bug#32510 LIKE search fails with indexed 'eucjpms' and 'ujis' char column
#
# Testing my_ctype_like_range_xxx
# (used in LIKE optimization for an indexed column)
#
# Create table using @@character_set_connection and @@collation_connection
# for the string columns.
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
# Check pattern (important for ucs2, utf16, utf32)
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
--echo 3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
DROP TABLE t1;

View File

@ -124,6 +124,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='big5_bin'; SET collation_connection='big5_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -174,6 +191,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES big5; SET NAMES big5;
CREATE TABLE t1 (a text) character set big5; CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('ùØ'); INSERT INTO t1 VALUES ('ùØ');

View File

@ -11399,6 +11399,23 @@ cp932_japanese_ci 6109
cp932_japanese_ci 61 cp932_japanese_ci 61
cp932_japanese_ci 6120 cp932_japanese_ci 6120
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='cp932_bin'; SET collation_connection='cp932_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -11409,6 +11426,23 @@ cp932_bin 6109
cp932_bin 61 cp932_bin 61
cp932_bin 6120 cp932_bin 6120
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
create table t2 (a char(1)); create table t2 (a char(1));
insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'); insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');

View File

@ -9809,6 +9809,23 @@ eucjpms_japanese_ci 6109
eucjpms_japanese_ci 61 eucjpms_japanese_ci 61
eucjpms_japanese_ci 6120 eucjpms_japanese_ci 6120
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='eucjpms_bin'; SET collation_connection='eucjpms_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -9819,6 +9836,23 @@ eucjpms_bin 6109
eucjpms_bin 61 eucjpms_bin 61
eucjpms_bin 6120 eucjpms_bin 6120
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
select hex(convert(_eucjpms 0xA5FE41 using ucs2)); select hex(convert(_eucjpms 0xA5FE41 using ucs2));
hex(convert(_eucjpms 0xA5FE41 using ucs2)) hex(convert(_eucjpms 0xA5FE41 using ucs2))
003F0041 003F0041

View File

@ -124,6 +124,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='euckr_bin'; SET collation_connection='euckr_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -174,6 +191,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES euckr; SET NAMES euckr;
CREATE TABLE t1 (a text) character set euckr; CREATE TABLE t1 (a text) character set euckr;
INSERT INTO t1 VALUES (0xA2E6),(0xFEF7); INSERT INTO t1 VALUES (0xA2E6),(0xFEF7);

View File

@ -124,6 +124,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='gb2312_bin'; SET collation_connection='gb2312_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -174,6 +191,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES gb2312; SET NAMES gb2312;
CREATE TABLE t1 (a text) character set gb2312; CREATE TABLE t1 (a text) character set gb2312;
INSERT INTO t1 VALUES (0xA2A1),(0xD7FE); INSERT INTO t1 VALUES (0xA2A1),(0xD7FE);

View File

@ -124,6 +124,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='gbk_bin'; SET collation_connection='gbk_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -174,6 +191,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES gbk; SET NAMES gbk;
CREATE TABLE t1 (a text) character set gbk; CREATE TABLE t1 (a text) character set gbk;
INSERT INTO t1 VALUES (0xA3A0),(0xA1A1); INSERT INTO t1 VALUES (0xA3A0),(0xA1A1);

View File

@ -121,6 +121,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='sjis_bin'; SET collation_connection='sjis_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -171,6 +188,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES sjis; SET NAMES sjis;
SELECT HEX('佐淘 圭') FROM DUAL; SELECT HEX('佐淘 圭') FROM DUAL;
HEX('佐淘 圭') HEX('佐淘 圭')

View File

@ -2815,5 +2815,22 @@ NULL
NULL NULL
NULL NULL
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
set names utf8; set names utf8;
End for 5.0 tests End for 5.0 tests

View File

@ -613,6 +613,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET NAMES latin1; SET NAMES latin1;
SET collation_connection='ucs2_bin'; SET collation_connection='ucs2_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
@ -642,6 +659,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
select hex(substr(_ucs2 0x00e400e50068,1)); select hex(substr(_ucs2 0x00e400e50068,1));
hex(substr(_ucs2 0x00e400e50068,1)) hex(substr(_ucs2 0x00e400e50068,1))
00E400E50068 00E400E50068

View File

@ -2257,6 +2257,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
SET collation_connection='ujis_bin'; SET collation_connection='ujis_bin';
create table t1 select repeat('a',4000) a; create table t1 select repeat('a',4000) a;
delete from t1; delete from t1;
@ -2307,6 +2324,23 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h c2h
ab_def ab_def
drop table t1; drop table t1;
CREATE TABLE t1 AS
SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d;
ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b);
INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5));
INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10));
INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11));
INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12));
SELECT hex(concat(repeat(0xF1F2, 10), '%'));
hex(concat(repeat(0xF1F2, 10), '%'))
F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225
3 rows expected
SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%');
a hex(b) c
2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
select hex(convert(_ujis 0xA5FE41 using ucs2)); select hex(convert(_ujis 0xA5FE41 using ucs2));
hex(convert(_ujis 0xA5FE41 using ucs2)) hex(convert(_ujis 0xA5FE41 using ucs2))
003F0041 003F0041

View File

@ -447,7 +447,7 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 1 ERROR 23000: Duplicate entry '2' for key 1
show master status /* the offset must denote there is the query */; show master status /* the offset must denote there is the query */;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 369 master-bin.000001 230
select count(*) from t1 /* must be 4 */; select count(*) from t1 /* must be 4 */;
count(*) count(*)
4 4

View File

@ -545,7 +545,7 @@ a b
4 4 4 4
show master status /* there must be the UPDATE query event */; show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 328 master-bin.000001 189
delete from t1; delete from t1;
delete from t2; delete from t2;
insert into t1 values (1,2),(3,4),(4,4); insert into t1 values (1,2),(3,4),(4,4);
@ -555,7 +555,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 1 ERROR 23000: Duplicate entry '4' for key 1
show master status /* there must be the UPDATE query event */; show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 343 master-bin.000001 204
drop table t1, t2; drop table t1, t2;
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
CREATE TABLE t1 (a int, PRIMARY KEY (a)); CREATE TABLE t1 (a int, PRIMARY KEY (a));

View File

@ -3306,7 +3306,7 @@ grant RELOAD on *.* to mysqltest_1@localhost;
mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227) mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227) mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227)
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost; grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=537; CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=#;
SET @saved_cs_client = @@character_set_client; SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8; SET character_set_client = utf8;
CREATE TABLE `t1` ( CREATE TABLE `t1` (

View File

@ -0,0 +1,38 @@
reset master;
stop slave;
reset slave;
start slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File
Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #

View File

@ -16,10 +16,12 @@ SET collation_connection='big5_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='big5_bin'; SET collation_connection='big5_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bugs#9357: TEXT columns break string with special word in BIG5 charset. # Bugs#9357: TEXT columns break string with special word in BIG5 charset.

View File

@ -404,8 +404,10 @@ DROP TABLE t4;
SET collation_connection='cp932_japanese_ci'; SET collation_connection='cp932_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='cp932_bin'; SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bug#29333 myisam corruption with # Bug#29333 myisam corruption with

View File

@ -361,9 +361,10 @@ DROP TABLE t1;
SET collation_connection='eucjpms_japanese_ci'; SET collation_connection='eucjpms_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='eucjpms_bin'; SET collation_connection='eucjpms_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bugs#15375: Unassigned multibyte codes are broken # Bugs#15375: Unassigned multibyte codes are broken

View File

@ -16,10 +16,12 @@ SET collation_connection='euckr_korean_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='euckr_bin'; SET collation_connection='euckr_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bug#15377 Valid multibyte sequences are truncated on INSERT # Bug#15377 Valid multibyte sequences are truncated on INSERT

View File

@ -16,10 +16,12 @@ SET collation_connection='gb2312_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='gb2312_bin'; SET collation_connection='gb2312_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bug#15377 Valid multibyte sequences are truncated on INSERT # Bug#15377 Valid multibyte sequences are truncated on INSERT

View File

@ -16,10 +16,12 @@ SET collation_connection='gbk_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='gbk_bin'; SET collation_connection='gbk_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bug#11987 mysql will truncate the text when # Bug#11987 mysql will truncate the text when

View File

@ -68,10 +68,12 @@ SET collation_connection='sjis_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='sjis_bin'; SET collation_connection='sjis_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# Check parsing of string literals in SJIS with multibyte characters that # Check parsing of string literals in SJIS with multibyte characters that
# have an embedded \ in them. (Bug #8303) # have an embedded \ in them. (Bug #8303)

View File

@ -540,6 +540,7 @@ drop table t1;
set collation_connection=ucs2_unicode_ci; set collation_connection=ucs2_unicode_ci;
-- source include/ctype_regex.inc -- source include/ctype_regex.inc
-- source include/ctype_like_range_f1f2.inc
set names utf8; set names utf8;
-- echo End for 5.0 tests -- echo End for 5.0 tests

View File

@ -373,10 +373,12 @@ drop table t1;
SET collation_connection='ucs2_general_ci'; SET collation_connection='ucs2_general_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET NAMES latin1; SET NAMES latin1;
SET collation_connection='ucs2_bin'; SET collation_connection='ucs2_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bug#10344 Some string functions fail for UCS2 # Bug#10344 Some string functions fail for UCS2

View File

@ -1147,10 +1147,12 @@ SET collation_connection='ujis_japanese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
SET collation_connection='ujis_bin'; SET collation_connection='ujis_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
-- source include/ctype_innodb_like.inc -- source include/ctype_innodb_like.inc
-- source include/ctype_like_escape.inc -- source include/ctype_like_escape.inc
-- source include/ctype_like_range_f1f2.inc
# #
# Bugs#15375: Unassigned multibyte codes are broken # Bugs#15375: Unassigned multibyte codes are broken

View File

@ -1348,6 +1348,7 @@ grant RELOAD on *.* to mysqltest_1@localhost;
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost; grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
# Execute mysqldump, should now succeed # Execute mysqldump, should now succeed
--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=#/
--exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1 --exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
# Clean up # Clean up

View File

@ -0,0 +1 @@
--loose-debug=d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init

View File

@ -0,0 +1,37 @@
# Test for
# Bug #33931 assertion at write_ignored_events_info_to_relay_log if init_slave_thread() fails
# Bug #33932 assertion at handle_slave_sql if init_slave_thread() fails
source include/have_debug.inc;
source include/have_log_bin.inc;
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connection master;
reset master;
connection slave;
--disable_warnings
stop slave;
--enable_warnings
reset slave;
start slave;
connection master;
save_master_pos;
connection slave;
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
source include/wait_for_slave_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical show slave status;
# no clean-up is needed

View File

@ -1,5 +1,7 @@
source include/master-slave.inc; source include/master-slave.inc;
connection master;
# Init for rstore of variable values # Init for rstore of variable values
set @my_slave_net_timeout =@@global.slave_net_timeout; set @my_slave_net_timeout =@@global.slave_net_timeout;
@ -18,3 +20,8 @@ show variables like 'slave_skip_errors';
# Restore touched values # Restore touched values
set global slave_net_timeout =@my_slave_net_timeout; set global slave_net_timeout =@my_slave_net_timeout;
# bug#34427 slave misses rendezvous
# don't let the master be shut down until the slave has connected
sync_slave_with_master;

View File

@ -2896,6 +2896,9 @@ void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli)
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{ {
DBUG_ENTER("init_slave_thread"); DBUG_ENTER("init_slave_thread");
#if !defined(DBUG_OFF)
int simulate_error= 0;
#endif
thd->system_thread = (thd_type == SLAVE_THD_SQL) ? thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants(); thd->security_ctx->skip_grants();
@ -2915,10 +2918,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->thread_id = thread_id++; thd->thread_id = thread_id++;
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
DBUG_EXECUTE_IF("simulate_io_slave_error_on_init",
simulate_error|= (1 << SLAVE_THD_IO););
DBUG_EXECUTE_IF("simulate_sql_slave_error_on_init",
simulate_error|= (1 << SLAVE_THD_SQL););
#if !defined(DBUG_OFF)
if (init_thr_lock() || thd->store_globals() || simulate_error & (1<< thd_type))
#else
if (init_thr_lock() || thd->store_globals()) if (init_thr_lock() || thd->store_globals())
#endif
{ {
thd->cleanup(); thd->cleanup();
delete thd;
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
@ -3516,6 +3526,7 @@ slave_begin:
thd= new THD; // note that contructor of THD uses DBUG_ ! thd= new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd); THD_CHECK_SENTRY(thd);
mi->io_thd = thd;
pthread_detach_this_thread(); pthread_detach_this_thread();
thd->thread_stack= (char*) &thd; // remember where our stack is thd->thread_stack= (char*) &thd; // remember where our stack is
@ -3526,7 +3537,6 @@ slave_begin:
sql_print_error("Failed during slave I/O thread initialization"); sql_print_error("Failed during slave I/O thread initialization");
goto err; goto err;
} }
mi->io_thd = thd;
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd); threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
@ -3866,9 +3876,11 @@ slave_begin:
thd = new THD; // note that contructor of THD uses DBUG_ ! thd = new THD; // note that contructor of THD uses DBUG_ !
thd->thread_stack = (char*)&thd; // remember where our stack is thd->thread_stack = (char*)&thd; // remember where our stack is
rli->sql_thd= thd;
/* Inform waiting threads that slave has started */ /* Inform waiting threads that slave has started */
rli->slave_run_id++; rli->slave_run_id++;
rli->slave_running = 1;
pthread_detach_this_thread(); pthread_detach_this_thread();
if (init_slave_thread(thd, SLAVE_THD_SQL)) if (init_slave_thread(thd, SLAVE_THD_SQL))
@ -3883,7 +3895,6 @@ slave_begin:
goto err; goto err;
} }
thd->init_for_queries(); thd->init_for_queries();
rli->sql_thd= thd;
thd->temporary_tables = rli->save_temporary_tables; // restore temp tables thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd); threads.append(thd);
@ -3896,7 +3907,6 @@ slave_begin:
start receiving data so we realize we are not caught up and start receiving data so we realize we are not caught up and
Seconds_Behind_Master grows. No big deal. Seconds_Behind_Master grows. No big deal.
*/ */
rli->slave_running = 1;
rli->abort_slave = 0; rli->abort_slave = 0;
pthread_mutex_unlock(&rli->run_lock); pthread_mutex_unlock(&rli->run_lock);
pthread_cond_broadcast(&rli->start_cond); pthread_cond_broadcast(&rli->start_cond);

View File

@ -730,8 +730,6 @@ void multi_delete::send_error(uint errcode,const char *err)
} }
thd->transaction.all.modified_non_trans_table= true; thd->transaction.all.modified_non_trans_table= true;
} }
DBUG_ASSERT(!normal_tables || !deleted ||
thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -839,8 +837,6 @@ bool multi_delete::send_eof()
{ {
query_cache_invalidate3(thd, delete_tables, 1); query_cache_invalidate3(thd, delete_tables, 1);
} }
DBUG_ASSERT(!normal_tables || !deleted ||
thd->transaction.stmt.modified_non_trans_table);
if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table) if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table)
{ {
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())

View File

@ -979,7 +979,7 @@ multi_update::multi_update(TABLE_LIST *table_list,
tmp_tables(0), updated(0), found(0), fields(field_list), tmp_tables(0), updated(0), found(0), fields(field_list),
values(value_list), table_count(0), copy_field(0), values(value_list), table_count(0), copy_field(0),
handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1), handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1),
transactional_tables(1), ignore(ignore_arg), error_handled(0) transactional_tables(0), ignore(ignore_arg), error_handled(0)
{} {}
@ -1482,7 +1482,7 @@ void multi_update::send_error(uint errcode,const char *err)
if (trans_safe) if (trans_safe)
{ {
DBUG_ASSERT(transactional_tables); DBUG_ASSERT(!updated || transactional_tables);
(void) ha_autocommit_or_rollback(thd, 1); (void) ha_autocommit_or_rollback(thd, 1);
} }
else else

View File

@ -8695,7 +8695,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_simple, my_strnncollsp_simple,
my_strnxfrm_simple, /* strnxfrm */ my_strnxfrm_simple, /* strnxfrm */
my_strnxfrmlen_simple, my_strnxfrmlen_simple,
my_like_range_simple, /* like_range */ my_like_range_mb, /* like_range */
my_wildcmp_mb, /* wildcmp */ my_wildcmp_mb, /* wildcmp */
my_strcasecmp_mb, my_strcasecmp_mb,
my_instr_mb, my_instr_mb,

View File

@ -8643,7 +8643,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_simple, my_strnncollsp_simple,
my_strnxfrm_simple, /* strnxfrm */ my_strnxfrm_simple, /* strnxfrm */
my_strnxfrmlen_simple, my_strnxfrmlen_simple,
my_like_range_simple,/* like_range */ my_like_range_mb, /* like_range */
my_wildcmp_mb, /* wildcmp */ my_wildcmp_mb, /* wildcmp */
my_strcasecmp_mb, my_strcasecmp_mb,
my_instr_mb, my_instr_mb,

View File

@ -5725,7 +5725,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_simple, my_strnncollsp_simple,
my_strnxfrm_simple, /* strnxfrm */ my_strnxfrm_simple, /* strnxfrm */
my_strnxfrmlen_simple, my_strnxfrmlen_simple,
my_like_range_simple, /* like_range */ my_like_range_mb, /* like_range */
my_wildcmp_mb, /* wildcmp */ my_wildcmp_mb, /* wildcmp */
my_strcasecmp_mb, /* instr */ my_strcasecmp_mb, /* instr */
my_instr_mb, my_instr_mb,

View File

@ -1670,7 +1670,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
my_strnncollsp_ucs2_bin, my_strnncollsp_ucs2_bin,
my_strnxfrm_ucs2_bin, my_strnxfrm_ucs2_bin,
my_strnxfrmlen_simple, my_strnxfrmlen_simple,
my_like_range_simple, my_like_range_ucs2,
my_wildcmp_ucs2_bin, my_wildcmp_ucs2_bin,
my_strcasecmp_ucs2_bin, my_strcasecmp_ucs2_bin,
my_instr_mb, my_instr_mb,

View File

@ -8511,7 +8511,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_simple, my_strnncollsp_simple,
my_strnxfrm_simple, /* strnxfrm */ my_strnxfrm_simple, /* strnxfrm */
my_strnxfrmlen_simple, my_strnxfrmlen_simple,
my_like_range_simple,/* like_range */ my_like_range_mb, /* like_range */
my_wildcmp_mb, /* wildcmp */ my_wildcmp_mb, /* wildcmp */
my_strcasecmp_mb, my_strcasecmp_mb,
my_instr_mb, my_instr_mb,