diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 22:47:29 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-02-28 22:47:29 +0100 |
commit | 213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a (patch) | |
tree | 79e9a941a078d73ce85da0241871a863fa4eca38 /mysql-test/t/multi_update.test | |
parent | cfa94b4338b5dd5578436df0402b2f2210de3eaa (diff) | |
parent | c4341d50950224bb4e976fd1aac23dddc7d78f71 (diff) | |
download | mariadb-git-213f1c76a038ad0e6111cd5eb6b0da9b4b9dc45a.tar.gz |
5.3->5.5 merge
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r-- | mysql-test/t/multi_update.test | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 48735304aad..e0a35ca2bb9 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -696,6 +696,55 @@ DROP FUNCTION f1; DROP TABLE t1; --echo # +--echo # MDEV-4123: Incorrect results after multi-table update or +--echo # assertion `!table || (!table->read_set || +--echo # bitmap_is_set(table->read_set, field_index))' failure +--echo # + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + id int(10) unsigned NOT NULL, + level tinyint(3) unsigned NOT NULL, + PRIMARY KEY (id) +); +INSERT INTO t1 VALUES (2519583,1); + +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 ( + club_id int(11) NOT NULL DEFAULT '0', + profile_id int(11) NOT NULL DEFAULT '0', + member_level_id int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (profile_id,club_id) +); +INSERT INTO t2 VALUES (2,2519583,12); + +DROP TABLE IF EXISTS t3; +CREATE TABLE t3 ( + member_level_id int(11) unsigned NOT NULL DEFAULT '0', + map_level int(11) unsigned NOT NULL DEFAULT '0', + map_status int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (member_level_id) +); +INSERT INTO t3 VALUES (12,12,1); + +CREATE + VIEW v1 AS + select club_id,profile_id, + map_level AS member_level_id,map_status AS member_status + from (t2 tc join t3 map + on(((tc.member_level_id = map.member_level_id) and + (club_id = 2)))); + +select level, count(*) as cnt from t1 group by level; +UPDATE t1 c LEFT JOIN v1 t ON (c.id = t.profile_id AND t.club_id = 2) + SET c.level = IF (t.member_status IS NULL, 1, IF (t.member_status = 1, 2,3)); +select level, count(*) as cnt from t1 group by level; +drop view v1; +drop table t1,t2,t3; + +--echo end of tests + +--echo # --echo # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a --echo # table is updated twice --echo # @@ -759,6 +808,5 @@ SELECT * FROM t2; DROP TABLE t1,t2; - - +--echo end of 5.5 tests |