Assertion failure or valgrind errors at best_access_path with firstmatch + materialization + semijoin + semijoin_with_cache, GROUP BY
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Committed
|
Medium
|
Sergey Petrunia |
Bug Description
==28721== Thread 4:
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x8360467: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x8360493: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x836051F: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x8360B75: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x8360B85: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
==28721== Conditional jump or move depends on uninitialised value(s)
==28721== at 0x8360BFD: best_access_
==28721== by 0x8424C43: fix_semijoin_
==28721== by 0x8363D66: get_best_
==28721== by 0x835C0DC: make_join_
==28721== by 0x8353BF8: JOIN::optimize() (sql_select.
==28721== by 0x8359B2B: 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_
==28721== by 0x8351776: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:285)
==28721== by 0x82EC6B8: execute_
==28721== by 0x82E3A94: mysql_execute_
==28721== by 0x82EECF3: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==28721== by 0x82E16D4: dispatch_
==28721== by 0x82E0B7E: do_command(THD*) (sql_parse.cc:923)
==28721== by 0x82DDA74: handle_
==28721== by 0x40C9B24: start_thread (in /lib/libpthread
==28721== by 0x42F538D: clone (in /lib/libc-
With a more complicated test case it turns into an assertion failure:
sql_select.cc:5451: void best_access_
bzr version-info
revision-id: <email address hidden>
date: 2012-05-08 20:58:41 +0300
revno: 3519
Also reproducible on maria/5.5 revno 3397.
Minimal optimizer_switch: firstmatch=
Full optimizer_switch: index_merge=
EXPLAIN:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY B system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
1 PRIMARY alias1 ref a1 a1 6 const 1 100.00 Using where; Using index
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2 100.00 Using where
1 PRIMARY A ref a1 a1 6 test.alias1.a2 100 100.00 Using where; Using index; FirstMatch(
1 PRIMARY alias2 index a1 a1 44 NULL 100 75.00 Using where; Using index; Using join buffer (flat, BNL join)
3 MATERIALIZED C index PRIMARY PRIMARY 23 NULL 2 100.00 Using index
Warnings:
Note 1003 select `test`.
# Test case:
SET optimizer_
CREATE TABLE A (a1 VARCHAR(3), a2 VARCHAR(35), KEY(a1,a2)) ENGINE=MyISAM;
INSERT INTO A VALUES
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
('USA',
CREATE TABLE C (c1 VARCHAR(3), c2 VARCHAR(16), PRIMARY KEY (c1,c2)) ENGINE=MyISAM;
INSERT INTO C VALUES ('USA','Chinese'), ('USA','English');
# Not reproducible with 2 rows
CREATE TABLE B (b1 INT) ENGINE=MyISAM;
INSERT INTO B VALUES (1);
SELECT alias1.a1 AS field1
FROM A AS alias1, A AS alias2
WHERE alias1.a2 IN ( SELECT a1 FROM A, B )
AND alias1.a1 IS NULL
AND ( alias1.a1, alias2.a1 ) IN ( SELECT c1, c1 FROM C )
GROUP BY field1;
# End of test case
Changed in maria: | |
assignee: | Igor Babaev (igorb-seattle) → Sergey Petrunia (sergefp) |
Changed in maria: | |
status: | New → Confirmed |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |