585
585
UPDATE t2,t1 SET t2.a=t1.a+2;
587
587
select * from t2 /* must be (3,1), (4,4) */;
588
show master status /* there must be the UPDATE query event */;
588
let wait_binlog_event= UPDATE;
589
source include/wait_for_binlog_event.inc;
590
591
# B. testing multi_update::send_error() ineffective update
591
592
# (as there is a policy described at mysql_update() still go to binlog)
597
598
--error ER_DUP_ENTRY
598
599
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
599
show master status /* there must be the UPDATE query event */;
600
let wait_binlog_event= UPDATE;
601
source include/wait_for_binlog_event.inc;
602
604
drop table t1, t2;
637
639
# Add further tests from here
643
--echo # Bug#49534: multitable IGNORE update with sql_safe_updates error
644
--echo # causes debug assertion
646
CREATE TABLE t1( a INT, KEY( a ) );
647
INSERT INTO t1 VALUES (1), (2), (3);
648
SET SESSION sql_safe_updates = 1;
649
--echo # Must not cause failed assertion
650
--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
651
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
655
--echo # Bug#54543: update ignore with incorrect subquery leads to assertion
656
--echo # failure: inited==INDEX
658
SET SESSION sql_safe_updates = 0;
659
CREATE TABLE t1 ( a INT );
660
INSERT INTO t1 VALUES (1), (2);
662
CREATE TABLE t2 ( a INT );
663
INSERT INTO t2 VALUES (1), (2);
665
CREATE TABLE t3 ( a INT );
666
INSERT INTO t3 VALUES (1), (2);
668
--echo # Should not crash
670
( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
673
DROP TABLE t1, t2, t3;
674
SET SESSION sql_safe_updates = DEFAULT;
677
--echo # Bug#52157 various crashes and assertions with multi-table update, stored function
680
CREATE FUNCTION f1 () RETURNS BLOB RETURN 1;
681
CREATE TABLE t1 (f1 DATE);
682
INSERT INTO t1 VALUES('2001-01-01');
683
UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1;
641
687
--echo end of tests