Skip to content

Commit

Permalink
Automatic merge
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi committed Sep 11, 2014
2 parents 4a68817 + c4f5326 commit c6051a4
Show file tree
Hide file tree
Showing 28 changed files with 396 additions and 91 deletions.
12 changes: 10 additions & 2 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7719,6 +7719,7 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql)
{
uint count;
MYSQL_RES *warn_res;
DYNAMIC_STRING res;
DBUG_ENTER("append_warnings");

if (!(count= mysql_warning_count(mysql)))
Expand All @@ -7738,11 +7739,18 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql)
die("Warning count is %u but didn't get any warnings",
count);

append_result(ds, warn_res);
init_dynamic_string(&res, "", 1024, 1024);

append_result(&res, warn_res);
mysql_free_result(warn_res);

DBUG_PRINT("warnings", ("%s", ds->str));
DBUG_PRINT("warnings", ("%s", res.str));

if (display_result_sorted)
dynstr_append_sorted(ds, &res, 0);
else
dynstr_append_mem(ds, res.str, res.length);
dynstr_free(&res);
DBUG_RETURN(count);
}

Expand Down
12 changes: 12 additions & 0 deletions mysql-test/r/create_or_replace.result
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,16 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
drop table t1;
unlock tables;
#
# MDEV-6560
# Assertion `! is_set() ' failed in Diagnostics_area::set_ok_status
#
CREATE TABLE t1 (col_int_nokey INT) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1;
LOCK TABLE t1 WRITE;
CREATE OR REPLACE TABLE t1 LIKE tmp;;
KILL QUERY 3;
CREATE OR REPLACE TABLE t1 (a int);;
KILL QUERY 3;
drop table t1;
DROP TABLE t2;
51 changes: 51 additions & 0 deletions mysql-test/r/ctype_partitions.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# MDEV-6255 DUPLICATE KEY Errors on SELECT .. GROUP BY that uses temporary and filesort
#
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
SELECT HEX(a) FROM t1 WHERE a=0x60;
HEX(a)
20
60
6060
606060
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0x60;
HEX(a)
20
60
6060
606060
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8u COLLATE koi8u_general_ci);
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
SELECT HEX(a) FROM t1 WHERE a=0x60;
HEX(a)
20
60
6060
606060
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0x60;
HEX(a)
20
60
6060
606060
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1250 COLLATE cp1250_general_ci);
INSERT INTO t1 VALUES (0x20),(0xA0),(0xA0A0),(0xA0A0A0);
SELECT HEX(a) FROM t1 WHERE a=0xA0;
HEX(a)
20
A0
A0A0
A0A0A0
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0xA0;
HEX(a)
20
A0
A0A0
A0A0A0
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/suite/multi_source/gtid.result
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ include/reset_master_slave.inc
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE 'slave2' stopped
Note 1938 SLAVE 'slave1' stopped
Note 1938 SLAVE 'slave2' stopped
include/reset_master_slave.inc
SET GLOBAL gtid_domain_id=0;
include/reset_master_slave.inc
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/multi_source/gtid.test
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ DROP TABLE t3;
SET GLOBAL gtid_domain_id=0;
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.tables WHERE table_name IN ("t1", "t2", "t3") AND table_schema = "test"
--source include/wait_condition.inc
--sorted_result
STOP ALL SLAVES;
--source reset_master_slave.inc
--disconnect slave1

--connection slave2
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
--source reset_master_slave.inc
--disconnect slave2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ a
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE 'c2a' stopped
Note 1938 SLAVE 'b2a' stopped
Note 1938 SLAVE 'c2a' stopped
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
SET GLOBAL gtid_domain_id=0;
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/suite/multi_source/gtid_ignore_duplicates.test
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,28 @@ SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
# Clean up.
--connection server_1
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;

--connection server_2
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;

--connection server_3
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;

--connection server_4
SET GLOBAL gtid_domain_id=0;
--sorted_result
STOP ALL SLAVES;
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/multi_source/load_data.result
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ drop table t1;
drop table t2;
stop all slaves;
Warnings:
Note 1938 SLAVE 'master2' stopped
Note 1938 SLAVE '' stopped
Note 1938 SLAVE 'master2' stopped
include/reset_master_slave.inc
include/reset_master_slave.inc
include/reset_master_slave.inc
1 change: 1 addition & 0 deletions mysql-test/suite/multi_source/load_data.test
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ drop table t2;
--sync_with_master 0,'master2'

--connection slave
--sorted_result
stop all slaves;

--source reset_master_slave.inc
Expand Down
31 changes: 31 additions & 0 deletions mysql-test/suite/rpl/r/create_or_replace2.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
include/master-slave.inc
[connection master]
#
# MDEV-6525 ; Problems with CREATE OR REPLACE under lock
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(a) FROM t1 );
connect con1,localhost,root,,test;
CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB;
LOCK TABLE t1 WRITE;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
CREATE OR REPLACE TABLE t1 LIKE tmp;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection default;
set session lock_wait_timeout=1;
SELECT f1();
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set session lock_wait_timeout=@@global.lock_wait_timeout;
SELECT f1();
connection con1;
unlock tables;
connection default;
ERROR 42S22: Unknown column 'a' in 'field list'
disconnect con1;
drop function f1;
drop table t1;
include/rpl_end.inc
44 changes: 44 additions & 0 deletions mysql-test/suite/rpl/t/create_or_replace2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--source include/have_innodb.inc
--source include/have_binlog_format_row_or_statement.inc
--source include/have_metadata_lock_info.inc
--source include/master-slave.inc
--enable_connect_log

--echo #
--echo # MDEV-6525 ; Problems with CREATE OR REPLACE under lock
--echo #

CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(a) FROM t1 );

--connect (con1,localhost,root,,test)

CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB;
LOCK TABLE t1 WRITE;

SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;

CREATE OR REPLACE TABLE t1 LIKE tmp;
SHOW CREATE TABLE t1;

--connection default
set session lock_wait_timeout=1;
--error 1205
SELECT f1();

set session lock_wait_timeout=@@global.lock_wait_timeout;
--send SELECT f1()
--connection con1
# This is here just in case, any timeout should be ok
--sleep 1
unlock tables;
--connection default
--error 1054
--reap
--disconnect con1

# Cleanup
drop function f1;
drop table t1;
--disable_connect_log
--source include/rpl_end.inc
32 changes: 32 additions & 0 deletions mysql-test/t/create_or_replace.test
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,38 @@ select * from information_schema.metadata_lock_info;
drop table t1;
unlock tables;

--echo #
--echo # MDEV-6560
--echo # Assertion `! is_set() ' failed in Diagnostics_area::set_ok_status
--echo #

CREATE TABLE t1 (col_int_nokey INT) ENGINE=InnoDB;

--let $con_id = `SELECT CONNECTION_ID()`
CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1;
LOCK TABLE t1 WRITE;

--connect (con1,localhost,root,,test)

--connection default
--send CREATE OR REPLACE TABLE t1 LIKE tmp;
--connection con1
eval KILL QUERY $con_id;

--connection default
--error 0,ER_QUERY_INTERRUPTED
--reap
--send CREATE OR REPLACE TABLE t1 (a int);

--connection con1
eval KILL QUERY $con_id;

--connection default
--error 0,ER_QUERY_INTERRUPTED
--reap
--disconnect con1
drop table t1;

#
# Cleanup
#
Expand Down
29 changes: 29 additions & 0 deletions mysql-test/t/ctype_partitions.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--source include/have_partition.inc

--echo #
--echo # MDEV-6255 DUPLICATE KEY Errors on SELECT .. GROUP BY that uses temporary and filesort
--echo #

# cp1251_ukrainian_ci: 0x20 SPACE is equal to 0x60 GRAVE ACCENT
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
SELECT HEX(a) FROM t1 WHERE a=0x60;
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0x60;
DROP TABLE t1;

# koi8u_general_ci: 0x20 SPACE is equal to 0x60 GRAVE ACCENT
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8u COLLATE koi8u_general_ci);
INSERT INTO t1 VALUES (0x20),(0x60),(0x6060),(0x606060);
SELECT HEX(a) FROM t1 WHERE a=0x60;
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0x60;
DROP TABLE t1;

# cp1250_general_ci: 0x20 SPACE is equal to 0xA0 NO-BREAK SPACE
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1250 COLLATE cp1250_general_ci);
INSERT INTO t1 VALUES (0x20),(0xA0),(0xA0A0),(0xA0A0A0);
SELECT HEX(a) FROM t1 WHERE a=0xA0;
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 3;
SELECT HEX(a) FROM t1 WHERE a=0xA0;
DROP TABLE t1;
11 changes: 11 additions & 0 deletions mysql-test/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,17 @@
fun:__libc_start_main
}

#
# dl_init reports leaked memory in memalign on OpenSuse 12.3

{
memory "loss" from _dl_init
Memcheck:Leak
fun:memalign
...
fun:call_init
fun:_dl_init
}

#
# dlclose can allocate memory for error message, the memory will be
Expand Down
12 changes: 8 additions & 4 deletions sql/slave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,7 @@ when it try to get the value of TIME_ZONE global variable from master.";
static bool wait_for_relay_log_space(Relay_log_info* rli)
{
bool slave_killed=0;
bool ignore_log_space_limit;
Master_info* mi = rli->mi;
PSI_stage_info old_stage;
THD* thd = mi->io_thd;
Expand All @@ -2245,6 +2246,11 @@ static bool wait_for_relay_log_space(Relay_log_info* rli)
!rli->ignore_log_space_limit)
mysql_cond_wait(&rli->log_space_cond, &rli->log_space_lock);

ignore_log_space_limit= rli->ignore_log_space_limit;
rli->ignore_log_space_limit= 0;

thd->EXIT_COND(&old_stage);

/*
Makes the IO thread read only one event at a time
until the SQL thread is able to purge the relay
Expand All @@ -2268,7 +2274,8 @@ static bool wait_for_relay_log_space(Relay_log_info* rli)
thread sleeps waiting for events.
*/
if (rli->ignore_log_space_limit)

if (ignore_log_space_limit)
{
#ifndef DBUG_OFF
{
Expand All @@ -2290,11 +2297,8 @@ static bool wait_for_relay_log_space(Relay_log_info* rli)
mysql_mutex_unlock(&mi->data_lock);
rli->sql_force_rotate_relay= false;
}

rli->ignore_log_space_limit= false;
}

thd->EXIT_COND(&old_stage);
DBUG_RETURN(slave_killed);
}

Expand Down
Loading

0 comments on commit c6051a4

Please sign in to comment.