Merge trift2.:/MySQL/M50/mysql-5.0

into  trift2.:/MySQL/M50/push-5.0
This commit is contained in:
unknown 2008-03-25 14:09:16 +01:00
commit d6fc09af43
46 changed files with 534 additions and 37 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

@ -77,7 +77,8 @@ load data infile '../std_data_ln/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 1 ERROR 23000: Duplicate entry '2003-03-22' for key 1
drop table t2; set @@global.sql_slave_skip_counter=1;
start slave;
drop table t2; drop table t2;
drop table t1; drop table t1;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;

View file

@ -16,3 +16,9 @@ select master_pos_wait('master-bin.999999',0);
stop slave sql_thread; stop slave sql_thread;
master_pos_wait('master-bin.999999',0) master_pos_wait('master-bin.999999',0)
NULL NULL
"*** must be empty ***"
show slave status;
"*** must be NULL ***"
select master_pos_wait('foo', 98);
master_pos_wait('foo', 98)
NULL

View file

@ -53,3 +53,4 @@ Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master NULL Seconds_Behind_Master NULL
drop table t1; drop table t1;
drop table t1;

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

@ -147,12 +147,20 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
connection slave; connection slave;
wait_for_slave_to_stop; wait_for_slave_to_stop;
drop table t2;
# cleanup:
set @@global.sql_slave_skip_counter=1;
start slave;
connection master; connection master;
drop table t2; drop table t2;
drop table t1; drop table t1;
sync_slave_with_master;
# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed # BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
connection master;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error 1062 --error 1062
@ -160,5 +168,6 @@ LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
DROP TABLE t1; DROP TABLE t1;
sync_with_master; sync_slave_with_master;
# End of 4.1 tests # End of 4.1 tests

View file

@ -15,4 +15,15 @@ stop slave sql_thread;
connection slave; connection slave;
reap; reap;
#
# bug#26622 MASTER_POS_WAIT does not work as documented
#
connection master;
echo "*** must be empty ***";
query_vertical show slave status;
echo "*** must be NULL ***";
select master_pos_wait('foo', 98);
# End of 4.1 tests # End of 4.1 tests

View file

@ -15,12 +15,13 @@ select * from t1;
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; sync_slave_with_master;
# End of 4.1 tests # End of 4.1 tests
# #
# #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists # #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
# #
connection master;
create table t1(a int primary key); create table t1(a int primary key);
insert into t1 values (1),(2); insert into t1 values (1),(2);
delete from t1 where @@server_id=1; delete from t1 where @@server_id=1;
@ -36,5 +37,5 @@ select * from t1;
show slave status; show slave status;
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; sync_slave_with_master;
# End of 5.0 tests # End of 5.0 tests

View file

@ -29,8 +29,12 @@ start slave;
--vertical_results --vertical_results
show slave status; show slave status;
# cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually
connection master; connection master;
drop table t1; drop table t1;
sync_with_master; connection slave;
drop table t1;
# end of 4.1 tests # end of 4.1 tests

View file

@ -130,7 +130,7 @@ drop table t1,t2;
# don't get any memory leaks for this # don't get any memory leaks for this
create temporary table t3 (f int); create temporary table t3 (f int);
sync_with_master; sync_slave_with_master;
# The server will now close done # The server will now close done
@ -141,7 +141,8 @@ sync_with_master;
connection master; connection master;
create temporary table t4 (f int); create temporary table t4 (f int);
create table t5 (f int); create table t5 (f int);
sync_with_master; sync_slave_with_master;
connection master;
# find dumper's $id # find dumper's $id
source include/get_binlog_dump_thread_id.inc; source include/get_binlog_dump_thread_id.inc;
insert into t4 values (1); insert into t4 values (1);

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

@ -699,7 +699,20 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
while (*slave_running) // Should always be true while (*slave_running) // Should always be true
{ {
DBUG_PRINT("loop", ("killing slave thread")); DBUG_PRINT("loop", ("killing slave thread"));
KICK_SLAVE(thd);
pthread_mutex_lock(&thd->LOCK_delete);
#ifndef DONT_USE_THR_ALARM
/*
Error codes from pthread_kill are:
EINVAL: invalid signal number (can't happen)
ESRCH: thread already killed (can happen, should be ignored)
*/
IF_DBUG(int err= ) pthread_kill(thd->real_id, thr_client_alarm);
DBUG_ASSERT(err != EINVAL);
#endif
thd->awake(THD::NOT_KILLED);
pthread_mutex_unlock(&thd->LOCK_delete);
/* /*
There is a small chance that slave thread might miss the first There is a small chance that slave thread might miss the first
alarm. To protect againts it, resend the signal until it reacts alarm. To protect againts it, resend the signal until it reacts
@ -2685,7 +2698,7 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
longlong timeout) longlong timeout)
{ {
if (!inited) if (!inited)
return -1; return -2;
int event_count = 0; int event_count = 0;
ulong init_abort_pos_wait; ulong init_abort_pos_wait;
int error=0; int error=0;
@ -2896,6 +2909,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 +2931,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 +3539,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 +3550,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 +3889,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 +3908,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 +3920,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

@ -35,12 +35,6 @@ extern I_List<i_string> binlog_do_db, binlog_ignore_db;
extern int max_binlog_dump_events; extern int max_binlog_dump_events;
extern my_bool opt_sporadic_binlog_dump_fail; extern my_bool opt_sporadic_binlog_dump_fail;
#define KICK_SLAVE(thd) do { \
pthread_mutex_lock(&(thd)->LOCK_delete); \
(thd)->awake(THD::NOT_KILLED); \
pthread_mutex_unlock(&(thd)->LOCK_delete); \
} while(0)
int start_slave(THD* thd, MASTER_INFO* mi, bool net_report); int start_slave(THD* thd, MASTER_INFO* mi, bool net_report);
int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report); int stop_slave(THD* thd, MASTER_INFO* mi, bool net_report);
bool change_master(THD* thd, MASTER_INFO* mi); bool change_master(THD* thd, MASTER_INFO* mi);

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,