-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error subquery returns more than 1 row for insert on dup #10151
Labels
challenge-program
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Comments
Confirming this still exists in master: DROP TABLE IF EXISTS t1, t11, t2;
CREATE TABLE t1(a INTEGER);
CREATE TABLE t11(a INTEGER primary key);
CREATE TABLE t2(b INTEGER);
INSERT INTO t2 VALUES (1),(1);
INSERT INTO t1(a) VALUES (1)
ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
..
mysql> INSERT INTO t1(a) VALUES (1)
-> ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
mysql>
mysql> INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-750-g8a661044c
Edition: Community
Git Commit Hash: 8a661044cedf8daad1de4fbf79a390962b6f6c3b
Git Branch: master
UTC Build Time: 2020-07-10 10:52:37
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
lzmhhh123
added
challenge-program
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
labels
Oct 30, 2020
Closed
/assign |
should fixed by #29270 |
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
challenge-program
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
CREATE TABLE t1(a INTEGER);
CREATE TABLE t11(a INTEGER primary key);
CREATE TABLE t2(b INTEGER);
INSERT INTO t2 VALUES (1),(1);
INSERT INTO t1(a) VALUES (1)
ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
DROP TABLE t1, t2;
What did you expect to see
MySQL behavior:
for inserting into t1
INSERT INTO t1(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
Query OK, 1 row affected (0.01 sec)
INSERT INTO t1(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
Query OK, 1 row affected (0.01 sec)
for inserting into t11
INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
Query OK, 1 row affected (0.02 sec)
INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
TiDB behvaior:
for inserting into t1
mysql> INSERT INTO t1(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
mysql> INSERT INTO t1(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
for inserting into t11
mysql> INSERT INTO t11(a) VALUES (1) ON DUPLICATE KEY UPDATE a= (SELECT b FROM t2);
ERROR 1105 (HY000): subquery returns more than 1 row
Create issue (#10151) from GitHub user jackysp at 16:26 PM, April 15 2019
SIG slack channel
#sig-planner
Score
Mentor
The text was updated successfully, but these errors were encountered: