You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed Item according to second reviewers comments.
(checking can_be_evaluated_now in const_item)
Also fixed a bug found by first reviewer:
INSERT INTO t VALUES ((subselect)) evaluated selects before
locking.
Copy file name to clipboardExpand all lines: mysql-test/r/partition_locking.result
+82-1
Original file line number
Diff line number
Diff line change
@@ -3364,7 +3364,88 @@ DROP TABLE t1;
3364
3364
# Test of subqueries in INSERT
3365
3365
#
3366
3366
CREATE TABLE t1 (a INT, b VARCHAR(64));
3367
+
CREATE TABLE t2 (a INT, b VARCHAR(64)) PARTITION BY HASH (a) PARTITIONS 3;
3367
3368
INSERT INTO t1 VALUES (1, "test 1");
3368
-
INSERT INTO t1 VALUES (SELECT * FROM t1);
3369
+
INSERT INTO t2 VALUES (SELECT * FROM t1);
3369
3370
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM t1)' at line 1
3371
+
FLUSH STATUS;
3372
+
INSERT INTO t2 VALUES ((SELECT a FROM t1), (SELECT b FROM t1));
3373
+
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
3374
+
WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
3375
+
VARIABLE_NAME VARIABLE_VALUE
3376
+
HANDLER_COMMIT 1
3377
+
HANDLER_EXTERNAL_LOCK 12
3378
+
HANDLER_READ_FIRST 2
3379
+
HANDLER_READ_KEY 2
3380
+
HANDLER_READ_RND_NEXT 4
3381
+
HANDLER_WRITE 18
3382
+
# 12 locks (3 tables + 3 partitions) x lock/unlock
3383
+
# I.e. No lock pruning possible
3384
+
DROP TABLE t1, t2;
3385
+
CREATE TABLE t1 (a INT, b INT);
3386
+
CREATE TABLE t2 (a INT, b INT) PARTITION BY HASH (a) PARTITIONS 3;
0 commit comments