mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge from mysql-5.1.63-release
This commit is contained in:
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
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';
|
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';
|
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';
|
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';
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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