mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
a587ded283
in queries like create view v1 as select 2 like 1 escape (3 in (select 0 union select 1)); select 2 union select * from v1; Item_func_like::escape was left uninitialized, because Item_in_optimizer is const_during_execution() but not actually const_item() during execution. It's not, because const subquery evaluation was disabled for derived. Practically it only needs to be disabled for multi-update that runs fix_fields() before all tables are locked.
39 lines
1.5 KiB
Text
39 lines
1.5 KiB
Text
--source include/have_innodb.inc
|
|
|
|
#
|
|
# Test multi update with different join methods
|
|
#
|
|
|
|
CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
|
CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb;
|
|
INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
|
|
INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
|
|
|
|
# Full join, without key
|
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100;
|
|
select * from bug38999_1;
|
|
|
|
# unique key
|
|
update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101;
|
|
select * from bug38999_1;
|
|
|
|
# ref key
|
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2;
|
|
select * from bug38999_1;
|
|
|
|
# Range key (in bug38999_1)
|
|
update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100;
|
|
select * from bug38999_1;
|
|
select * from bug38999_2;
|
|
|
|
drop table bug38999_1,bug38999_2;
|
|
|
|
--echo #
|
|
--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb
|
|
--echo #
|
|
CREATE TABLE t1(f1 INT) ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES(1);
|
|
--error ER_OPERAND_COLUMNS
|
|
UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1;
|
|
UPDATE (SELECT ((SELECT 1 FROM t1),1) = (1,1) FROM t1 WHERE (SELECT 1 FROM t1)) x, t1 AS d SET d.f1 = 1;
|
|
DROP TABLE t1;
|