Skip to content

Commit d83107b

Browse files
author
Mattias Jonsson
committed
WL#4443:
Manual merge into latest mysql-trunk. also fixed the HA_OPEN_NO_PSI_CALL check.
2 parents fe4508e + 0503c5d commit d83107b

101 files changed

Lines changed: 11325 additions & 2269 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/my_base.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
#define HA_OPEN_COPY 256 /* Open copy (for repair) */
4949
/* Internal temp table, used for temporary results */
5050
#define HA_OPEN_INTERNAL_TABLE 512
51+
/**
52+
Don't connect any share_psi to the handler, since it is a partition.
53+
It would not be used, since partitions don't call unbind_psi()/rebind_psi().
54+
*/
55+
#define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */
5156

5257
/* The following is parameter to ha_rkey() how to use key */
5358

include/my_bitmap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
5555
extern uint bitmap_set_next(MY_BITMAP *map);
5656
extern uint bitmap_get_first(const MY_BITMAP *map);
5757
extern uint bitmap_get_first_set(const MY_BITMAP *map);
58+
extern uint bitmap_get_next_set(const MY_BITMAP *map, uint bitmap_bit);
5859
extern uint bitmap_bits_set(const MY_BITMAP *map);
5960
extern void bitmap_free(MY_BITMAP *map);
6061
extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit);

include/my_time.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ void my_init_time(void);
180180
estimate.
181181
182182
RETURN VALUES
183-
FALSE The value seems sane
184-
TRUE The MYSQL_TIME value is definitely out of range
183+
TRUE The value seems sane
184+
FALSE The MYSQL_TIME value is definitely out of range
185185
*/
186186

187187
static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Default suites in modes normal, binlog format mixed/row,embedded and ps-protocol
2+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug --vardir=var-normal-debug --report-features --skip-test-list=collections/disabled-daily.list --unit-tests
3+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix-debug --vardir=var-n_mix-debug --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list
4+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row-debug --vardir=var-row-debug --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list
5+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row-debug --vardir=var-ps_row-debug --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list
6+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded-debug --vardir=var-embedded-debug --embedded
7+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps-debug --vardir=var-ps-debug --ps-protocol --skip-test-list=collections/disabled-daily.list
8+
9+
# From default.push
10+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --suite=main,sys_vars,binlog,federated,rpl,innodb,innodb_fts,perfschema,funcs_1,opt_trace,parts --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --unit-tests
11+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=main-parts_ps_row --vardir=var-main-ps_row --suite=main,parts --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
12+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=main-parts_embedded --vardir=var-main_emebbed --suite=main,parts --embedded --experimental=collections/default.experimental --skip-ndb
13+
# Partition specific
14+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --suite=parts --comment=parts-n_mix-debug --vardir=var-n_mix-debug --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list
15+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --suite=parts --comment=parts-row-debug --vardir=var-row-debug --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list
16+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --suite=parts --comment=parts-ps_row-debug --vardir=var-ps_row-debug --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list
17+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --suite=parts --comment=parts-embedded-debug --vardir=var-embedded-debug --embedded
18+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --suite=parts --comment=parts-ps-debug --vardir=var-ps-debug --ps-protocol --skip-test-list=collections/disabled-daily.list
19+
20+
# Run the suites that are not part of the default - funcs_2, parts, stress, jp, nist
21+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2-debug --vardir=var-funcs2-debug --suite=funcs_2
22+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions-debug --vardir=var-parts-debug --suite=parts
23+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress-debug --vardir=var-stress-debug --suite=stress
24+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp-debug --vardir=var-jp-debug --suite=jp
25+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist-debug --vardir=var-nist-debug --suite=nist
26+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps-debug --vardir=var-ps_nist-debug --suite=nist --ps-protocol
27+
28+
# Additional modes for rpl and binlog suites. Checksum and relay-log-info-repository
29+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_checksum-debug --vardir=var-rpl_binlog_checksum-debug --suite=rpl,binlog --mysqld=--binlog-checksum=CRC32 --skip-test-list=collections/disabled-daily.list
30+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=rpl_crash_safe_relay-debug --vardir=var-rpl_crash_safe_relay-debug --suite=rpl --mysqld=--relay-log-info-repository=TABLE --skip-test-list=collections/disabled-daily.list
31+
#perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=rpl_crash_safe_master-debug --vardir=var-rpl_crash_safe_master-debug --suite=rpl --mysqld=--master-info-repository=TABLE --skip-test-list=collections/disabled-daily.list
32+
33+
# Additional modes for rpl. Multi-Threaded Slave
34+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_n_mix_MTS --vardir=var-mts-rpl-binlog-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --unit-tests --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl,parts
35+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_ps_row_MTS --vardir=var-mts-rpl-binlog-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl,parts
36+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_stmt_MTS --vardir=var-mts-rpl-binlog-stmt --mysqld=--binlog-format=statement --experimental=collections/default.experimental --skip-ndb --mysqld=--slave-parallel-workers=4 --mysqld=--slave-transaction-retries=0 --suite=rpl,parts
37+
38+
# Additional runs for innodb-page-size=4k and 8k
39+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix_4k_size --vardir=var-n_mix --suite=main,sys_vars,binlog,federated,rpl,innodb,innodb_fts,perfschema,funcs_1,opt_trace,parts --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=4k --skip-test=innodb_ignore_builtin
40+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix_8k_size --vardir=var-n_mix --suite=main,sys_vars,binlog,federated,rpl,innodb,innodb_fts,perfschema,funcs_1,opt_trace,parts --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --mysqld=--innodb-page-size=8k --skip-test=innodb_ignore_builtin
41+
42+
#Engine independent tests
43+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine-debug --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine-debug --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list
44+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine-debug --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine-debug --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list
45+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine-debug --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine-debug --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list
46+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine-debug --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine-debug --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list
47+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine-debug --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine-debug --suite=engines/iuds,engines/funcs --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-daily.list
48+
#perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine-debug --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine-debug --suite=engines/iuds,engines/funcs --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-daily.list
49+
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-tests-innodb-engine-debug --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine-debug --suite=engines/iuds,engines/funcs --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-daily.list

mysql-test/include/commit.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ call p_verify_status_increment(4, 4, 4, 4);
750750
--echo #
751751
--echo # Sic: no table is created.
752752
create table if not exists t2 (a int) select 6 union select 7;
753-
--echo # Sic: first commits the statement, and then the transaction.
754-
call p_verify_status_increment(2, 0, 2, 0);
753+
--echo # No table are locked before existing t2 is found, so nothing to commit.
754+
call p_verify_status_increment(0, 0, 0, 0);
755755
create table t3 select a from t2;
756756
call p_verify_status_increment(2, 0, 4, 4);
757757
alter table t3 add column (b int);
@@ -763,7 +763,7 @@ call p_verify_status_increment(0, 0, 0, 0);
763763
truncate table t3;
764764
call p_verify_status_increment(2, 0, 2, 0);
765765
create view v1 as select * from t2;
766-
call p_verify_status_increment(2, 0, 2, 0);
766+
call p_verify_status_increment(0, 0, 0, 0);
767767
check table t1;
768768
call p_verify_status_increment(2, 0, 2, 0);
769769
--echo # Sic: after this bug is fixed, CHECK leaves no pending transaction

mysql-test/include/grant_cache.inc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
#
33
# Test grants with query cache
44
#
5-
# Last update:
6-
# 2007-05-03 ML - Move t/grant_cache.test to include/grant_cache.inc
7-
# - Remove the disabling of the ps-protocol
8-
# - minor improvements like error names instead of numbers
9-
# - Create two toplevel tests sourcing this routine
5+
# Now normal protocol and ps-protocol produces the same result.
6+
# (After splitting open and lock tables into different stages,
7+
# to be able to prune locks of individual partitions.)
108
#
9+
# Before this change, the below was true:
1110
# Running this test with and without "--ps-protocol" produces different
1211
# Qcache_not_cached results because of the following reason:
1312
# In normal protocol, a SELECT failing due to insufficient privileges

mysql-test/include/handler.inc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,10 @@ DROP TABLE t1;
18441844
--echo # Bug#13008220 HANDLER SQL STATEMENT CAN MISS TO INITIALIZE
18451845
--echo # FOR RANDOM READ
18461846
--echo #
1847+
--echo # A handler can only have one active 'cursor' at a time,
1848+
--echo # so switching between index and/or random should restart the cursor.
18471849

1848-
CREATE TABLE t1(a INT, b INT, KEY b(b));
1850+
CREATE TABLE t1(a INT, b INT, KEY b(b), KEY ab(a, b));
18491851
INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
18501852
HANDLER t1 OPEN;
18511853
HANDLER t1 READ b FIRST;
@@ -1868,5 +1870,13 @@ HANDLER t1 READ b NEXT;
18681870
HANDLER t1 READ b NEXT;
18691871
HANDLER t1 READ NEXT;
18701872
HANDLER t1 READ b NEXT;
1873+
HANDLER t1 READ FIRST;
1874+
HANDLER t1 READ b PREV;
1875+
HANDLER t1 READ b LAST;
1876+
HANDLER t1 READ NEXT;
1877+
HANDLER t1 READ ab FIRST;
1878+
HANDLER t1 READ b NEXT;
1879+
HANDLER t1 READ ab LAST;
1880+
HANDLER t1 READ b PREV;
18711881
HANDLER t1 CLOSE;
18721882
DROP TABLE t1;
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Help file for avoid duplicated tests of different DEFAULT functions
2+
#
3+
# Needs $get_handler_status_counts defined
4+
# normally as:
5+
# let $get_handler_status_counts=
6+
# SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
7+
# WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
8+
#
9+
# And a table t3 where a is a DATETIME/DATE/TIME/TIMESTAMP column
10+
# and b is a char/varchar() column.
11+
12+
if ($null_as_now)
13+
{
14+
FLUSH STATUS;
15+
SET TIMESTAMP = 1234567890;
16+
INSERT INTO t3 (a) VALUES (NULL);
17+
eval $get_handler_status_counts;
18+
--echo # 4 locks (1 table, 1 partition lock/unlock)
19+
}
20+
FLUSH STATUS;
21+
SET TIMESTAMP = 1234567891;
22+
INSERT INTO t3 VALUES ();
23+
eval $get_handler_status_counts;
24+
--echo # 4 locks (1 table, 1 partition lock/unlock)
25+
FLUSH STATUS;
26+
INSERT INTO t3 (a) VALUES ('2011-01-01 00:00:00');
27+
eval $get_handler_status_counts;
28+
--echo # 4 locks (1 table, 1 partition lock/unlock)
29+
FLUSH STATUS;
30+
INSERT INTO t3 (a) VALUES ('2011-01-01 00:00:01');
31+
eval $get_handler_status_counts;
32+
--echo # 4 locks (1 table, 1 partition lock/unlock)
33+
FLUSH STATUS;
34+
INSERT INTO t3 (a) VALUES ('2011-01-01 00:00:02'), ('2011-01-01 00:00:03');
35+
eval $get_handler_status_counts;
36+
--echo # 6 locks (1 table, 2 partition lock/unlock)
37+
--echo # 2 writes
38+
FLUSH STATUS;
39+
SET TIMESTAMP = 1234567892;
40+
INSERT INTO t3 (a) VALUES ('2011-01-01 00:00:00')
41+
ON DUPLICATE KEY UPDATE b = "DUP_KEY";
42+
eval $get_handler_status_counts;
43+
if ($default_update)
44+
{
45+
--echo # 8 locks (1 table, 3 partition lock/unlock)
46+
--echo # No pruning due to DEFAULT function on partitioning column
47+
--echo # 1 read_key + 1 delete + 2 write (1 failed + 1 ok)
48+
--echo # 1 delete + 1 write due to moved to different partition
49+
}
50+
if (!$default_update)
51+
{
52+
--echo # 4 locks (1 table, 1 partition lock/unlock)
53+
--echo # 1 read_key + 1 update (same partition)
54+
--echo # 1 (failed) write
55+
}
56+
FLUSH STATUS;
57+
INSERT INTO t3 (a) VALUES ('2011-01-01 00:00:01')
58+
ON DUPLICATE KEY UPDATE a = '2011-01-01 00:00:05', b = "DUP_KEY2";
59+
eval $get_handler_status_counts;
60+
--echo # 8 locks (1 table, 3 partition lock/unlock)
61+
--echo # No pruning due to updating partitioning field.
62+
--echo # 1 read_key + 1 delete + 2 write (1 failed + 1 ok)
63+
--echo # 1 delete + 1 write due to moved to different partition
64+
FLUSH STATUS;
65+
SET TIMESTAMP = 1234567893;
66+
UPDATE t3 SET b = 'Updated' WHERE a = '2011-01-01 00:00:02';
67+
eval $get_handler_status_counts;
68+
if ($default_update)
69+
{
70+
--echo # 8 locks (1 table, 3 partition lock/unlock)
71+
--echo # No pruning due to DEFAULT function on partitioning column
72+
--echo # 2 read_key + 1 read_rnd (1 read_key due to index lookup,
73+
--echo # 1 read_rnd + 1 read_key due to positioning before update)
74+
--echo # 1 delete + 1 write due to moved to different partition
75+
--echo # + 1 (failed) write
76+
}
77+
if (!$default_update)
78+
{
79+
--echo # 4 locks (1 table, 1 partition lock/unlock)
80+
--echo # 1 read_key + 1 update (same partition)
81+
--echo # 1 (failed) write
82+
}
83+
FLUSH STATUS;
84+
REPLACE INTO t3 VALUES ('2011-01-01 00:00:04', 'Replace1');
85+
eval $get_handler_status_counts;
86+
--echo # 4 locks (1 table, 1 partition lock/unlock)
87+
FLUSH STATUS;
88+
REPLACE INTO t3 VALUES ('2011-01-01 00:00:04', 'Replace2');
89+
eval $get_handler_status_counts;
90+
--echo # 4 locks (1 table, 1 partition lock/unlock)
91+
--echo # 1 read_key + 1 update + 1 failed write
92+
93+
--echo #
94+
--echo # Test of replace of default PK (delete might be needed first)
95+
--echo #
96+
DELETE FROM t3 WHERE a = 0;
97+
FLUSH STATUS;
98+
SET TIMESTAMP = 1234567894;
99+
REPLACE INTO t3 (b) VALUES ('Replace3');
100+
eval $get_handler_status_counts;
101+
--echo # 4 locks (1 table, 1 partition lock/unlock)
102+
FLUSH STATUS;
103+
SET TIMESTAMP = 1234567894;
104+
REPLACE INTO t3 (b) VALUES ('Replace4');
105+
eval $get_handler_status_counts;
106+
--echo # 4 locks (1 table, 1 partition lock/unlock)
107+
--echo # 1 read_key + 1 update + 1 failed write
108+
--sorted_result
109+
SELECT * FROM t3;

mysql-test/r/commit_1innodb.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,8 @@ SUCCESS
827827
create table if not exists t2 (a int) select 6 union select 7;
828828
Warnings:
829829
Note 1050 Table 't2' already exists
830-
# Sic: first commits the statement, and then the transaction.
831-
call p_verify_status_increment(2, 0, 2, 0);
830+
# No table are locked before existing t2 is found, so nothing to commit.
831+
call p_verify_status_increment(0, 0, 0, 0);
832832
SUCCESS
833833

834834
create table t3 select a from t2;
@@ -852,7 +852,7 @@ call p_verify_status_increment(2, 0, 2, 0);
852852
SUCCESS
853853

854854
create view v1 as select * from t2;
855-
call p_verify_status_increment(2, 0, 2, 0);
855+
call p_verify_status_increment(0, 0, 0, 0);
856856
SUCCESS
857857

858858
check table t1;

mysql-test/r/explain.result

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,15 @@ PREPARE s FROM
477477
'EXPLAIN EXTENDED
478478
SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
479479
FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
480+
# After WL#4443 we don't evaluate subqueries during prepare, so no error.
480481
EXECUTE s;
481-
ERROR 21000: Subquery returns more than 1 row
482+
id select_type table type possible_keys key key_len ref rows filtered Extra
483+
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
484+
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
485+
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 NULL
486+
2 SUBQUERY a1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (Block Nested Loop)
487+
Warnings:
488+
Note 1003 /* select#1 */ select substr(1,(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `a1` on(0) where 1)) AS `d` from `test`.`t1` where <nop>(<in_optimizer>(0,<exists>(/* select#3 */ select 1 from `test`.`t1` where 1 having 0)))
482489
DEALLOCATE PREPARE s;
483490
DROP TABLE t1;
484491
#

0 commit comments

Comments
 (0)