mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge with mysql-5.1.63
This commit is contained in:
@ -4,6 +4,9 @@
|
||||
# $engine_type -- storage engine to be tested
|
||||
# $test_foreign_keys -- 0, skip foreign key tests
|
||||
# -- 1, do not skip foreign key tests
|
||||
# $partitions_a -- partition by column 'a'
|
||||
# $partitions_id -- partition by column 'id'
|
||||
# $partitions_s1 -- partition by column 's1'
|
||||
# have to be set before sourcing this script.
|
||||
#
|
||||
# Last update:
|
||||
@ -19,47 +22,61 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
|
||||
drop table if exists t1,t2,t3;
|
||||
--enable_warnings
|
||||
|
||||
set @save_query_cache_size = @@global.query_cache_size;
|
||||
set GLOBAL query_cache_size = 1355776;
|
||||
|
||||
#
|
||||
# Without auto_commit.
|
||||
#
|
||||
flush status;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null);
|
||||
eval create table t1 (a int not null)$partitions_a;
|
||||
insert into t1 values (1),(2),(3);
|
||||
--sorted_result
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
||||
begin;
|
||||
create table t1 (a int not null);
|
||||
eval create table t1 (a int not null)$partitions_a;
|
||||
insert into t1 values (1),(2),(3);
|
||||
--sorted_result
|
||||
select * from t1;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t1;
|
||||
commit;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (a int not null);
|
||||
create table t3 (a int not null);
|
||||
eval create table t1 (a int not null)$partitions_a;
|
||||
eval create table t2 (a int not null)$partitions_a;
|
||||
eval create table t3 (a int not null)$partitions_a;
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t3 values (1),(2);
|
||||
--sorted_result
|
||||
select * from t1;
|
||||
--sorted_result
|
||||
select * from t2;
|
||||
--sorted_result
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
begin;
|
||||
--sorted_result
|
||||
select * from t1;
|
||||
--sorted_result
|
||||
select * from t2;
|
||||
--sorted_result
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
insert into t1 values (3);
|
||||
insert into t2 values (3);
|
||||
insert into t1 values (4);
|
||||
--sorted_result
|
||||
select * from t1;
|
||||
--sorted_result
|
||||
select * from t2;
|
||||
--sorted_result
|
||||
select * from t3;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
@ -67,7 +84,7 @@ commit;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
drop table t3,t2,t1;
|
||||
|
||||
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
|
||||
eval CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id))$partitions_id;
|
||||
select count(*) from t1;
|
||||
insert into t1 (id) values (0);
|
||||
select count(*) from t1;
|
||||
@ -78,8 +95,6 @@ if ($test_foreign_keys)
|
||||
#
|
||||
# one statement roll back inside transation
|
||||
#
|
||||
let $save_query_cache_size=`select @@global.query_cache_size`;
|
||||
set GLOBAL query_cache_size=1355776;
|
||||
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
|
||||
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
|
||||
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
|
||||
@ -95,9 +110,6 @@ insert into t3 VALUES ( NULL, 1, 1, 2 );
|
||||
commit;
|
||||
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
|
||||
drop table t3,t2,t1;
|
||||
--disable_query_log
|
||||
eval set GLOBAL query_cache_size=$save_query_cache_size;
|
||||
--enable_query_log
|
||||
}
|
||||
|
||||
#
|
||||
@ -118,7 +130,7 @@ SET GLOBAL query_cache_size = 200000;
|
||||
flush status;
|
||||
SET @@autocommit=1;
|
||||
eval SET SESSION STORAGE_ENGINE = $engine_type;
|
||||
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1));
|
||||
eval CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1))$partitions_s1;
|
||||
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
@ -176,8 +188,8 @@ show status like "Qcache_queries_in_cache";
|
||||
show status like "Qcache_hits";
|
||||
|
||||
# Final cleanup
|
||||
eval set GLOBAL query_cache_size=$save_query_cache_size;
|
||||
disconnect connection1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection default;
|
||||
set @@global.query_cache_size = @save_query_cache_size;
|
||||
drop table t2;
|
||||
|
@ -1,5 +1,7 @@
|
||||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
drop table if exists t1,t2,t3;
|
||||
set @save_query_cache_size = @@global.query_cache_size;
|
||||
set GLOBAL query_cache_size = 1355776;
|
||||
flush status;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null);
|
||||
@ -100,7 +102,7 @@ show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 2
|
||||
drop table t3,t2,t1;
|
||||
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
|
||||
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
@ -109,7 +111,6 @@ select count(*) from t1;
|
||||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
set GLOBAL query_cache_size=1355776;
|
||||
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
|
||||
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
|
||||
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
|
||||
@ -218,5 +219,5 @@ Qcache_queries_in_cache 1
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 1
|
||||
set GLOBAL query_cache_size=1048576;
|
||||
set @@global.query_cache_size = @save_query_cache_size;
|
||||
drop table t2;
|
||||
|
@ -468,4 +468,13 @@ NULL
|
||||
Warnings:
|
||||
Warning 1301 Result of cast_as_char() was larger than max_allowed_packet (2048) - truncated
|
||||
SET @@GLOBAL.max_allowed_packet=default;
|
||||
#
|
||||
# Bug#13519724 63793: CRASH IN DTCOLLATION::SET(DTCOLLATION &SET)
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(50));
|
||||
SELECT a FROM t1
|
||||
WHERE CAST(a as BINARY)=x'62736D697468'
|
||||
AND CAST(a AS BINARY)=x'65736D697468';
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -55,3 +55,17 @@ Error 1054 Unknown column 'b' in 'field list'
|
||||
INSERT INTO t1 SELECT b FROM t1;
|
||||
ERROR 42S22: Unknown column 'b' in 'field list'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2(a INT PRIMARY KEY, b INT);
|
||||
SELECT '' AS b FROM t1 GROUP BY VALUES(b);
|
||||
ERROR 42S22: Unknown column '' in 'VALUES() function'
|
||||
REPLACE t2(b) SELECT '' AS b FROM t1 GROUP BY VALUES(b);
|
||||
ERROR 42S22: Unknown column '' in 'VALUES() function'
|
||||
UPDATE t2 SET a=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
|
||||
ERROR 42S22: Unknown column '' in 'VALUES() function'
|
||||
INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE
|
||||
b=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
|
||||
ERROR 42S22: Unknown column '' in 'VALUES() function'
|
||||
INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
|
||||
b=(SELECT VALUES(a)+2 FROM t1);
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -776,4 +776,14 @@ SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
|
||||
1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1)
|
||||
1
|
||||
#
|
||||
#
|
||||
# Bug#13012483: EXPLAIN EXTENDED, PREPARED STATEMENT, CRASH IN CHECK_SIMPLE_EQUALITY
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
|
||||
EXECUTE s;
|
||||
1
|
||||
DROP TABLE t1;
|
||||
# End of test BUG#13012483
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
@ -1075,4 +1075,16 @@ SPATIAL INDEX i1 (col1, col2)
|
||||
);
|
||||
ERROR HY000: Incorrect arguments to SPATIAL INDEX
|
||||
DROP TABLE t0, t1, t2;
|
||||
#
|
||||
# BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS
|
||||
#
|
||||
SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
|
||||
ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)))
|
||||
NULL
|
||||
#
|
||||
# BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN
|
||||
# GEOMETRY FUNCTION ARGUMENTS
|
||||
#
|
||||
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
|
||||
ERROR 22007: Illegal non geometric '' value found during parsing
|
||||
End of 5.1 tests
|
||||
|
@ -239,3 +239,13 @@ mtr
|
||||
mysql
|
||||
test
|
||||
DROP DATABASE bug58090;
|
||||
#
|
||||
# Bug #11766072 - 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
|
||||
#
|
||||
Benchmark
|
||||
Average number of seconds to run all queries: TIME seconds
|
||||
Minimum number of seconds to run all queries: TIME seconds
|
||||
Maximum number of seconds to run all queries: TIME seconds
|
||||
Number of clients running queries: 1
|
||||
Average number of queries per client: 0
|
||||
|
||||
|
205
mysql-test/r/partition_cache.result
Normal file
205
mysql-test/r/partition_cache.result
Normal file
@ -0,0 +1,205 @@
|
||||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
drop table if exists t1,t2,t3;
|
||||
set @save_query_cache_size = @@global.query_cache_size;
|
||||
set GLOBAL query_cache_size = 1355776;
|
||||
flush status;
|
||||
set autocommit=0;
|
||||
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
set autocommit=1;
|
||||
begin;
|
||||
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
|
||||
insert into t1 values (1),(2),(3);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t1;
|
||||
commit;
|
||||
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
|
||||
create table t2 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
|
||||
create table t3 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1),(2);
|
||||
insert into t3 values (1),(2);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
begin;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
insert into t1 values (3);
|
||||
insert into t2 values (3);
|
||||
insert into t1 values (4);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
select * from t2;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
commit;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
drop table t3,t2,t1;
|
||||
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
insert into t1 (id) values (0);
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
SET @@autocommit=1;
|
||||
connection default
|
||||
SHOW VARIABLES LIKE 'have_query_cache';
|
||||
Variable_name Value
|
||||
have_query_cache YES
|
||||
SET GLOBAL query_cache_size = 200000;
|
||||
flush status;
|
||||
SET @@autocommit=1;
|
||||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1)) PARTITION BY KEY (s1) PARTITIONS 3;
|
||||
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
0
|
||||
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
connection connection1
|
||||
START TRANSACTION;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
0
|
||||
INSERT INTO t2 VALUES (5,'w');
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
1
|
||||
COMMIT;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
1
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
connection default
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
1
|
||||
COMMIT;
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
connection connection1
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
START TRANSACTION;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
INSERT INTO t2 VALUES (6,'w');
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
3
|
||||
connection default
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
START TRANSACTION;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
DELETE from t2 WHERE s1=3;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
1
|
||||
COMMIT;
|
||||
connection connection1
|
||||
COMMIT;
|
||||
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
|
||||
count(*)
|
||||
2
|
||||
show status like "Qcache_queries_in_cache";
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
show status like "Qcache_hits";
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
set @@global.query_cache_size = @save_query_cache_size;
|
||||
drop table t2;
|
@ -109,6 +109,7 @@ DROP FUNCTION db1.f1;
|
||||
DROP TABLE db1.t1;
|
||||
DROP DATABASE db1;
|
||||
DROP DATABASE db2;
|
||||
USE test;
|
||||
#
|
||||
# Bug#13105873:valgrind warning:possible crash in foreign
|
||||
# key handling on subsequent create table if not exists
|
||||
@ -128,4 +129,94 @@ CALL p1();
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
DROP DATABASE testdb;
|
||||
USE test;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
#
|
||||
SET @@SQL_MODE = '';
|
||||
CREATE FUNCTION testf_bug11763507() RETURNS INT
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END
|
||||
$
|
||||
CREATE PROCEDURE testp_bug11763507()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END
|
||||
$
|
||||
SELECT testf_bug11763507();
|
||||
testf_bug11763507()
|
||||
0
|
||||
SELECT TESTF_bug11763507();
|
||||
TESTF_bug11763507()
|
||||
0
|
||||
SHOW FUNCTION STATUS LIKE 'testf_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW FUNCTION STATUS WHERE NAME='testf_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW FUNCTION STATUS LIKE 'TESTF_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION testf_bug11763507;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507`() RETURNS int(11)
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION TESTF_bug11763507;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507`() RETURNS int(11)
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
CALL testp_bug11763507();
|
||||
PROCEDURE testp_bug11763507
|
||||
PROCEDURE testp_bug11763507
|
||||
CALL TESTP_bug11763507();
|
||||
PROCEDURE testp_bug11763507
|
||||
PROCEDURE testp_bug11763507
|
||||
SHOW PROCEDURE STATUS LIKE 'testp_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW PROCEDURE STATUS WHERE NAME='testp_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW PROCEDURE STATUS LIKE 'TESTP_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
|
||||
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE testp_bug11763507;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug11763507`()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE TESTP_bug11763507;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug11763507`()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
|
||||
specific_name
|
||||
testf_bug11763507
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'TESTF_bug11763507';
|
||||
specific_name
|
||||
testf_bug11763507
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='testf_bug11763507';
|
||||
specific_name
|
||||
testf_bug11763507
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
|
||||
specific_name
|
||||
testf_bug11763507
|
||||
DROP PROCEDURE testp_bug11763507;
|
||||
DROP FUNCTION testf_bug11763507;
|
||||
#END OF BUG#11763507 test.
|
||||
|
@ -888,3 +888,32 @@ Pos Instruction
|
||||
4 jump 6
|
||||
5 error 1339
|
||||
DROP PROCEDURE p1;
|
||||
#
|
||||
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
#
|
||||
SET @@SQL_MODE = '';
|
||||
CREATE FUNCTION testf_bug11763507() RETURNS INT
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END
|
||||
$
|
||||
CREATE PROCEDURE testp_bug11763507()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END
|
||||
$
|
||||
SHOW FUNCTION CODE testf_bug11763507;
|
||||
Pos Instruction
|
||||
0 freturn 3 0
|
||||
SHOW FUNCTION CODE TESTF_bug11763507;
|
||||
Pos Instruction
|
||||
0 freturn 3 0
|
||||
SHOW PROCEDURE CODE testp_bug11763507;
|
||||
Pos Instruction
|
||||
0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
|
||||
SHOW PROCEDURE CODE TESTP_bug11763507;
|
||||
Pos Instruction
|
||||
0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
|
||||
DROP PROCEDURE testp_bug11763507;
|
||||
DROP FUNCTION testf_bug11763507;
|
||||
#END OF BUG#11763507 test.
|
||||
|
@ -227,6 +227,26 @@ ERROR 70100: Query execution was interrupted
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
#
|
||||
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
#
|
||||
SET @@SQL_MODE = '';
|
||||
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
||||
DO SELECT 1 $
|
||||
SHOW EVENTS LIKE 'teste_bug11763507';
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW EVENTS LIKE 'TESTE_bug11763507';
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT teste_bug11763507;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT TESTE_bug11763507;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP EVENT teste_bug11763507;
|
||||
#END OF BUG#11763507 test.
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -527,3 +527,207 @@ SELECT * FROM mysql.columns_priv WHERE Host = 'localhost' AND User LIKE 'user_%P
|
||||
Host Db User Table_name Column_name Timestamp Column_priv
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
#
|
||||
# Test for Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES
|
||||
# IGNORED AND BREAKS REPLICATION
|
||||
#
|
||||
DROP TABLE IF EXISTS test_table;
|
||||
DROP FUNCTION IF EXISTS test_function;
|
||||
CREATE TABLE test_table (c1 CHAR(50));
|
||||
SET @org_mode=@@sql_mode;
|
||||
SET @@sql_mode='';
|
||||
PREPARE insert_stmt FROM 'INSERT INTO test_table VALUES (?)';
|
||||
PREPARE update_stmt FROM 'UPDATE test_table SET c1= ? WHERE c1= ?';
|
||||
CREATE FUNCTION test_function(var CHAR(50)) RETURNS CHAR(50)
|
||||
BEGIN
|
||||
DECLARE char_val CHAR(50);
|
||||
SELECT c1 INTO char_val FROM test_table WHERE c1=var;
|
||||
RETURN char_val;
|
||||
END
|
||||
$
|
||||
SET @var1='abcd\'ef';
|
||||
SET @var2='abcd\"ef';
|
||||
SET @var3='abcd\bef';
|
||||
SET @var4='abcd\nef';
|
||||
SET @var5='abcd\ref';
|
||||
SET @var6='abcd\tef';
|
||||
SET @var7='abcd\\ef';
|
||||
SET @var8='abcd\%ef';
|
||||
SET @var9='abcd\_ef';
|
||||
SET @to_var1='wxyz\'ef';
|
||||
SET @to_var2='wxyz\"ef';
|
||||
SET @to_var3='wxyz\bef';
|
||||
SET @to_var4='wxyz\nef';
|
||||
SET @to_var5='wxyz\ref';
|
||||
SET @to_var6='wxyz\tef';
|
||||
SET @to_var7='wxyz\\ef';
|
||||
SET @to_var8='wxyz\%ef';
|
||||
SET @to_var9='wxyz\_ef';
|
||||
# STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
EXECUTE insert_stmt USING @var1;
|
||||
EXECUTE insert_stmt USING @var2;
|
||||
EXECUTE insert_stmt USING @var3;
|
||||
EXECUTE insert_stmt USING @var4;
|
||||
EXECUTE insert_stmt USING @var5;
|
||||
EXECUTE insert_stmt USING @var6;
|
||||
EXECUTE insert_stmt USING @var7;
|
||||
EXECUTE insert_stmt USING @var8;
|
||||
EXECUTE insert_stmt USING @var9;
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
abcd'ef
|
||||
abcd"ef
|
||||
abcdef
|
||||
abcd
|
||||
ef
|
||||
abcd
|
||||
ef
|
||||
abcd ef
|
||||
abcd\ef
|
||||
abcd\%ef
|
||||
abcd\_ef
|
||||
EXECUTE update_stmt USING @to_var1, @var1;
|
||||
EXECUTE update_stmt USING @to_var2, @var2;
|
||||
EXECUTE update_stmt USING @to_var3, @var3;
|
||||
EXECUTE update_stmt USING @to_var4, @var4;
|
||||
EXECUTE update_stmt USING @to_var5, @var5;
|
||||
EXECUTE update_stmt USING @to_var6, @var6;
|
||||
EXECUTE update_stmt USING @to_var7, @var7;
|
||||
EXECUTE update_stmt USING @to_var8, @var8;
|
||||
EXECUTE update_stmt USING @to_var9, @var9;
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
wxyz'ef
|
||||
wxyz"ef
|
||||
wxyzef
|
||||
wxyz
|
||||
ef
|
||||
wxyz
|
||||
ef
|
||||
wxyz ef
|
||||
wxyz\ef
|
||||
wxyz\%ef
|
||||
wxyz\_ef
|
||||
|
||||
# END OF CASE - STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
# STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
select test_function(@to_var1);
|
||||
test_function(@to_var1)
|
||||
wxyz'ef
|
||||
SELECT test_function(@to_var2);
|
||||
test_function(@to_var2)
|
||||
wxyz"ef
|
||||
SELECT test_function(@to_var3);
|
||||
test_function(@to_var3)
|
||||
wxyzef
|
||||
SELECT test_function(@to_var4);
|
||||
test_function(@to_var4)
|
||||
wxyz
|
||||
ef
|
||||
SELECT test_function(@to_var5);
|
||||
test_function(@to_var5)
|
||||
wxyz
|
||||
ef
|
||||
SELECT test_function(@to_var6);
|
||||
test_function(@to_var6)
|
||||
wxyz ef
|
||||
SELECT test_function(@to_var7);
|
||||
test_function(@to_var7)
|
||||
wxyz\ef
|
||||
SELECT test_function(@to_var8);
|
||||
test_function(@to_var8)
|
||||
wxyz\%ef
|
||||
SELECT test_function(@to_var9);
|
||||
test_function(@to_var9)
|
||||
wxyz\_ef
|
||||
|
||||
# END OF CASE - STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
DELETE FROM test_table;
|
||||
DROP FUNCTION test_function;
|
||||
SET @@sql_mode='NO_BACKSLASH_ESCAPES';
|
||||
CREATE FUNCTION test_function(var CHAR(50)) RETURNS CHAR(50)
|
||||
BEGIN
|
||||
DECLARE char_val CHAR(50);
|
||||
SELECT c1 INTO char_val FROM test_table WHERE c1=var;
|
||||
RETURN char_val;
|
||||
END
|
||||
$
|
||||
# STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
EXECUTE insert_stmt USING @var1;
|
||||
EXECUTE insert_stmt USING @var2;
|
||||
EXECUTE insert_stmt USING @var3;
|
||||
EXECUTE insert_stmt USING @var4;
|
||||
EXECUTE insert_stmt USING @var5;
|
||||
EXECUTE insert_stmt USING @var6;
|
||||
EXECUTE insert_stmt USING @var7;
|
||||
EXECUTE insert_stmt USING @var8;
|
||||
EXECUTE insert_stmt USING @var9;
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
abcd'ef
|
||||
abcd"ef
|
||||
abcdef
|
||||
abcd
|
||||
ef
|
||||
abcd
|
||||
ef
|
||||
abcd ef
|
||||
abcd\ef
|
||||
abcd\%ef
|
||||
abcd\_ef
|
||||
EXECUTE update_stmt USING @to_var1, @var1;
|
||||
EXECUTE update_stmt USING @to_var2, @var2;
|
||||
EXECUTE update_stmt USING @to_var3, @var3;
|
||||
EXECUTE update_stmt USING @to_var4, @var4;
|
||||
EXECUTE update_stmt USING @to_var5, @var5;
|
||||
EXECUTE update_stmt USING @to_var6, @var6;
|
||||
EXECUTE update_stmt USING @to_var7, @var7;
|
||||
EXECUTE update_stmt USING @to_var8, @var8;
|
||||
EXECUTE update_stmt USING @to_var9, @var9;
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
wxyz'ef
|
||||
wxyz"ef
|
||||
wxyzef
|
||||
wxyz
|
||||
ef
|
||||
wxyz
|
||||
ef
|
||||
wxyz ef
|
||||
wxyz\ef
|
||||
wxyz\%ef
|
||||
wxyz\_ef
|
||||
|
||||
# END OF CASE - STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
# STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
select test_function(@to_var1);
|
||||
test_function(@to_var1)
|
||||
wxyz'ef
|
||||
SELECT test_function(@to_var2);
|
||||
test_function(@to_var2)
|
||||
wxyz"ef
|
||||
SELECT test_function(@to_var3);
|
||||
test_function(@to_var3)
|
||||
wxyzef
|
||||
SELECT test_function(@to_var4);
|
||||
test_function(@to_var4)
|
||||
wxyz
|
||||
ef
|
||||
SELECT test_function(@to_var5);
|
||||
test_function(@to_var5)
|
||||
wxyz
|
||||
ef
|
||||
SELECT test_function(@to_var6);
|
||||
test_function(@to_var6)
|
||||
wxyz ef
|
||||
SELECT test_function(@to_var7);
|
||||
test_function(@to_var7)
|
||||
wxyz\ef
|
||||
SELECT test_function(@to_var8);
|
||||
test_function(@to_var8)
|
||||
wxyz\%ef
|
||||
SELECT test_function(@to_var9);
|
||||
test_function(@to_var9)
|
||||
wxyz\_ef
|
||||
|
||||
|
@ -4461,6 +4461,55 @@ ERROR 21000: Subquery returns more than 1 row
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
|
||||
#
|
||||
CREATE TABLE t1(a1 int);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2(a1 int);
|
||||
INSERT INTO t2 VALUES (3);
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2);
|
||||
1
|
||||
1
|
||||
1
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
|
||||
1
|
||||
1
|
||||
1
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
|
||||
1
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
|
||||
1
|
||||
1
|
||||
1
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
|
||||
#
|
||||
create table t2(i int);
|
||||
insert into t2 values(0);
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
CREATE VIEW v1 AS
|
||||
SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2
|
||||
;
|
||||
CREATE TABLE t1 (
|
||||
pk int NOT NULL,
|
||||
col_varchar_key varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY col_varchar_key (col_varchar_key)
|
||||
);
|
||||
SELECT t1.pk
|
||||
FROM t1
|
||||
WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 )
|
||||
;
|
||||
pk
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
drop table t2, t1;
|
||||
drop view v1;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
@ -245,3 +245,63 @@ x
|
||||
NULL
|
||||
drop procedure p1;
|
||||
drop tables t1,t2,t3;
|
||||
#
|
||||
# Bug #11766300 59387: FAILING ASSERTION: CURSOR->POS_STATE == 1997660512 (BTR_PCUR_IS_POSITIONE
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
CREATE TABLE t2 (d BINARY(2), PRIMARY KEY (d(1)), UNIQUE KEY (d)) ENGINE=INNODB;
|
||||
SELECT 1 FROM t1 WHERE NOT EXISTS
|
||||
(SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d);
|
||||
1
|
||||
1
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE NOT EXISTS
|
||||
(SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where
|
||||
2 DEPENDENT SUBQUERY t2 eq_ref PRIMARY,d d 2 func 1 Using where
|
||||
3 DEPENDENT SUBQUERY t2 index NULL d 2 NULL 1 Using where; Using index
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 (b INT, c INT, UNIQUE KEY (b), UNIQUE KEY (b, c )) ENGINE=INNODB;
|
||||
INSERT INTO t2 VALUES (1, 1);
|
||||
SELECT 1 FROM t1
|
||||
WHERE a != (SELECT 1 FROM t2 WHERE a <=> b OR a > '' AND 6 = 7 ORDER BY b, c);
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug #13639204 64111: CRASH ON SELECT SUBQUERY WITH NON UNIQUE
|
||||
# INDEX
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id int
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (id) VALUES (11);
|
||||
CREATE TABLE t2 (
|
||||
t1_id int,
|
||||
position int,
|
||||
KEY t1_id (t1_id),
|
||||
KEY t1_id_position (t1_id,position)
|
||||
) ENGINE=InnoDB;
|
||||
EXPLAIN SELECT
|
||||
(SELECT position FROM t2
|
||||
WHERE t2.t1_id = t1.id
|
||||
ORDER BY t2.t1_id , t2.position
|
||||
LIMIT 10,1
|
||||
) AS maxkey
|
||||
FROM t1
|
||||
LIMIT 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 1
|
||||
2 DEPENDENT SUBQUERY t2 ref t1_id,t1_id_position t1_id_position 5 test.t1.id 1 Using where
|
||||
SELECT
|
||||
(SELECT position FROM t2
|
||||
WHERE t2.t1_id = t1.id
|
||||
ORDER BY t2.t1_id , t2.position
|
||||
LIMIT 10,1
|
||||
) AS maxkey
|
||||
FROM t1
|
||||
LIMIT 1;
|
||||
maxkey
|
||||
NULL
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.1 tests
|
||||
|
@ -38,3 +38,114 @@ DROP VIEW testView;
|
||||
DROP TABLE t1;
|
||||
SET @@global.sql_mode= @old_sql_mode;
|
||||
SET @@session.binlog_format=@old_binlog_format;
|
||||
|
||||
#
|
||||
# Test for Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES
|
||||
# IGNORED AND BREAKS REPLICATION
|
||||
#
|
||||
DROP DATABASE IF EXISTS mysqltest_db;
|
||||
DROP TABLE IF EXISTS test_table;
|
||||
CREATE DATABASE mysqltest_db;
|
||||
USE mysqltest_db;
|
||||
CREATE TABLE test_table (c1 CHAR(50));
|
||||
SET @org_mode=@@sql_mode;
|
||||
SET @@sql_mode='';
|
||||
CREATE PROCEDURE proc_without_sql_mode (IN param1 CHAR(50), IN param2 CHAR(50))
|
||||
BEGIN
|
||||
DECLARE var1 CHAR(50) DEFAULT param1;
|
||||
DECLARE var2 CHAR(50) DEFAULT param2;
|
||||
DECLARE var3 CHAR(50) DEFAULT 'abcd\bef';
|
||||
DECLARE var4 CHAR(50) DEFAULT 'abcd\nef';
|
||||
DECLARE var5 CHAR(50) DEFAULT 'abcd\ref';
|
||||
DECLARE var6 CHAR(50) DEFAULT 'abcd\tef';
|
||||
DECLARE var7 CHAR(50) DEFAULT 'abcd\\ef';
|
||||
DECLARE var8 CHAR(50) DEFAULT 'abcd\%ef';
|
||||
DECLARE var9 CHAR(50) DEFAULT 'abcd\_ef';
|
||||
INSERT INTO test_table VALUES (var1);
|
||||
INSERT INTO test_table VALUES (var2);
|
||||
INSERT INTO test_table VALUES (var3);
|
||||
INSERT INTO test_table VALUES (var4);
|
||||
INSERT INTO test_table VALUES (var5);
|
||||
INSERT INTO test_table VALUES (var6);
|
||||
INSERT INTO test_table VALUES (var7);
|
||||
INSERT INTO test_table VALUES (var8);
|
||||
INSERT INTO test_table VALUES (var9);
|
||||
END
|
||||
$
|
||||
SET @@sql_mode='NO_BACKSLASH_ESCAPES'$
|
||||
CREATE PROCEDURE proc_with_sql_mode (IN param1 CHAR(50), IN param2 CHAR(50))
|
||||
BEGIN
|
||||
DECLARE var1 CHAR(50) DEFAULT param1;
|
||||
DECLARE var2 CHAR(50) DEFAULT param2;
|
||||
DECLARE var3 CHAR(50) DEFAULT 'wxyz\bef';
|
||||
DECLARE var4 CHAR(50) DEFAULT 'wxyz\nef';
|
||||
DECLARE var5 CHAR(50) DEFAULT 'wxyz\ref';
|
||||
DECLARE var6 CHAR(50) DEFAULT 'wxyz\tef';
|
||||
DECLARE var7 CHAR(50) DEFAULT 'wxyz\\ef';
|
||||
DECLARE var8 CHAR(50) DEFAULT 'wxyz\%ef';
|
||||
DECLARE var9 CHAR(50) DEFAULT 'wxyz\_ef';
|
||||
INSERT INTO test_table VALUES (var1);
|
||||
INSERT INTO test_table VALUES (var2);
|
||||
INSERT INTO test_table VALUES (var3);
|
||||
INSERT INTO test_table VALUES (var4);
|
||||
INSERT INTO test_table VALUES (var5);
|
||||
INSERT INTO test_table VALUES (var6);
|
||||
INSERT INTO test_table VALUES (var7);
|
||||
INSERT INTO test_table VALUES (var8);
|
||||
INSERT INTO test_table VALUES (var9);
|
||||
END
|
||||
$
|
||||
SET @@sql_mode='';
|
||||
CALL proc_without_sql_mode('abcd\'ef', 'abcd\"ef');
|
||||
CALL proc_with_sql_mode('wxyz\'ef', 'wxyz\"ef');
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
abcd'ef
|
||||
abcd"ef
|
||||
abcdef
|
||||
abcd
|
||||
ef
|
||||
abcd
|
||||
ef
|
||||
abcd ef
|
||||
abcd\ef
|
||||
abcd\%ef
|
||||
abcd\_ef
|
||||
wxyz'ef
|
||||
wxyz"ef
|
||||
wxyz\bef
|
||||
wxyz\nef
|
||||
wxyz\ref
|
||||
wxyz\tef
|
||||
wxyz\\ef
|
||||
wxyz\%ef
|
||||
wxyz\_ef
|
||||
"Dropping table test_table"
|
||||
DROP TABLE test_table;
|
||||
#"test_table" content after replaying the binlog
|
||||
SELECT * FROM test_table;
|
||||
c1
|
||||
abcd'ef
|
||||
abcd"ef
|
||||
abcdef
|
||||
abcd
|
||||
ef
|
||||
abcd
|
||||
ef
|
||||
abcd ef
|
||||
abcd\ef
|
||||
abcd\%ef
|
||||
abcd\_ef
|
||||
wxyz'ef
|
||||
wxyz"ef
|
||||
wxyz\bef
|
||||
wxyz\nef
|
||||
wxyz\ref
|
||||
wxyz\tef
|
||||
wxyz\\ef
|
||||
wxyz\%ef
|
||||
wxyz\_ef
|
||||
#Clean up
|
||||
DROP DATABASE mysqltest_db;
|
||||
SET @@sql_mode= @org_mode;
|
||||
use test;
|
||||
|
@ -73,3 +73,99 @@ DROP TABLE t1;
|
||||
|
||||
SET @@global.sql_mode= @old_sql_mode;
|
||||
SET @@session.binlog_format=@old_binlog_format;
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # Test for Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES
|
||||
--echo # IGNORED AND BREAKS REPLICATION
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest_db;
|
||||
DROP TABLE IF EXISTS test_table;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE mysqltest_db;
|
||||
USE mysqltest_db;
|
||||
CREATE TABLE test_table (c1 CHAR(50));
|
||||
|
||||
SET @org_mode=@@sql_mode;
|
||||
|
||||
SET @@sql_mode='';
|
||||
DELIMITER $;
|
||||
CREATE PROCEDURE proc_without_sql_mode (IN param1 CHAR(50), IN param2 CHAR(50))
|
||||
BEGIN
|
||||
DECLARE var1 CHAR(50) DEFAULT param1;
|
||||
DECLARE var2 CHAR(50) DEFAULT param2;
|
||||
DECLARE var3 CHAR(50) DEFAULT 'abcd\bef';
|
||||
DECLARE var4 CHAR(50) DEFAULT 'abcd\nef';
|
||||
DECLARE var5 CHAR(50) DEFAULT 'abcd\ref';
|
||||
DECLARE var6 CHAR(50) DEFAULT 'abcd\tef';
|
||||
DECLARE var7 CHAR(50) DEFAULT 'abcd\\ef';
|
||||
DECLARE var8 CHAR(50) DEFAULT 'abcd\%ef';
|
||||
DECLARE var9 CHAR(50) DEFAULT 'abcd\_ef';
|
||||
|
||||
INSERT INTO test_table VALUES (var1);
|
||||
INSERT INTO test_table VALUES (var2);
|
||||
INSERT INTO test_table VALUES (var3);
|
||||
INSERT INTO test_table VALUES (var4);
|
||||
INSERT INTO test_table VALUES (var5);
|
||||
INSERT INTO test_table VALUES (var6);
|
||||
INSERT INTO test_table VALUES (var7);
|
||||
INSERT INTO test_table VALUES (var8);
|
||||
INSERT INTO test_table VALUES (var9);
|
||||
END
|
||||
$
|
||||
|
||||
SET @@sql_mode='NO_BACKSLASH_ESCAPES'$
|
||||
CREATE PROCEDURE proc_with_sql_mode (IN param1 CHAR(50), IN param2 CHAR(50))
|
||||
BEGIN
|
||||
DECLARE var1 CHAR(50) DEFAULT param1;
|
||||
DECLARE var2 CHAR(50) DEFAULT param2;
|
||||
DECLARE var3 CHAR(50) DEFAULT 'wxyz\bef';
|
||||
DECLARE var4 CHAR(50) DEFAULT 'wxyz\nef';
|
||||
DECLARE var5 CHAR(50) DEFAULT 'wxyz\ref';
|
||||
DECLARE var6 CHAR(50) DEFAULT 'wxyz\tef';
|
||||
DECLARE var7 CHAR(50) DEFAULT 'wxyz\\ef';
|
||||
DECLARE var8 CHAR(50) DEFAULT 'wxyz\%ef';
|
||||
DECLARE var9 CHAR(50) DEFAULT 'wxyz\_ef';
|
||||
|
||||
INSERT INTO test_table VALUES (var1);
|
||||
INSERT INTO test_table VALUES (var2);
|
||||
INSERT INTO test_table VALUES (var3);
|
||||
INSERT INTO test_table VALUES (var4);
|
||||
INSERT INTO test_table VALUES (var5);
|
||||
INSERT INTO test_table VALUES (var6);
|
||||
INSERT INTO test_table VALUES (var7);
|
||||
INSERT INTO test_table VALUES (var8);
|
||||
INSERT INTO test_table VALUES (var9);
|
||||
END
|
||||
$
|
||||
|
||||
DELIMITER ;$
|
||||
SET @@sql_mode='';
|
||||
CALL proc_without_sql_mode('abcd\'ef', 'abcd\"ef');
|
||||
CALL proc_with_sql_mode('wxyz\'ef', 'wxyz\"ef');
|
||||
SELECT * FROM test_table;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--exec $MYSQL_BINLOG --force-if-open -d mysqltest_db $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug12601974.binlog
|
||||
|
||||
--echo "Dropping table test_table"
|
||||
DROP TABLE test_table;
|
||||
|
||||
--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug12601974.binlog"
|
||||
|
||||
--echo #"test_table" content after replaying the binlog
|
||||
SELECT * FROM test_table;
|
||||
|
||||
--echo #Clean up
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug12601974.binlog
|
||||
DROP DATABASE mysqltest_db;
|
||||
SET @@sql_mode= @org_mode;
|
||||
use test;
|
||||
|
||||
--echo
|
||||
--echo #End of Test for Bug#12601974
|
||||
|
||||
|
||||
|
6
mysql-test/suite/innodb/r/innodb_bug11766634.result
Normal file
6
mysql-test/suite/innodb/r/innodb_bug11766634.result
Normal file
@ -0,0 +1,6 @@
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
ibdata1 size: 27262976 bytes
|
||||
drop table t1;
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
ibdata1 size: 27262976 bytes
|
||||
drop table t1;
|
45
mysql-test/suite/innodb/r/innodb_bug13635833.result
Normal file
45
mysql-test/suite/innodb/r/innodb_bug13635833.result
Normal file
@ -0,0 +1,45 @@
|
||||
SET DEBUG_SYNC='reset';
|
||||
create table t1 (f1 integer, key k1 (f1)) engine=innodb;
|
||||
create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb;
|
||||
create table t3 (f2 int, key(f2)) engine=innodb;
|
||||
insert into t1 values (10);
|
||||
insert into t2 values (10, 20);
|
||||
insert into t3 values (20);
|
||||
alter table t2 add constraint c1 foreign key (f1)
|
||||
references t1(f1) on update cascade;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
KEY `k1` (`f1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
`f2` int(11) DEFAULT NULL,
|
||||
KEY `f1` (`f1`),
|
||||
KEY `f2` (`f2`),
|
||||
CONSTRAINT `c1` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`f2` int(11) DEFAULT NULL,
|
||||
KEY `f2` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SET DEBUG_SYNC='alter_table_before_rename_result_table
|
||||
SIGNAL update_can_proceed WAIT_FOR dict_unfreeze';
|
||||
alter table t2 add constraint z1 foreign key (f2)
|
||||
references t3(f2) on update cascade;
|
||||
SET DEBUG_SYNC='innodb_row_update_for_mysql_begin
|
||||
WAIT_FOR update_can_proceed';
|
||||
SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze
|
||||
WAIT_FOR foreign_free_cache';
|
||||
update ignore t1 set f1 = 20;
|
||||
ERROR HY000: Error on rename of './test/t2' to '#sql2-temporary' (errno: 181)
|
||||
SET DEBUG_SYNC='now SIGNAL foreign_free_cache';
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
drop table t3;
|
||||
SET DEBUG_SYNC='reset';
|
1
mysql-test/suite/innodb/t/innodb_bug11766634.opt
Normal file
1
mysql-test/suite/innodb/t/innodb_bug11766634.opt
Normal file
@ -0,0 +1 @@
|
||||
--force-restart
|
55
mysql-test/suite/innodb/t/innodb_bug11766634.test
Normal file
55
mysql-test/suite/innodb/t/innodb_bug11766634.test
Normal file
@ -0,0 +1,55 @@
|
||||
# Bug 11766634 59783: InnoDB data grows unexpectedly when inserting,
|
||||
# truncating, inserting the same set of rows.
|
||||
#
|
||||
# Scenario:
|
||||
# create table t1. Insert $recs records. check size of ibdata1.
|
||||
# drop table t1. create table t1. Insert the same set of $recs
|
||||
# records. The size of ibdata1 must not increase.
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
let $MYSQLD_DATADIR=`select @@datadir`;
|
||||
let IBDATA1=$MYSQLD_DATADIR/ibdata1;
|
||||
|
||||
let $recs = 36262;
|
||||
|
||||
--disable_query_log
|
||||
let $c = $recs;
|
||||
start transaction;
|
||||
while ($c)
|
||||
{
|
||||
insert into t1 values ('Hello World');
|
||||
dec $c;
|
||||
}
|
||||
commit work;
|
||||
--enable_query_log
|
||||
|
||||
perl;
|
||||
my $filesize = -s $ENV{'IBDATA1'};
|
||||
print "ibdata1 size: $filesize bytes\n";
|
||||
EOF
|
||||
|
||||
drop table t1;
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
|
||||
--disable_query_log
|
||||
let $c = $recs;
|
||||
start transaction;
|
||||
while ($c)
|
||||
{
|
||||
insert into t1 values ('Hello World');
|
||||
dec $c;
|
||||
}
|
||||
commit work;
|
||||
--enable_query_log
|
||||
|
||||
perl;
|
||||
my $filesize = -s $ENV{'IBDATA1'};
|
||||
print "ibdata1 size: $filesize bytes\n";
|
||||
EOF
|
||||
|
||||
drop table t1;
|
||||
|
64
mysql-test/suite/innodb/t/innodb_bug13635833.test
Normal file
64
mysql-test/suite/innodb/t/innodb_bug13635833.test
Normal file
@ -0,0 +1,64 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
SET DEBUG_SYNC='reset';
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
create table t1 (f1 integer, key k1 (f1)) engine=innodb;
|
||||
create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb;
|
||||
create table t3 (f2 int, key(f2)) engine=innodb;
|
||||
|
||||
insert into t1 values (10);
|
||||
insert into t2 values (10, 20);
|
||||
insert into t3 values (20);
|
||||
|
||||
alter table t2 add constraint c1 foreign key (f1)
|
||||
references t1(f1) on update cascade;
|
||||
|
||||
show create table t1;
|
||||
show create table t2;
|
||||
show create table t3;
|
||||
|
||||
SET DEBUG_SYNC='alter_table_before_rename_result_table
|
||||
SIGNAL update_can_proceed WAIT_FOR dict_unfreeze';
|
||||
|
||||
--send
|
||||
alter table t2 add constraint z1 foreign key (f2)
|
||||
references t3(f2) on update cascade;
|
||||
|
||||
connect (thr2,localhost,root,,);
|
||||
connection thr2;
|
||||
|
||||
SET DEBUG_SYNC='innodb_row_update_for_mysql_begin
|
||||
WAIT_FOR update_can_proceed';
|
||||
SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze
|
||||
WAIT_FOR foreign_free_cache';
|
||||
|
||||
--send
|
||||
update ignore t1 set f1 = 20;
|
||||
|
||||
connection default;
|
||||
--replace_regex /'[^']*test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/
|
||||
--error ER_ERROR_ON_RENAME
|
||||
reap;
|
||||
|
||||
SET DEBUG_SYNC='now SIGNAL foreign_free_cache';
|
||||
|
||||
connection thr2;
|
||||
reap;
|
||||
disconnect thr2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
connection default;
|
||||
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
drop table t3;
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
SET DEBUG_SYNC='reset';
|
@ -0,0 +1,6 @@
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
ibdata1 size: 27262976 bytes
|
||||
drop table t1;
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
ibdata1 size: 27262976 bytes
|
||||
drop table t1;
|
45
mysql-test/suite/innodb_plugin/r/innodb_bug13635833.result
Normal file
45
mysql-test/suite/innodb_plugin/r/innodb_bug13635833.result
Normal file
@ -0,0 +1,45 @@
|
||||
SET DEBUG_SYNC='reset';
|
||||
create table t1 (f1 integer, key k1 (f1)) engine=innodb;
|
||||
create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb;
|
||||
create table t3 (f2 int, key(f2)) engine=innodb;
|
||||
insert into t1 values (10);
|
||||
insert into t2 values (10, 20);
|
||||
insert into t3 values (20);
|
||||
alter table t2 add constraint c1 foreign key (f1)
|
||||
references t1(f1) on update cascade;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
KEY `k1` (`f1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`f1` int(11) DEFAULT NULL,
|
||||
`f2` int(11) DEFAULT NULL,
|
||||
KEY `f1` (`f1`),
|
||||
KEY `f2` (`f2`),
|
||||
CONSTRAINT `c1` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`f2` int(11) DEFAULT NULL,
|
||||
KEY `f2` (`f2`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SET DEBUG_SYNC='alter_table_before_rename_result_table
|
||||
SIGNAL update_can_proceed WAIT_FOR dict_unfreeze';
|
||||
alter table t2 add constraint z1 foreign key (f2)
|
||||
references t3(f2) on update cascade;
|
||||
SET DEBUG_SYNC='innodb_row_update_for_mysql_begin
|
||||
WAIT_FOR update_can_proceed';
|
||||
SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze
|
||||
WAIT_FOR foreign_free_cache';
|
||||
update ignore t1 set f1 = 20;
|
||||
ERROR HY000: Error on rename of './test/t2' to '#sql2-temporary' (errno: 181)
|
||||
SET DEBUG_SYNC='now SIGNAL foreign_free_cache';
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
drop table t3;
|
||||
SET DEBUG_SYNC='reset';
|
1
mysql-test/suite/innodb_plugin/t/innodb_bug11766634.opt
Normal file
1
mysql-test/suite/innodb_plugin/t/innodb_bug11766634.opt
Normal file
@ -0,0 +1 @@
|
||||
--force-restart
|
55
mysql-test/suite/innodb_plugin/t/innodb_bug11766634.test
Normal file
55
mysql-test/suite/innodb_plugin/t/innodb_bug11766634.test
Normal file
@ -0,0 +1,55 @@
|
||||
# Bug 11766634 59783: InnoDB data grows unexpectedly when inserting,
|
||||
# truncating, inserting the same set of rows.
|
||||
#
|
||||
# Scenario:
|
||||
# create table t1. Insert $recs records. check size of ibdata1.
|
||||
# drop table t1. create table t1. Insert the same set of $recs
|
||||
# records. The size of ibdata1 must not increase.
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb_plugin.inc
|
||||
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
let $MYSQLD_DATADIR=`select @@datadir`;
|
||||
let IBDATA1=$MYSQLD_DATADIR/ibdata1;
|
||||
|
||||
let $recs = 36262;
|
||||
|
||||
--disable_query_log
|
||||
let $c = $recs;
|
||||
start transaction;
|
||||
while ($c)
|
||||
{
|
||||
insert into t1 values ('Hello World');
|
||||
dec $c;
|
||||
}
|
||||
commit work;
|
||||
--enable_query_log
|
||||
|
||||
perl;
|
||||
my $filesize = -s $ENV{'IBDATA1'};
|
||||
print "ibdata1 size: $filesize bytes\n";
|
||||
EOF
|
||||
|
||||
drop table t1;
|
||||
create table t1 (f1 char(255)) engine innodb;
|
||||
|
||||
--disable_query_log
|
||||
let $c = $recs;
|
||||
start transaction;
|
||||
while ($c)
|
||||
{
|
||||
insert into t1 values ('Hello World');
|
||||
dec $c;
|
||||
}
|
||||
commit work;
|
||||
--enable_query_log
|
||||
|
||||
perl;
|
||||
my $filesize = -s $ENV{'IBDATA1'};
|
||||
print "ibdata1 size: $filesize bytes\n";
|
||||
EOF
|
||||
|
||||
drop table t1;
|
||||
|
66
mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test
Normal file
66
mysql-test/suite/innodb_plugin/t/innodb_bug13635833.test
Normal file
@ -0,0 +1,66 @@
|
||||
--source include/have_innodb_plugin.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/not_embedded.inc
|
||||
# InnoDB Plugin cannot use DEBUG_SYNC on Windows
|
||||
--source include/not_windows.inc
|
||||
|
||||
SET DEBUG_SYNC='reset';
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
create table t1 (f1 integer, key k1 (f1)) engine=innodb;
|
||||
create table t2 (f1 int, f2 int, key(f1), key(f2)) engine=innodb;
|
||||
create table t3 (f2 int, key(f2)) engine=innodb;
|
||||
|
||||
insert into t1 values (10);
|
||||
insert into t2 values (10, 20);
|
||||
insert into t3 values (20);
|
||||
|
||||
alter table t2 add constraint c1 foreign key (f1)
|
||||
references t1(f1) on update cascade;
|
||||
|
||||
show create table t1;
|
||||
show create table t2;
|
||||
show create table t3;
|
||||
|
||||
SET DEBUG_SYNC='alter_table_before_rename_result_table
|
||||
SIGNAL update_can_proceed WAIT_FOR dict_unfreeze';
|
||||
|
||||
--send
|
||||
alter table t2 add constraint z1 foreign key (f2)
|
||||
references t3(f2) on update cascade;
|
||||
|
||||
connect (thr2,localhost,root,,);
|
||||
connection thr2;
|
||||
|
||||
SET DEBUG_SYNC='innodb_row_update_for_mysql_begin
|
||||
WAIT_FOR update_can_proceed';
|
||||
SET DEBUG_SYNC='innodb_dml_cascade_dict_unfreeze SIGNAL dict_unfreeze
|
||||
WAIT_FOR foreign_free_cache';
|
||||
|
||||
--send
|
||||
update ignore t1 set f1 = 20;
|
||||
|
||||
connection default;
|
||||
--replace_regex /'[^']*test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/
|
||||
--error ER_ERROR_ON_RENAME
|
||||
reap;
|
||||
|
||||
SET DEBUG_SYNC='now SIGNAL foreign_free_cache';
|
||||
|
||||
connection thr2;
|
||||
reap;
|
||||
disconnect thr2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
connection default;
|
||||
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
drop table t3;
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
SET DEBUG_SYNC='reset';
|
@ -8,6 +8,7 @@
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:");
|
||||
call mtr.add_suppression("the age of the last checkpoint is");
|
||||
|
||||
# set packet size and reconnect
|
||||
let $max_packet=`select @@global.max_allowed_packet`;
|
||||
|
5
mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result
Normal file
5
mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result
Normal file
@ -0,0 +1,5 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
include/assert.inc [Assert that relay log space is close to the limit]
|
||||
include/diff_tables.inc [master:test.t1,slave:test.t1]
|
||||
include/rpl_end.inc
|
1
mysql-test/suite/rpl/t/rpl_stm_relay_ign_space-slave.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_stm_relay_ign_space-slave.opt
Normal file
@ -0,0 +1 @@
|
||||
--relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
|
101
mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
Normal file
101
mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test
Normal file
@ -0,0 +1,101 @@
|
||||
#
|
||||
# BUG#12400313 / BUG#64503 test case
|
||||
#
|
||||
#
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# This test case starts the slave server with:
|
||||
# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096
|
||||
#
|
||||
# Then it issues some queries that will cause the slave to reach
|
||||
# relay-log-space-limit. We lock the table so that the SQL thread is
|
||||
# not able to purge the log and then we issue some more statements.
|
||||
#
|
||||
# The purpose is to show that the IO thread will honor the limits
|
||||
# while the SQL thread is not able to purge the relay logs, which did
|
||||
# not happen before this patch. In addition we assert that while
|
||||
# ignoring the limit (SQL thread needs to rotate before purging), the
|
||||
# IO thread does not do it in an uncontrolled manner.
|
||||
|
||||
--source include/have_binlog_format_statement.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
CREATE TABLE t1 (c1 TEXT) engine=InnoDB;
|
||||
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
# wait for the SQL thread to sleep
|
||||
--let $show_statement= SHOW PROCESSLIST
|
||||
--let $field= State
|
||||
--let $condition= = 'Has read all relay log; waiting for the slave I/O thread to update it'
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# now the io thread has set rli->ignore_space_limit
|
||||
# lets lock the table so that once the SQL thread awakes
|
||||
# it blocks there and does not set rli->ignore_space_limit
|
||||
# back to zero
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
# now issue more statements that will overflow the
|
||||
# rli->log_space_limit (in this case ~10K)
|
||||
--connection master
|
||||
|
||||
INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
|
||||
|
||||
--connection slave
|
||||
|
||||
# ASSERT that the IO thread waits for the SQL thread to release some
|
||||
# space before continuing
|
||||
--let $show_statement= SHOW PROCESSLIST
|
||||
--let $field= State
|
||||
--let $condition= LIKE 'Waiting for %'
|
||||
# before the patch (IO would have transfered everything)
|
||||
#--let $condition= = 'Waiting for master to send event'
|
||||
# after the patch (now it waits for space to be freed)
|
||||
#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space'
|
||||
--source include/wait_show_condition.inc
|
||||
|
||||
# without the patch we can uncomment the following two lines and
|
||||
# watch the IO thread synchronize with the master, thus writing
|
||||
# relay logs way over the space limit
|
||||
#--connection master
|
||||
#--source include/sync_slave_io_with_master.inc
|
||||
|
||||
## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge
|
||||
--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1)
|
||||
--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1)
|
||||
--let $assert_text= Assert that relay log space is close to the limit
|
||||
--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15
|
||||
--source include/assert.inc
|
||||
|
||||
# unlock the table and let SQL thread continue applying events
|
||||
UNLOCK TABLES;
|
||||
|
||||
--connection master
|
||||
--sync_slave_with_master
|
||||
--let $diff_tables=master:test.t1,slave:test.t1
|
||||
--source include/diff_tables.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/rpl_end.inc
|
@ -1 +0,0 @@
|
||||
--set-variable=query_cache_size=1M
|
@ -297,4 +297,16 @@ connection default;
|
||||
disconnect newconn;
|
||||
SET @@GLOBAL.max_allowed_packet=default;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13519724 63793: CRASH IN DTCOLLATION::SET(DTCOLLATION &SET)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(50));
|
||||
|
||||
SELECT a FROM t1
|
||||
WHERE CAST(a as BINARY)=x'62736D697468'
|
||||
AND CAST(a AS BINARY)=x'65736D697468';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -67,3 +67,21 @@ SHOW ERRORS;
|
||||
INSERT INTO t1 SELECT b FROM t1;
|
||||
DROP TABLE t1;
|
||||
# End of 5.0 tests
|
||||
|
||||
#
|
||||
# Bug #13031606 VALUES() IN A SELECT STATEMENT CRASHES SERVER
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2(a INT PRIMARY KEY, b INT);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
SELECT '' AS b FROM t1 GROUP BY VALUES(b);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
REPLACE t2(b) SELECT '' AS b FROM t1 GROUP BY VALUES(b);
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
UPDATE t2 SET a=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
INSERT INTO t2 VALUES (1,0) ON DUPLICATE KEY UPDATE
|
||||
b=(SELECT '' AS b FROM t1 GROUP BY VALUES(b));
|
||||
INSERT INTO t2(a,b) VALUES (1,0) ON DUPLICATE KEY UPDATE
|
||||
b=(SELECT VALUES(a)+2 FROM t1);
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -562,4 +562,17 @@ SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
|
||||
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13012483: EXPLAIN EXTENDED, PREPARED STATEMENT, CRASH IN CHECK_SIMPLE_EQUALITY
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
PREPARE s FROM "SELECT 1 FROM t1 WHERE 1 < ALL (SELECT @:= (1 IN (SELECT 1 FROM t1)) FROM t1)";
|
||||
EXECUTE s;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of test BUG#13012483
|
||||
|
||||
--echo #
|
||||
--echo End of 5.1 tests
|
||||
|
@ -812,4 +812,19 @@ CREATE TABLE t3 (
|
||||
# cleanup
|
||||
DROP TABLE t0, t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS
|
||||
--echo #
|
||||
SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
|
||||
|
||||
--echo #
|
||||
--echo # BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN
|
||||
--echo # GEOMETRY FUNCTION ARGUMENTS
|
||||
--echo #
|
||||
--replace_regex /non geometric .* value/non geometric '' value/
|
||||
--error ER_ILLEGAL_VALUE_FOR_TYPE
|
||||
SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -1,6 +1,5 @@
|
||||
# Can't run test of external client with embedded server
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_windows.inc
|
||||
|
||||
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
|
||||
|
||||
@ -37,7 +36,7 @@
|
||||
|
||||
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES";
|
||||
|
||||
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1;
|
||||
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1
|
||||
|
||||
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2
|
||||
|
||||
@ -68,3 +67,9 @@ SHOW DATABASES;
|
||||
SHOW DATABASES;
|
||||
DROP DATABASE bug58090;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #11766072 - 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
|
||||
--echo #
|
||||
|
||||
--replace_regex /queries: [0-9]+.[0-9]+/queries: TIME/
|
||||
--exec $MYSQL_SLAP
|
||||
|
21
mysql-test/t/partition_cache.test
Normal file
21
mysql-test/t/partition_cache.test
Normal file
@ -0,0 +1,21 @@
|
||||
# t/cache_innodb.test
|
||||
#
|
||||
# Last update:
|
||||
# 2006-07-26 ML test refactored (MySQL 5.1)
|
||||
# main code t/innodb_cache.test --> include/query_cache.inc
|
||||
# new wrapper t/cache_innodb.test
|
||||
#
|
||||
|
||||
--source include/have_query_cache.inc
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
let $engine_type= InnoDB;
|
||||
# Using SELECT to get a space as first character.
|
||||
let $partitions_a= `SELECT ' PARTITION BY KEY (a) PARTITIONS 3'`;
|
||||
let $partitions_id= `SELECT ' PARTITION BY HASH (id) PARTITIONS 3'`;
|
||||
let $partitions_s1= `SELECT ' PARTITION BY KEY (s1) PARTITIONS 3'`;
|
||||
# partitioning does not support FOREIGN KEYs
|
||||
let $test_foreign_keys= 0;
|
||||
|
||||
--source include/query_cache.inc
|
@ -138,6 +138,7 @@ DROP FUNCTION db1.f1;
|
||||
DROP TABLE db1.t1;
|
||||
DROP DATABASE db1;
|
||||
DROP DATABASE db2;
|
||||
USE test;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#13105873:valgrind warning:possible crash in foreign
|
||||
@ -161,5 +162,69 @@ CALL p1();
|
||||
--echo # below stmt should not return valgrind warnings
|
||||
CALL p1();
|
||||
DROP DATABASE testdb;
|
||||
USE test;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
--echo #
|
||||
SET @@SQL_MODE = '';
|
||||
DELIMITER $;
|
||||
CREATE FUNCTION testf_bug11763507() RETURNS INT
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END
|
||||
$
|
||||
|
||||
CREATE PROCEDURE testp_bug11763507()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END
|
||||
$
|
||||
|
||||
DELIMITER ;$
|
||||
|
||||
# STORED FUNCTIONS
|
||||
SELECT testf_bug11763507();
|
||||
SELECT TESTF_bug11763507();
|
||||
|
||||
--replace_column 5 # 6 #
|
||||
SHOW FUNCTION STATUS LIKE 'testf_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW FUNCTION STATUS WHERE NAME='testf_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW FUNCTION STATUS LIKE 'TESTF_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
|
||||
|
||||
SHOW CREATE FUNCTION testf_bug11763507;
|
||||
SHOW CREATE FUNCTION TESTF_bug11763507;
|
||||
|
||||
# STORED PROCEDURE
|
||||
CALL testp_bug11763507();
|
||||
CALL TESTP_bug11763507();
|
||||
|
||||
--replace_column 5 # 6 #
|
||||
SHOW PROCEDURE STATUS LIKE 'testp_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW PROCEDURE STATUS WHERE NAME='testp_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW PROCEDURE STATUS LIKE 'TESTP_bug11763507';
|
||||
--replace_column 5 # 6 #
|
||||
SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
|
||||
|
||||
SHOW CREATE PROCEDURE testp_bug11763507;
|
||||
SHOW CREATE PROCEDURE TESTP_bug11763507;
|
||||
|
||||
# INFORMATION SCHEMA
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'TESTF_bug11763507';
|
||||
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='testf_bug11763507';
|
||||
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
|
||||
|
||||
DROP PROCEDURE testp_bug11763507;
|
||||
DROP FUNCTION testf_bug11763507;
|
||||
|
||||
--echo #END OF BUG#11763507 test.
|
||||
|
@ -649,3 +649,35 @@ END//
|
||||
DELIMITER ;//
|
||||
SHOW PROCEDURE CODE p1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
--echo #
|
||||
SET @@SQL_MODE = '';
|
||||
DELIMITER $;
|
||||
CREATE FUNCTION testf_bug11763507() RETURNS INT
|
||||
BEGIN
|
||||
RETURN 0;
|
||||
END
|
||||
$
|
||||
|
||||
CREATE PROCEDURE testp_bug11763507()
|
||||
BEGIN
|
||||
SELECT "PROCEDURE testp_bug11763507";
|
||||
END
|
||||
$
|
||||
|
||||
DELIMITER ;$
|
||||
|
||||
# STORED FUNCTIONS
|
||||
SHOW FUNCTION CODE testf_bug11763507;
|
||||
SHOW FUNCTION CODE TESTF_bug11763507;
|
||||
|
||||
# STORED PROCEDURE
|
||||
SHOW PROCEDURE CODE testp_bug11763507;
|
||||
SHOW PROCEDURE CODE TESTP_bug11763507;
|
||||
|
||||
DROP PROCEDURE testp_bug11763507;
|
||||
DROP FUNCTION testf_bug11763507;
|
||||
|
||||
--echo #END OF BUG#11763507 test.
|
||||
|
@ -403,6 +403,29 @@ DROP FUNCTION f1;
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
|
||||
--echo #
|
||||
SET @@SQL_MODE = '';
|
||||
DELIMITER $;
|
||||
|
||||
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
|
||||
DO SELECT 1 $
|
||||
|
||||
DELIMITER ;$
|
||||
# EVENTS
|
||||
--replace_column 6 # 7 # 8 # 9 #
|
||||
SHOW EVENTS LIKE 'teste_bug11763507';
|
||||
--replace_column 6 # 7 # 8 # 9 #
|
||||
SHOW EVENTS LIKE 'TESTE_bug11763507';
|
||||
|
||||
--replace_column 4 #
|
||||
SHOW CREATE EVENT teste_bug11763507;
|
||||
--replace_column 4 #
|
||||
SHOW CREATE EVENT TESTE_bug11763507;
|
||||
|
||||
DROP EVENT teste_bug11763507;
|
||||
--echo #END OF BUG#11763507 test.
|
||||
|
||||
--echo # ------------------------------------------------------------------
|
||||
--echo # -- End of 5.1 tests
|
||||
|
@ -344,3 +344,157 @@ SELECT * FROM mysql.columns_priv WHERE Host = 'localhost' AND User LIKE 'user_%P
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # Test for Bug#12601974 - STORED PROCEDURE SQL_MODE=NO_BACKSLASH_ESCAPES
|
||||
--echo # IGNORED AND BREAKS REPLICATION
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS test_table;
|
||||
DROP FUNCTION IF EXISTS test_function;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE test_table (c1 CHAR(50));
|
||||
|
||||
SET @org_mode=@@sql_mode;
|
||||
|
||||
SET @@sql_mode='';
|
||||
|
||||
PREPARE insert_stmt FROM 'INSERT INTO test_table VALUES (?)';
|
||||
PREPARE update_stmt FROM 'UPDATE test_table SET c1= ? WHERE c1= ?';
|
||||
DELIMITER $;
|
||||
CREATE FUNCTION test_function(var CHAR(50)) RETURNS CHAR(50)
|
||||
BEGIN
|
||||
DECLARE char_val CHAR(50);
|
||||
SELECT c1 INTO char_val FROM test_table WHERE c1=var;
|
||||
RETURN char_val;
|
||||
END
|
||||
$
|
||||
DELIMITER ;$
|
||||
|
||||
SET @var1='abcd\'ef';
|
||||
SET @var2='abcd\"ef';
|
||||
SET @var3='abcd\bef';
|
||||
SET @var4='abcd\nef';
|
||||
SET @var5='abcd\ref';
|
||||
SET @var6='abcd\tef';
|
||||
SET @var7='abcd\\ef';
|
||||
SET @var8='abcd\%ef';
|
||||
SET @var9='abcd\_ef';
|
||||
|
||||
SET @to_var1='wxyz\'ef';
|
||||
SET @to_var2='wxyz\"ef';
|
||||
SET @to_var3='wxyz\bef';
|
||||
SET @to_var4='wxyz\nef';
|
||||
SET @to_var5='wxyz\ref';
|
||||
SET @to_var6='wxyz\tef';
|
||||
SET @to_var7='wxyz\\ef';
|
||||
SET @to_var8='wxyz\%ef';
|
||||
SET @to_var9='wxyz\_ef';
|
||||
|
||||
--echo # STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
EXECUTE insert_stmt USING @var1;
|
||||
EXECUTE insert_stmt USING @var2;
|
||||
EXECUTE insert_stmt USING @var3;
|
||||
EXECUTE insert_stmt USING @var4;
|
||||
EXECUTE insert_stmt USING @var5;
|
||||
EXECUTE insert_stmt USING @var6;
|
||||
EXECUTE insert_stmt USING @var7;
|
||||
EXECUTE insert_stmt USING @var8;
|
||||
EXECUTE insert_stmt USING @var9;
|
||||
|
||||
SELECT * FROM test_table;
|
||||
|
||||
EXECUTE update_stmt USING @to_var1, @var1;
|
||||
EXECUTE update_stmt USING @to_var2, @var2;
|
||||
EXECUTE update_stmt USING @to_var3, @var3;
|
||||
EXECUTE update_stmt USING @to_var4, @var4;
|
||||
EXECUTE update_stmt USING @to_var5, @var5;
|
||||
EXECUTE update_stmt USING @to_var6, @var6;
|
||||
EXECUTE update_stmt USING @to_var7, @var7;
|
||||
EXECUTE update_stmt USING @to_var8, @var8;
|
||||
EXECUTE update_stmt USING @to_var9, @var9;
|
||||
|
||||
SELECT * FROM test_table;
|
||||
|
||||
--echo
|
||||
--echo # END OF CASE - STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
|
||||
--echo # STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
select test_function(@to_var1);
|
||||
SELECT test_function(@to_var2);
|
||||
SELECT test_function(@to_var3);
|
||||
SELECT test_function(@to_var4);
|
||||
SELECT test_function(@to_var5);
|
||||
SELECT test_function(@to_var6);
|
||||
SELECT test_function(@to_var7);
|
||||
SELECT test_function(@to_var8);
|
||||
SELECT test_function(@to_var9);
|
||||
|
||||
--echo
|
||||
--echo # END OF CASE - STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
DELETE FROM test_table;
|
||||
DROP FUNCTION test_function;
|
||||
|
||||
SET @@sql_mode='NO_BACKSLASH_ESCAPES';
|
||||
DELIMITER $;
|
||||
CREATE FUNCTION test_function(var CHAR(50)) RETURNS CHAR(50)
|
||||
BEGIN
|
||||
DECLARE char_val CHAR(50);
|
||||
SELECT c1 INTO char_val FROM test_table WHERE c1=var;
|
||||
RETURN char_val;
|
||||
END
|
||||
$
|
||||
DELIMITER ;$
|
||||
|
||||
--echo # STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
EXECUTE insert_stmt USING @var1;
|
||||
EXECUTE insert_stmt USING @var2;
|
||||
EXECUTE insert_stmt USING @var3;
|
||||
EXECUTE insert_stmt USING @var4;
|
||||
EXECUTE insert_stmt USING @var5;
|
||||
EXECUTE insert_stmt USING @var6;
|
||||
EXECUTE insert_stmt USING @var7;
|
||||
EXECUTE insert_stmt USING @var8;
|
||||
EXECUTE insert_stmt USING @var9;
|
||||
|
||||
SELECT * FROM test_table;
|
||||
|
||||
EXECUTE update_stmt USING @to_var1, @var1;
|
||||
EXECUTE update_stmt USING @to_var2, @var2;
|
||||
EXECUTE update_stmt USING @to_var3, @var3;
|
||||
EXECUTE update_stmt USING @to_var4, @var4;
|
||||
EXECUTE update_stmt USING @to_var5, @var5;
|
||||
EXECUTE update_stmt USING @to_var6, @var6;
|
||||
EXECUTE update_stmt USING @to_var7, @var7;
|
||||
EXECUTE update_stmt USING @to_var8, @var8;
|
||||
EXECUTE update_stmt USING @to_var9, @var9;
|
||||
|
||||
SELECT * FROM test_table;
|
||||
|
||||
--echo
|
||||
--echo # END OF CASE - STRING LILTERAL WITH BACKSLASH IN PREPARE STATEMENT
|
||||
|
||||
--echo # STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
select test_function(@to_var1);
|
||||
SELECT test_function(@to_var2);
|
||||
SELECT test_function(@to_var3);
|
||||
SELECT test_function(@to_var4);
|
||||
SELECT test_function(@to_var5);
|
||||
SELECT test_function(@to_var6);
|
||||
SELECT test_function(@to_var7);
|
||||
SELECT test_function(@to_var8);
|
||||
SELECT test_function(@to_var9);
|
||||
|
||||
--echo
|
||||
--echo # END OF CASE - STRING LILTERAL WITH BACKSLASH IN FUNCTION RETURNING STRING
|
||||
|
||||
DROP TABLE test_table;
|
||||
DROP FUNCTION test_function;
|
||||
SET @@sql_mode= @org_mode;
|
||||
|
||||
--echo
|
||||
--echo #End of Test for Bug#12601974
|
||||
|
@ -3433,6 +3433,61 @@ SET SESSION sql_mode=@old_sql_mode;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a1 int);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
CREATE TABLE t2(a1 int);
|
||||
INSERT INTO t2 VALUES (3);
|
||||
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
## All these are subject to the transformation
|
||||
## '1 < some (...)' => '1 < max(...)'
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2);
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
|
||||
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
|
||||
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
|
||||
--echo #
|
||||
|
||||
create table t2(i int);
|
||||
insert into t2 values(0);
|
||||
|
||||
SELECT @@session.sql_mode INTO @old_sql_mode;
|
||||
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
|
||||
|
||||
CREATE VIEW v1 AS
|
||||
SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2
|
||||
;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk int NOT NULL,
|
||||
col_varchar_key varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY col_varchar_key (col_varchar_key)
|
||||
);
|
||||
|
||||
SELECT t1.pk
|
||||
FROM t1
|
||||
WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 )
|
||||
;
|
||||
|
||||
SET SESSION sql_mode=@old_sql_mode;
|
||||
|
||||
drop table t2, t1;
|
||||
drop view v1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
@ -238,3 +238,59 @@ call p1();
|
||||
call p1();
|
||||
drop procedure p1;
|
||||
drop tables t1,t2,t3;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #11766300 59387: FAILING ASSERTION: CURSOR->POS_STATE == 1997660512 (BTR_PCUR_IS_POSITIONE
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
CREATE TABLE t2 (d BINARY(2), PRIMARY KEY (d(1)), UNIQUE KEY (d)) ENGINE=INNODB;
|
||||
|
||||
SELECT 1 FROM t1 WHERE NOT EXISTS
|
||||
(SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d);
|
||||
|
||||
EXPLAIN SELECT 1 FROM t1 WHERE NOT EXISTS
|
||||
(SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d);
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
CREATE TABLE t2 (b INT, c INT, UNIQUE KEY (b), UNIQUE KEY (b, c )) ENGINE=INNODB;
|
||||
INSERT INTO t2 VALUES (1, 1);
|
||||
|
||||
SELECT 1 FROM t1
|
||||
WHERE a != (SELECT 1 FROM t2 WHERE a <=> b OR a > '' AND 6 = 7 ORDER BY b, c);
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #13639204 64111: CRASH ON SELECT SUBQUERY WITH NON UNIQUE
|
||||
--echo # INDEX
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id int
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO t1 (id) VALUES (11);
|
||||
|
||||
CREATE TABLE t2 (
|
||||
t1_id int,
|
||||
position int,
|
||||
KEY t1_id (t1_id),
|
||||
KEY t1_id_position (t1_id,position)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
let $query=SELECT
|
||||
(SELECT position FROM t2
|
||||
WHERE t2.t1_id = t1.id
|
||||
ORDER BY t2.t1_id , t2.position
|
||||
LIMIT 10,1
|
||||
) AS maxkey
|
||||
FROM t1
|
||||
LIMIT 1;
|
||||
|
||||
eval EXPLAIN $query;
|
||||
eval $query;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user