Valgrind warnings in mark_as_null_row with materialization+semijoin, STRAIGHT_JOIN, impossible WHERE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Sergey Petrunia |
Bug Description
==25752== Thread 5:
==25752== Invalid write of size 1
==25752== at 0x832D957: mark_as_
==25752== by 0x836A845: return_
==25752== by 0x8356936: JOIN::exec() (sql_select.
==25752== by 0x83590D0: 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_
==25752== by 0x8350DEA: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:284)
==25752== by 0x82EC2BC: execute_
==25752== by 0x82E3698: mysql_execute_
==25752== by 0x82EE8F7: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==25752== by 0x82E12D8: dispatch_
==25752== by 0x82E0782: do_command(THD*) (sql_parse.cc:923)
==25752== by 0x82DD708: handle_
==25752== by 0x40C9B24: start_thread (in /lib/libpthread
==25752== by 0x42F534D: clone (in /lib/libc-
==25752== Address 0x59d0220 is 1,680 bytes inside a block of size 2,956 free'd
==25752== at 0x4026996: free (in /usr/lib/
==25752== by 0x87C2E73: _myfree (safemalloc.c:337)
==25752== by 0x87C21D0: free_root (my_alloc.c:366)
==25752== by 0x8373FB5: free_tmp_
==25752== by 0x836906A: st_join_
==25752== by 0x8369A70: JOIN::cleanup(bool) (sql_select.
==25752== by 0x836979C: JOIN::join_free() (sql_select.
==25752== by 0x836A819: return_
==25752== by 0x8356936: JOIN::exec() (sql_select.
==25752== by 0x83590D0: 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_
==25752== by 0x8350DEA: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:284)
==25752== by 0x82EC2BC: execute_
==25752== by 0x82E3698: mysql_execute_
==25752== by 0x82EE8F7: mysql_parse(THD*, char*, unsigned int, char const**) (sql_parse.cc:6152)
==25752== by 0x82E12D8: dispatch_
==25752== by 0x82E0782: do_command(THD*) (sql_parse.cc:923)
==25752==
==25752== Invalid read of size 4
==25752== at 0x832D961: mark_as_
==25752== by 0x836A845: return_
,,,
==25752== Invalid read of size 4
==25752== at 0x832D978: mark_as_
==25752== by 0x836A845: return_
...
==25752== Invalid write of size 1
==25752== at 0x4028C78: memset (in /usr/lib/
==25752== by 0x832D99C: mark_as_
==25752== by 0x836A845: return_
...
stack trace from bzr version-info
revision-id: <email address hidden>
date: 2012-02-01 17:48:45 -0800
build-date: 2012-02-02 20:40:47 +0400
revno: 3405
Also reproducible on current revno 3421.
EXPLAIN:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> system NULL NULL NULL NULL 1 100.00
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 select straight_join min(`test`
Full optimizer_switch: index_merge=
Minimal optimizer_switch: materialization
Test case:
SET optimizer_
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (0),(8);
SELECT STRAIGHT_JOIN MIN(a) FROM t1
WHERE a IN (
SELECT a FROM t1
WHERE 'condition'
);
Changed in maria: | |
status: | New → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Fix released with 5.3.5-ga.