Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.4, 5.5.33a, 5.3.13
-
None
-
None
Description
EXECUTE stmt;
|
( SELECT MIN(a) FROM t1 )
|
1
|
EXECUTE stmt;
|
( SELECT MIN(a) FROM t1 )
|
1
|
1
|
One row is the expected result.
==8635== Invalid read of size 1
|
==8635== at 0x5DF3D0: Item_maxmin_subselect::any_value() (item_subselect.h:321)
|
==8635== by 0x5CA2E2: Item_func_not_all::empty_underlying_subquery() (item_cmpfunc.cc:378)
|
==8635== by 0x5CA23D: Item_func_not_all::val_int() (item_cmpfunc.cc:367)
|
==8635== by 0x730A5A: evaluate_join_record(JOIN*, st_join_table*, int) (sql_select.cc:16251)
|
==8635== by 0x73064B: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:16155)
|
==8635== by 0x72FE28: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.cc:15816)
|
==8635== by 0x70FC2F: JOIN::exec() (sql_select.cc:2779)
|
==8635== by 0x7104BA: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3000)
|
==8635== by 0x706EC8: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:288)
|
==8635== by 0x69308D: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5172)
|
==8635== by 0x689E55: mysql_execute_command(THD*) (sql_parse.cc:2305)
|
==8635== by 0x76736E: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3758)
|
==8635== by 0x766566: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3439)
|
==8635== by 0x76499E: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2664)
|
==8635== by 0x689E86: mysql_execute_command(THD*) (sql_parse.cc:2314)
|
==8635== by 0x695B17: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6173)
|
==8635== Address 0xf854cc9 is 2,105 bytes inside a block of size 8,168 free'd
|
==8635== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
|
==8635== by 0xB7609A: _myfree (safemalloc.c:337)
|
==8635== by 0xB752F8: free_root (my_alloc.c:366)
|
==8635== by 0x688A99: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1661)
|
==8635== by 0x6867E3: do_command(THD*) (sql_parse.cc:923)
|
==8635== by 0x68367D: handle_one_connection (sql_connect.cc:1231)
|
==8635== by 0x548DE99: start_thread (pthread_create.c:308)
|
==8635== by 0x5F9ACBC: clone (clone.S:112)
|
Stack trace from
bzr version-info
|
revision-id: igor@askmonty.org-20131004165107-0hdknrn9111ojupx
|
revno: 3701
|
branch-nick: 5.3
|
built with BUILD/compile-pentium-debug-max-no-ndb
Test case:
CREATE TABLE t1 (a INT) ENGINE=MyISAM; |
INSERT INTO t1 VALUES (1),(2); |
|
CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM; |
INSERT INTO t2 VALUES (0),(8); |
|
PREPARE stmt FROM ' |
SELECT ( SELECT MIN(a) FROM t1 ) FROM t2 AS outer_t2
|
WHERE outer_t2.b >= ALL (
|
SELECT t2_alias2.b FROM t2 AS t2_alias1 LEFT JOIN t2 AS t2_alias2 ON ( t2_alias2.b = t2_alias1.b )
|
WHERE t2_alias1.b <= t2_alias2.b
|
)
|
'; |
|
EXECUTE stmt; |
EXECUTE stmt; |