mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed error handling to be able do not interrupt update (907) (SCRUM)
fixed bug of current select pointer in subselect execution fixed layuot mysql-test/r/subselect.result: test of update with IGNORE option and error in subselect mysql-test/t/subselect.test: test of update with IGNORE option and error in subselect sql/item_subselect.cc: fixed bug of current select pointer sql/mysqld.cc: error converting to warnings if hd->lex.current_select->no_error id true layout fixed sql/sql_lex.cc: initialization sql/sql_lex.h: flag which force converting errors to warnings sql/sql_select.cc: switch on error convering to warnings in select executing if IGNORE option present
This commit is contained in:
@ -1151,3 +1151,16 @@ INSERT INTO t1 VALUES (1,0,NULL,NULL),(2,0,NULL,NULL);
|
||||
SELECT DISTINCT REF_ID FROM t1 WHERE ID= (SELECT DISTINCT REF_ID FROM t1 WHERE ID=2);
|
||||
REF_ID
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
insert into t1 values (1,0), (2,0), (3,0);
|
||||
insert into t2 values (1,1), (2,1), (3,1), (2,2);
|
||||
update ignore t1 set b=(select b from t2 where t1.a=t2.a);
|
||||
Warnings:
|
||||
Error 1240 Subselect returns more than 1 record
|
||||
select * from t1;
|
||||
a b
|
||||
1 1
|
||||
2 NULL
|
||||
3 1
|
||||
drop table t1, t2;
|
||||
|
@ -732,3 +732,17 @@ CREATE TABLE t1 (
|
||||
INSERT INTO t1 VALUES (1,0,NULL,NULL),(2,0,NULL,NULL);
|
||||
SELECT DISTINCT REF_ID FROM t1 WHERE ID= (SELECT DISTINCT REF_ID FROM t1 WHERE ID=2);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# uninterruptable update
|
||||
#
|
||||
create table t1 (a int, b int);
|
||||
create table t2 (a int, b int);
|
||||
|
||||
insert into t1 values (1,0), (2,0), (3,0);
|
||||
insert into t2 values (1,1), (2,1), (3,1), (2,2);
|
||||
|
||||
update ignore t1 set b=(select b from t2 where t1.a=t2.a);
|
||||
select * from t1;
|
||||
|
||||
drop table t1, t2;
|
||||
|
Reference in New Issue
Block a user