Description:
select_jcl6 fails after merging the 6.0-main into 6.0-bugteam. There are few new tests that were merged from 5.x into this file that may have caused the failure.
Here's a dump of the valgrind reports:
==2070== Thread 15:
==2070== Invalid write of size 4
==2070== at 0x6D5A2C: Field::fill_cache_field(st_cache_field*) (field.cc:1740)
==2070== by 0x76F594: add_table_data_fields_to_join_cache(st_join_table*, st_bitmap*, unsigned int*, st_cac
he_field**, st_cache_field***) (sql_join_cache.cc:117)
==2070== by 0x76F70C: JOIN_CACHE::create_remaining_fields(bool) (sql_join_cache.cc:347)
==2070== by 0x76F839: JOIN_CACHE_BNL::init() (sql_join_cache.cc:486)
==2070== by 0x79379D: check_join_cache_usage(st_join_table*, JOIN*, unsigned long long, unsigned int) (sql_
select.cc:9902)
==2070== by 0x7BC815: make_join_readinfo(JOIN*, unsigned long long, unsigned int) (sql_select.cc:10112)
==2070== by 0x7BEBEB: JOIN::optimize() (sql_select.cc:1918)
==2070== by 0x7C20C5: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned i
nt, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select
_lex*) (sql_select.cc:3038)
==2070== by 0x7C78FC: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:314)
==2070== by 0x724DD5: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4747)
==2070== by 0x7267C6: mysql_execute_command(THD*) (sql_parse.cc:2062)
==2070== by 0x72EACC: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:5735)
==2070== by 0x72F680: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1007)
==2070== by 0x730B2F: do_command(THD*) (sql_parse.cc:690)
==2070== by 0x71DBAC: handle_one_connection (sql_connect.cc:1145)
==2070== by 0x31230073D9: start_thread (in /lib64/libpthread-2.9.so)
==2070== Address 0x60d71f0 is 0 bytes after a block of size 192 alloc'd
==2070== at 0x4A0764E: malloc (vg_replace_malloc.c:207)
==2070== by 0xD3581C: my_malloc (my_malloc.c:34)
==2070== by 0xD4392D: alloc_root (my_alloc.c:158)
==2070== by 0x6AD358: sql_alloc(unsigned long) (thr_malloc.cc:65)
==2070== by 0x76F2A6: JOIN_CACHE::alloc_fields(unsigned int) (sql_join_cache.cc:211)
==2070== by 0x76F802: JOIN_CACHE_BNL::init() (sql_join_cache.cc:481)
==2070== by 0x79379D: check_join_cache_usage(st_join_table*, JOIN*, unsigned long long, unsigned int) (sql_
select.cc:9902)
==2070== by 0x7BC815: make_join_readinfo(JOIN*, unsigned long long, unsigned int) (sql_select.cc:10112)
==2070== by 0x7BEBEB: JOIN::optimize() (sql_select.cc:1918)
==2070== by 0x7C20C5: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned i
nt, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select
_lex*) (sql_select.cc:3038)
==2070== by 0x7C78FC: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:314)
==2070== by 0x724DD5: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4747)
==2070== by 0x7267C6: mysql_execute_command(THD*) (sql_parse.cc:2062)
==2070== by 0x72EACC: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:5735)
==2070== by 0x72F680: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1007)
==2070== by 0x730B2F: do_command(THD*) (sql_parse.cc:690)
==2070== Invalid write of size 8
==2070== at 0x6D5A37: Field::fill_cache_field(st_cache_field*) (field.cc:1741)
==2070== by 0x76F594: add_table_data_fields_to_join_cache(st_join_table*, st_bitmap*, unsigned int*, st_cac
he_field**, st_cache_field***) (sql_join_cache.cc:117)
==2070== by 0x76F70C: JOIN_CACHE::create_remaining_fields(bool) (sql_join_cache.cc:347)
==2070== by 0x76F839: JOIN_CACHE_BNL::init() (sql_join_cache.cc:486)
==2070== by 0x79379D: check_join_cache_usage(st_join_table*, JOIN*, unsigned long long, unsigned int) (sql_
select.cc:9902)
==2070== by 0x7BC815: make_join_readinfo(JOIN*, unsigned long long, unsigned int) (sql_select.cc:10112)
==2070== by 0x7BEBEB: JOIN::optimize() (sql_select.cc:1918)
==2070== by 0x7C20C5: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned i
nt, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select
_lex*) (sql_select.cc:3038)
==2070== by 0x7C78FC: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:314)
==2070== by 0x724DD5: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4747)
==2070== by 0x7267C6: mysql_execute_command(THD*) (sql_parse.cc:2062)
==2070== by 0x72EACC: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:5735)
==2070== by 0x72F680: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1007)
==2070== by 0x730B2F: do_command(THD*) (sql_parse.cc:690)
==2070== by 0x71DBAC: handle_one_connection (sql_connect.cc:1145)
==2070== by 0x31230073D9: start_thread (in /lib64/libpthread-2.9.so)
==2070== Address 0x60d71f8 is 8 bytes after a block of size 192 alloc'd
==2070== at 0x4A0764E: malloc (vg_replace_malloc.c:207)
==2070== by 0xD3581C: my_malloc (my_malloc.c:34)
==2070== by 0xD4392D: alloc_root (my_alloc.c:158)
==2070== by 0x6AD358: sql_alloc(unsigned long) (thr_malloc.cc:65)
==2070== by 0x76F2A6: JOIN_CACHE::alloc_fields(unsigned int) (sql_join_cache.cc:211)
==2070== by 0x76F802: JOIN_CACHE_BNL::init() (sql_join_cache.cc:481)
==2070== by 0x79379D: check_join_cache_usage(st_join_table*, JOIN*, unsigned long long, unsigned int) (sql_
select.cc:9902)
==2070== by 0x7BC815: make_join_readinfo(JOIN*, unsigned long long, unsigned int) (sql_select.cc:10112)
==2070== by 0x7BEBEB: JOIN::optimize() (sql_select.cc:1918)
==2070== by 0x7C20C5: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned i
nt, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select
_lex*) (sql_select.cc:3038)
==2070== by 0x7C78FC: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:314)
==2070== by 0x724DD5: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4747)
==2070== by 0x7267C6: mysql_execute_command(THD*) (sql_parse.cc:2062)
==2070== by 0x72EACC: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:5735)
==2070== by 0x72F680: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1007)
==2070== by 0x730B2F: do_command(THD*) (sql_parse.cc:690)
==2070==
...
How to repeat:
compile 6.0-bugteam with BUILD/compile-pentium-valgrind-max
and run : mysql-test-run.pl --valgrind select_jcl6
Suggested fix:
probably some overflow of the allocated space for the join cache.