~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/t/multi_update.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
585
585
UPDATE t2,t1 SET t2.a=t1.a+2;
586
586
# check
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;
589
590
 
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)
596
597
reset master;
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;
600
602
 
601
603
# cleanup
602
604
drop table t1, t2;
637
639
# Add further tests from here
638
640
#
639
641
 
 
642
--echo #
 
643
--echo # Bug#49534: multitable IGNORE update with sql_safe_updates error
 
644
--echo # causes debug assertion
 
645
--echo #
 
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;
 
652
DROP TABLE t1;
 
653
 
 
654
--echo #
 
655
--echo # Bug#54543: update ignore with incorrect subquery leads to assertion
 
656
--echo # failure: inited==INDEX
 
657
--echo #
 
658
SET SESSION sql_safe_updates = 0;
 
659
CREATE TABLE t1 ( a INT );
 
660
INSERT INTO t1 VALUES (1), (2);
 
661
 
 
662
CREATE TABLE t2 ( a INT );
 
663
INSERT INTO t2 VALUES (1), (2);
 
664
 
 
665
CREATE TABLE t3 ( a INT );
 
666
INSERT INTO t3 VALUES (1), (2);
 
667
 
 
668
--echo # Should not crash
 
669
UPDATE IGNORE
 
670
  ( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
 
671
SET t3.a = 0;
 
672
 
 
673
DROP TABLE t1, t2, t3;
 
674
SET SESSION sql_safe_updates = DEFAULT;
 
675
 
 
676
--echo #
 
677
--echo # Bug#52157 various crashes and assertions with multi-table update, stored function
 
678
--echo #
 
679
 
 
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;
 
684
DROP FUNCTION f1;
 
685
DROP TABLE t1;
640
686
 
641
687
--echo end of tests