==11844== 3 errors in context 3 of 5: ==11844== Thread 10: ==11844== Invalid read of size 1 ==11844== at 0x8159E1C: Item_field::print(String*, enum_query_type) (item.cc:5677) ==11844== by 0x813A11B: st_select_lex::print_order(String*, st_order*, enum_query_type) (sql_lex.cc:2042) ==11844== by 0x8270982: st_select_lex::print(THD*, String*, enum_query_type) (sql_select.cc:16694) ==11844== by 0x813A258: st_select_lex_unit::print(String*, enum_query_type) (sql_lex.cc:2010) ==11844== by 0x8270221: TABLE_LIST::print(THD*, String*, enum_query_type) (sql_select.cc:16547) ==11844== by 0x82705A1: print_join(THD*, String*, List*, enum_query_type) (sql_select.cc:16465) ==11844== by 0x82700C4: TABLE_LIST::print(THD*, String*, enum_query_type) (sql_select.cc:16524) ==11844== by 0x8270513: print_join(THD*, String*, List*, enum_query_type) (sql_select.cc:16450) ==11844== by 0x82708B6: st_select_lex::print(THD*, String*, enum_query_type) (sql_select.cc:16666) ==11844== by 0x813A258: st_select_lex_unit::print(String*, enum_query_type) (sql_lex.cc:2010) ==11844== by 0x8206B79: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4996) ==11844== by 0x8210B34: mysql_execute_command(THD*) (sql_parse.cc:2207) ==11844== Address 0x7B6A067 is 1,583 bytes inside a block of size 2,992 free'd ==11844== at 0x400501A: free (vg_replace_malloc.c:233) ==11844== by 0x84F7931: my_no_flags_free (my_malloc.c:59) ==11844== by 0x84F81E3: free_root (my_alloc.c:349) ==11844== by 0x8260E4A: free_tmp_table(THD*, st_table*) (sql_select.cc:10632) ==11844== by 0x8276266: JOIN::destroy() (sql_select.cc:2260) ==11844== by 0x8276200: JOIN::destroy() (sql_select.cc:2246) ==11844== by 0x836CE20: st_select_lex::cleanup() (sql_union.cc:779) ==11844== by 0x836D00B: st_select_lex_unit::cleanup() (sql_union.cc:645) ==11844== by 0x836CEB5: st_select_lex::cleanup() (sql_union.cc:786) ==11844== by 0x82832F4: mysql_select(THD*, Item***, TABLE_LIST*, unsigned, List&, Item*, unsigned, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2410) ==11844== by 0x82835F8: mysql_explain_union(THD*, st_select_lex_unit*, select_result*) (sql_select.cc:16419) ==11844== by 0x8206B1E: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4990) ==11844== ==11844== 3 errors in context 4 of 5: ==11844== Invalid read of size 4 ==11844== at 0x8159E19: Item_field::print(String*, enum_query_type) (item.cc:5677) ==11844== by 0x813A11B: st_select_lex::print_order(String*, st_order*, enum_query_type) (sql_lex.cc:2042) ==11844== by 0x8270982: st_select_lex::print(THD*, String*, enum_query_type) (sql_select.cc:16694) ==11844== by 0x813A258: st_select_lex_unit::print(String*, enum_query_type) (sql_lex.cc:2010) ==11844== by 0x8270221: TABLE_LIST::print(THD*, String*, enum_query_type) (sql_select.cc:16547) ==11844== by 0x82705A1: print_join(THD*, String*, List*, enum_query_type) (sql_select.cc:16465) ==11844== by 0x82700C4: TABLE_LIST::print(THD*, String*, enum_query_type) (sql_select.cc:16524) ==11844== by 0x8270513: print_join(THD*, String*, List*, enum_query_type) (sql_select.cc:16450) ==11844== by 0x82708B6: st_select_lex::print(THD*, String*, enum_query_type) (sql_select.cc:16666) ==11844== by 0x813A258: st_select_lex_unit::print(String*, enum_query_type) (sql_lex.cc:2010) ==11844== by 0x8206B79: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4996) ==11844== by 0x8210B34: mysql_execute_command(THD*) (sql_parse.cc:2207) ==11844== Address 0x7B7904C is 220 bytes inside a block of size 996 free'd ==11844== at 0x400501A: free (vg_replace_malloc.c:233) ==11844== by 0x84F7931: my_no_flags_free (my_malloc.c:59) ==11844== by 0x84F8200: free_root (my_alloc.c:355) ==11844== by 0x8260E4A: free_tmp_table(THD*, st_table*) (sql_select.cc:10632) ==11844== by 0x8276266: JOIN::destroy() (sql_select.cc:2260) ==11844== by 0x8276200: JOIN::destroy() (sql_select.cc:2246) ==11844== by 0x836CE20: st_select_lex::cleanup() (sql_union.cc:779) ==11844== by 0x836D00B: st_select_lex_unit::cleanup() (sql_union.cc:645) ==11844== by 0x836CEB5: st_select_lex::cleanup() (sql_union.cc:786) ==11844== by 0x82832F4: mysql_select(THD*, Item***, TABLE_LIST*, unsigned, List&, Item*, unsigned, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:2410) ==11844== by 0x82835F8: mysql_explain_union(THD*, st_select_lex_unit*, select_result*) (sql_select.cc:16419) ==11844== by 0x8206B1E: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4990) killing this query at specific point in time caused the errors: explain extended select distinctrow `d_31591_3_105774`.`col1` from ( select distinct `qa02_22090_1_73503`.`c6` from qa02 as qa02_22090_1_73503 natural left outer join ( select `qa02_3347_2_10688`.`c5`, `qa02_3347_2_10688`.`c3` from qa02 as qa02_3347_2_10688 right join qa03 as qa03_3347_0_10686 on qa02_3347_2_10688.c4 < qa03_3347_0_10686.c2 group by `qa02_3347_2_10688`.`c5`, `qa02_3347_2_10688`.`c1` with rollup limit 3 lock in share mode ) as d_22090_0_73502 group by `qa02_22090_1_73503`.`c6` with rollup limit 3 for update ) as d_31591_3_105774 natural join ( select distinctrow 1 from qa04 as qa04_2788_3_8916 natural right join v1 as v1_2788_2_8915 group by `qa04_2788_3_8916`.`c1`, `qa04_2788_3_8916`.`c4`, `qa04_2788_3_8916`.`c1` with rollup limit 3 ) as d_31591_0_105771 group by `d_31591_0_105771`.`col1` with rollup limit 3 lock in share mode; mysql> show create view v1\G *************************** 1. row *************************** View: v1 Create View: CREATE ALGORITHM=UNDEFINED DEFINER=``@`` SQL SECURITY DEFINER VIEW `v1` AS select distinct 1 AS `1` from (`qa03` `qa03_31468_0_105344` left join `qa05` `qa05_31468_4_105348` on(((`qa05_31468_4_105348`.`c1` = `qa03_31468_0_105344`.`c1`) and (`qa05_31468_4_105348`.`c2` = `qa03_31468_0_105344`.`c2`)))) group by `qa03_31468_0_105344`.`c1` with rollup limit 3 character_set_client: latin1 collation_connection: latin1_swedish_ci 1 row in set (0.06 sec) other tables are in gypsy's qa.sql file. mysql> show table status; +------+--------+---------+------------+-------+----------------+-------------+----- | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_ +------+--------+---------+------------+-------+----------------+-------------+----- | qa00 | InnoDB | 10 | Compact | 20 | 819 | 16384 | | qa01 | InnoDB | 10 | Compact | 10 | 1638 | 16384 | | qa02 | InnoDB | 10 | Compact | 0 | 0 | 16384 | | qa03 | InnoDB | 10 | Compact | 96 | 170 | 16384 | | qa04 | InnoDB | 10 | Compact | 1186 | 55 | 65536 | | qa05 | InnoDB | 10 | Compact | 10 | 1638 | 16384 | | qa06 | InnoDB | 10 | Compact | 0 | 0 | 16384 | | qa07 | InnoDB | 10 | Compact | 185 | 218305 | 40386560 | | t1 | MyISAM | 10 | Dynamic | 24876 | 27 | 677256 | 2814 | v | NULL | NULL | NULL | NULL | NULL | NULL | | v1 | NULL | NULL | NULL | NULL | NULL | NULL | +------+--------+---------+------------+-------+----------------+-------------+----- 11 rows in set (0.73 sec)