Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.5
-
None
Description
in main/derived_view.test:
Testcase for BUG#968720:
CREATE TABLE t1 (a int, INDEX(a)); |
INSERT INTO t1 VALUES (1); |
|
CREATE TABLE t2 (a int, INDEX(a)); |
INSERT INTO t2 VALUES (1), (2); |
|
INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN |
t2 AS s2; |
SELECT * FROM t1; |
|
DELETE FROM t1; |
INSERT INTO t1 VALUES (1); |
then
PREPARE stmt FROM " |
INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
|
t2 AS s2;
|
"; |
EXECUTE stmt; |
SELECT * FROM t1; |
a
|
1
|
1
|
Makes sense, one row was there and one got inserted.
Then it runs the same again:
EXECUTE stmt; |
SELECT * FROM t1; |
a
|
1
|
1
|
Wrong. Why still two rows? It should have inserted two more.
(To be verified: and I get that when trying with InnoDB tables. It's only MyISAM? Not sure why.)
Attachments
Issue Links
- duplicates
-
MDEV-32086 Server crash when inserting from derived table containing insert target table
-
- Closed
-
- relates to
-
MDEV-28257 Wrong results in derived_view.test for reexuction of statement
-
- Stalled
-