1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

5.5 merge

This commit is contained in:
Sergei Golubchik
2014-11-03 17:47:37 +01:00
79 changed files with 302659 additions and 2805 deletions

View File

@ -333,7 +333,7 @@ sub testcase_timeout ($) {
return $opt_testcase_timeout * 60;
}
sub check_timeout ($) { return testcase_timeout($_[0]) / 10; }
sub check_timeout ($) { return testcase_timeout($_[0]); }
our $opt_warnings= 1;

View File

@ -2483,6 +2483,17 @@ test
2
SET sql_mode='';
#
# MDEV-6484: Assertion `tab->ref.use_count' failed on query with joins, constant table, multi-part key
#
CREATE TABLE t1 (i1 INT, c1 VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (6,'b');
CREATE TABLE t2 (pk2 INT, i2 INT, c2 VARCHAR(1), PRIMARY KEY(pk2), KEY(pk2,i2)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2,'s'),(2,4,'r'),(3,8,'m'),(4,4,'b'),(5,4,'x'),(6,7,'g'),(7,4,'p');
SELECT i2 FROM t1 AS t1a STRAIGHT_JOIN ( t2 INNER JOIN t1 AS t1b ON (t1b.c1 = c2) ) ON (t1b.i1 = pk2 )
WHERE t1a.c1 = c2 GROUP BY i2;
i2
DROP TABLE t1,t2;
#
# Bug #58782
# Missing rows with SELECT .. WHERE .. IN subquery
# with full GROUP BY and no aggr

View File

@ -1580,7 +1580,9 @@ show open tables where f1()=0;
drop table t1;
drop function f1;
select * from information_schema.tables where 1=sleep(100000);
Got one of the listed errors
select * from information_schema.columns where 1=sleep(100000);
Got one of the listed errors
explain select count(*) from information_schema.tables;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases

View File

@ -1,15 +1,19 @@
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
SELECT 1;
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":TID:";
1
1
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
INFO TIME TIME_MS
NULL 0 0.000
ID TIME TIME_MS
TID 0 0.000
SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2';
SET DEBUG_SYNC= 'now WAIT_FOR query_done';
SET DEBUG_SYNC= 'now SIGNAL nosignal';
select sleep(5);
sleep(5)
0
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
select command, time < 5 from information_schema.processlist where id != connection_id();
command time < 5
Sleep 1

View File

@ -1314,7 +1314,7 @@ drop table t1;
# Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...).
--replace_result 511 ok 512 ok 2047 ok 513 ok
--replace_result 511 ok 512 ok 2047 ok 513 ok 515 ok
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';

View File

@ -122,7 +122,7 @@ SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
# then its contents will never change because the cache from which it is
# filled is updated only if it has not been read for 0.1 seconds. See
# CACHE_MIN_IDLE_TIME_US in trx/trx0i_s.c.
let $cnt=10;
let $cnt=200;
while ($cnt)
{
let $success=`SELECT COUNT(*) = 14 FROM INFORMATION_SCHEMA.INNODB_LOCKS`;

View File

@ -25,6 +25,11 @@ let $field= Server_id;
# 3 is server_id of slave2.
let $condition= ='3';
source include/wait_show_condition.inc;
# Make sure that the other slave also had time to register. Otherwise we get
# occasional spurious failures where server_id=2 is missing from SHOW SLAVE
# HOSTS, when that slave is much slower to register due to thread scheduling.
let $condition= ='2';
source include/wait_show_condition.inc;
--replace_column 3 'SLAVE_PORT'
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT
SHOW SLAVE HOSTS;

View File

@ -1650,6 +1650,20 @@ SET sql_mode='ONLY_FULL_GROUP_BY';
SELECT 1 AS test UNION SELECT 2 AS test ORDER BY test IS NULL ASC;
SET sql_mode='';
--echo #
--echo # MDEV-6484: Assertion `tab->ref.use_count' failed on query with joins, constant table, multi-part key
--echo #
CREATE TABLE t1 (i1 INT, c1 VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (6,'b');
CREATE TABLE t2 (pk2 INT, i2 INT, c2 VARCHAR(1), PRIMARY KEY(pk2), KEY(pk2,i2)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,2,'s'),(2,4,'r'),(3,8,'m'),(4,4,'b'),(5,4,'x'),(6,7,'g'),(7,4,'p');
SELECT i2 FROM t1 AS t1a STRAIGHT_JOIN ( t2 INNER JOIN t1 AS t1b ON (t1b.c1 = c2) ) ON (t1b.i1 = pk2 )
WHERE t1a.c1 = c2 GROUP BY i2;
DROP TABLE t1,t2;
#
# End of MariaDB 5.5 tests
#

View File

@ -1298,12 +1298,16 @@ info='select * from information_schema.tables where 1=sleep(100000)';
disable_query_log;
eval kill $ID;
enable_query_log;
disconnect conn1;
let $wait_timeout= 10;
let $wait_condition=select count(*)=0 from information_schema.processlist
where state='User sleep' and
info='select * from information_schema.tables where 1=sleep(100000)';
--source include/wait_condition.inc
connection conn1;
--error 2013,ER_CONNECTION_KILLED
reap;
connection default;
disconnect conn1;
connect (conn1, localhost, root,,);
connection conn1;
@ -1318,12 +1322,16 @@ info='select * from information_schema.columns where 1=sleep(100000)';
disable_query_log;
eval kill $ID;
enable_query_log;
disconnect conn1;
let $wait_timeout= 10;
let $wait_condition=select count(*)=0 from information_schema.processlist
where state='User sleep' and
info='select * from information_schema.columns where 1=sleep(100000)';
--source include/wait_condition.inc
connection conn1;
--error 2013,ER_CONNECTION_KILLED
reap;
connection default;
disconnect conn1;
#

View File

@ -4,19 +4,22 @@
source include/have_debug_sync.inc;
let $tid= `SELECT CONNECTION_ID()`;
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
send SELECT 1;
connect (con1,localhost,root,,);
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
send SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
--replace_result $tid TID
send_eval SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":$tid:";
connection default;
reap;
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
connection con1;
--replace_result $tid TID
reap;
connection default;
@ -24,10 +27,24 @@ connection default;
# MDEV-4683 query start_time not reset when going to sleep
#
connection con1;
# Trigger a signal once the thread has gone from "Query" to "Sleep" command
# state. Note we need to execute this twice: Once at the end of SET DEBUG_SYNC,
# and once for the intended time, at the end of SELECT SLEEP().
SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2';
connection default;
# Wait for and clear the first signal set during SET DEBUG_SYNC.
SET DEBUG_SYNC= 'now WAIT_FOR query_done';
SET DEBUG_SYNC= 'now SIGNAL nosignal';
connection con1;
select sleep(5); #run a query that will take some time
connection default;
# Need to ensure that the previous query has really completed. Otherwise,
# the select could see the previous query still in "Query" stage in the
# processlist.
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
# verify that the time in COM_SLEEP doesn't include the query run time
select command, time < 5 from information_schema.processlist where id != connection_id();