diff options
Diffstat (limited to 'mysql-test/r/update_innodb.result')
-rw-r--r-- | mysql-test/r/update_innodb.result | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result index 6dae6abebb1..0a85c6dab3e 100644 --- a/mysql-test/r/update_innodb.result +++ b/mysql-test/r/update_innodb.result @@ -39,3 +39,29 @@ DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 ); DELETE FROM v1 WHERE (a,a) IN ( SELECT a,a FROM t2 ); drop view v1; drop table t1,t2; +# +# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt +# +CREATE TABLE t1 ( +a_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +b_id INT(20) UNSIGNED NULL DEFAULT NULL, +c_id VARCHAR(255) NULL DEFAULT NULL, +PRIMARY KEY (a_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; +CREATE TABLE t2 ( +b_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +c_id VARCHAR(255) NULL DEFAULT NULL, +PRIMARY KEY (b_id), +INDEX idx_c_id (c_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; +INSERT INTO t1 (b_id, c_id) VALUES (NULL, NULL); +INSERT INTO t2 (c_id) VALUES (NULL); +INSERT INTO t2 (c_id) VALUES (NULL); +SELECT * FROM t1; +a_id b_id c_id +1 NULL NULL +SELECT t2.b_id FROM t1,t2 WHERE t2.c_id = t1.c_id; +b_id +UPDATE t1 SET b_id = (SELECT t2.b_id FROM t2 t2 WHERE t2.c_id = t1.c_id); +SELECT * FROM t1; +a_id b_id c_id +1 NULL NULL +drop table t1,t2; |