Commit 1704783e authored by Sergey Glukhov's avatar Sergey Glukhov

5.1-bugteam->trunk-merge merge

parents 100f88b8 b36a0282
......@@ -2422,6 +2422,44 @@ ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, 77, 1, 3);
UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
DROP TABLE t1;
#
# Bug#50389 Using intersect does not return all rows
#
CREATE TABLE t1 (
f1 INT(10) NOT NULL,
f2 INT(10),
f3 INT(10),
f4 TINYINT(4),
f5 VARCHAR(50),
PRIMARY KEY (f1),
KEY idx1 (f2,f5,f4),
KEY idx2 (f2,f4)
) ENGINE=InnoDB;
LOAD DATA INFILE '../../std_data/intersect-bug50389.tsv' INTO TABLE t1;
SELECT * FROM t1 WHERE f1 IN
(3305028,3353871,3772880,3346860,4228206,3336022,
3470988,3305175,3329875,3817277,3856380,3796193,
3784744,4180925,4559596,3963734,3856391,4494153)
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
f1 f2 f3 f4 f5
3305175 1221457 0 0 abcdefghijklmnopwrst
3329875 1221457 1382427 0 abcdefghijklmnopwrst
3336022 1221457 0 0 abcdefghijklmnopwrst
3346860 1221457 0 0 abcdefghijklmnopwrst
3772880 1221457 0 0 abcdefghijklmnopwrst
3784744 1221457 1382427 0 abcdefghijklmnopwrst
3796193 1221457 0 0 abcdefghijklmnopwrst
4228206 1221457 0 0 abcdefghijklmnopwrst
4494153 1221457 0 0 abcdefghijklmnopwrst
4559596 1221457 0 0 abcdefghijklmnopwrst
EXPLAIN SELECT * FROM t1 WHERE f1 IN
(3305028,3353871,3772880,3346860,4228206,3336022,
3470988,3305175,3329875,3817277,3856380,3796193,
3784744,4180925,4559596,3963734,3856391,4494153)
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge PRIMARY,idx1,idx2 idx2,idx1,PRIMARY 7,60,4 NULL 1 Using intersect(idx2,idx1,PRIMARY); Using where
DROP TABLE t1;
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
......
This diff is collapsed.
......@@ -91,3 +91,14 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
';
ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
drop table t1, char63_utf8, char128_utf8;
#
# Bug #54393: crash and/or valgrind errors in
# mysql_client_binlog_statement
#
BINLOG '';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
BINLOG '123';
BINLOG '-2079193929';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
BINLOG 'xç↓%~∙D╒ƒ╡';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
......@@ -150,3 +150,16 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
';
drop table t1, char63_utf8, char128_utf8;
--echo #
--echo # Bug #54393: crash and/or valgrind errors in
--echo # mysql_client_binlog_statement
--echo #
--error ER_SYNTAX_ERROR
BINLOG '';
BINLOG '123';
--error ER_SYNTAX_ERROR
BINLOG '-2079193929';
--error ER_SYNTAX_ERROR
BINLOG 'xç↓%~∙D╒ƒ╡';
......@@ -663,6 +663,37 @@ UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
DROP TABLE t1;
--echo #
--echo # Bug#50389 Using intersect does not return all rows
--echo #
CREATE TABLE t1 (
f1 INT(10) NOT NULL,
f2 INT(10),
f3 INT(10),
f4 TINYINT(4),
f5 VARCHAR(50),
PRIMARY KEY (f1),
KEY idx1 (f2,f5,f4),
KEY idx2 (f2,f4)
) ENGINE=InnoDB;
LOAD DATA INFILE '../../std_data/intersect-bug50389.tsv' INTO TABLE t1;
SELECT * FROM t1 WHERE f1 IN
(3305028,3353871,3772880,3346860,4228206,3336022,
3470988,3305175,3329875,3817277,3856380,3796193,
3784744,4180925,4559596,3963734,3856391,4494153)
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
EXPLAIN SELECT * FROM t1 WHERE f1 IN
(3305028,3353871,3772880,3346860,4228206,3336022,
3470988,3305175,3329875,3817277,3856380,3796193,
3784744,4180925,4559596,3963734,3856391,4494153)
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
DROP TABLE t1;
--echo End of 5.1 tests
......
......@@ -483,9 +483,11 @@ $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \
$BASE/mysql-test/std_data
$CP mysql-test/t/*.test mysql-test/t/*.imtest \
mysql-test/t/*.disabled mysql-test/t/*.opt \
mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t
# Attention: when the wildcards expand to a line that is very long,
# it may exceed the command line length limit on some platform(s). Bug#54590
$CP mysql-test/t/*.test mysql-test/t/*.imtest $BASE/mysql-test/t
$CP mysql-test/t/*.disabled mysql-test/t/*.opt $BASE/mysql-test/t
$CP mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t
$CP mysql-test/r/*.result mysql-test/r/*.require \
$BASE/mysql-test/r
......
......@@ -8538,6 +8538,7 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
if ((error= quick->get_next()))
DBUG_RETURN(error);
}
quick->file->position(quick->record);
}
memcpy(last_rowid, quick->file->ref, head->file->ref_length);
last_rowid_count= 1;
......
......@@ -52,9 +52,13 @@ void mysql_client_binlog_statement(THD* thd)
if (check_global_access(thd, SUPER_ACL))
DBUG_VOID_RETURN;
size_t coded_len= thd->lex->comment.length + 1;
size_t coded_len= thd->lex->comment.length;
if (!coded_len)
{
my_error(ER_SYNTAX_ERROR, MYF(0));
DBUG_VOID_RETURN;
}
size_t decoded_len= base64_needed_decoded_length(coded_len);
DBUG_ASSERT(coded_len > 0);
/*
Allocation
......@@ -155,14 +159,16 @@ void mysql_client_binlog_statement(THD* thd)
/*
Checking that the first event in the buffer is not truncated.
*/
ulong event_len= uint4korr(bufptr + EVENT_LEN_OFFSET);
DBUG_PRINT("info", ("event_len=%lu, bytes_decoded=%d",
event_len, bytes_decoded));
if (bytes_decoded < EVENT_LEN_OFFSET || (uint) bytes_decoded < event_len)
ulong event_len;
if (bytes_decoded < EVENT_LEN_OFFSET + 4 ||
(event_len= uint4korr(bufptr + EVENT_LEN_OFFSET)) >
(uint) bytes_decoded)
{
my_error(ER_SYNTAX_ERROR, MYF(0));
goto end;
}
DBUG_PRINT("info", ("event_len=%lu, bytes_decoded=%d",
event_len, bytes_decoded));
/*
If we have not seen any Format_description_event, then we must
......@@ -200,17 +206,6 @@ void mysql_client_binlog_statement(THD* thd)
bufptr += event_len;
DBUG_PRINT("info",("ev->get_type_code()=%d", ev->get_type_code()));
#ifndef HAVE_purify
/*
This debug printout should not be used for valgrind builds
since it will read from unassigned memory.
*/
DBUG_PRINT("info",("bufptr+EVENT_TYPE_OFFSET: 0x%lx",
(long) (bufptr+EVENT_TYPE_OFFSET)));
DBUG_PRINT("info", ("bytes_decoded: %d bufptr: 0x%lx buf[EVENT_LEN_OFFSET]: %lu",
bytes_decoded, (long) bufptr,
(ulong) uint4korr(bufptr+EVENT_LEN_OFFSET)));
#endif
ev->thd= thd;
/*
We go directly to the application phase, since we don't need
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment