Crash in Field::is_null with join_cache_level=3 in maria-5.3-mwl128
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
The following query:
SELECT table1 .`col_int_nokey` , table2 .`col_varchar_key` , table1 .`col_varchar_key` , table2 .`col_time_key` , table2 .`col_date_key` , table2 .`col_int_key`
FROM CC table1 STRAIGHT_JOIN ( CC table2 JOIN CC table3 ON table3 .`col_varchar_
ORDER BY table1 .`col_date_key`;
causes the following backtrace:
#4 <signal handler called>
#5 0x081b9287 in Field::is_null (this=0xaecd830, row_offset=0) at field.h:337
#6 0x082d89d2 in JOIN_CACHE:
#7 0x082d8895 in JOIN_CACHE:
#8 0x082d86b9 in JOIN_CACHE:
#9 0x082dab89 in JOIN_CACHE_
#10 0x082d9444 in JOIN_CACHE:
#11 0x082d8fe0 in JOIN_CACHE:
#12 0x0831ffdb in sub_select_cache (join=0xaed00b0, join_tab=0xaed6098, end_of_
#13 0x082d9694 in JOIN_CACHE:
#14 0x082d9456 in JOIN_CACHE:
#15 0x082d8fe0 in JOIN_CACHE:
#16 0x0831ffdb in sub_select_cache (join=0xaed00b0, join_tab=0xaed5ec4, end_of_
#17 0x08320902 in evaluate_
#18 0x083203f7 in sub_select (join=0xaed00b0, join_tab=0xaed5cf0, end_of_
#19 0x0831f6ca in do_select (join=0xaed00b0, fields=0x0, table=0xaecb730, procedure=0x0) at sql_select.cc:12839
#20 0x08303adf in JOIN::exec (this=0xaed00b0) at sql_select.cc:1990
#21 0x08305df4 in mysql_select (thd=0xae59118, rref_pointer_
group=0x0, having=0x0, proc_param=0x0, select_
#22 0x082fe4af in handle_select (thd=0xae59118, lex=0xae5a79c, result=0xaeac090, setup_tables_
#23 0x0829b6d4 in execute_
#24 0x082920b4 in mysql_execute_
#25 0x0829d8b5 in mysql_parse (thd=0xae59118,
inBuf=0xaeaa2e8 "SELECT table1 .`col_int_nokey` , table2 .`col_varchar_key` , table1 .`col_varchar_key` , table2 .`col_time_key` , table2 .`col_date_key` , table2 .`col_int_
#26 0x0828fae6 in dispatch_command (command=COM_QUERY, thd=0xae59118,
packet=
#27 0x0828ef8c in do_command (thd=0xae59118) at sql_parse.cc:890
#28 0x0828c0ec in handle_
#29 0x00bea919 in start_thread () from /lib/libpthread
#30 0x00b2ccbe in clone () from /lib/libc.so.6
when executed with join_cache_level=3 , join_buffer_
Changed in maria: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Valgrind warnings:
==21368== Invalid read of size 1 strmem. c:497) :read_record_ field(st_ cache_field* , bool) (sql_join_ cache.cc: 1695) :read_all_ record_ fields( ) (sql_join_ cache.cc: 1600) :get_record_ by_pos( unsigned char*) (sql_join_ cache.cc: 1499) BNLH::read_ next_candidate_ for_match( unsigned char*) (sql_join_ cache.cc: 3387) :join_matching_ records( bool) (sql_join_ cache.cc: 2117) :join_records( bool) (sql_join_ cache.cc: 1926) cache(JOIN* , st_join_table*, bool) (sql_select. cc:13103) :generate_ full_extensions (unsigned char*) (sql_join_ cache.cc: 2224) :join_matching_ records( bool) (sql_join_ cache.cc: 2118) :join_records( bool) (sql_join_ cache.cc: 1926) cache(JOIN* , st_join_table*, bool) (sql_select. cc:13103) join_record( JOIN*, st_join_table*, int) (sql_select. cc:13487) cc:13335) cc:12839) cc:1990)
==21368== at 0x4007637: memcpy (mc_replace_
==21368== by 0x82D8AF4: JOIN_CACHE:
==21368== by 0x82D8894: JOIN_CACHE:
==21368== by 0x82D86B8: JOIN_CACHE:
==21368== by 0x82DAB88: JOIN_CACHE_
==21368== by 0x82D9443: JOIN_CACHE:
==21368== by 0x82D8FDF: JOIN_CACHE:
==21368== by 0x831FFDA: sub_select_
==21368== by 0x82D9693: JOIN_CACHE:
==21368== by 0x82D9455: JOIN_CACHE:
==21368== by 0x82D8FDF: JOIN_CACHE:
==21368== by 0x831FFDA: sub_select_
==21368== by 0x8320901: evaluate_
==21368== by 0x83203F6: sub_select(JOIN*, st_join_table*, bool) (sql_select.
==21368== by 0x831F6C9: do_select(JOIN*, List<Item>*, st_table*, Procedure*) (sql_select.
==21368== by 0x8303ADE: JOIN::exec() (sql_select.
==21368== Address 0x186b3528 is 0 bytes after a block of size 192 alloc'd malloc. c:195) :alloc_ buffer( ) (sql_join_ cache.cc: 827) cache.cc: 956) HASHED: :init() (sql_join_ cache.cc: 2459) BNLH::init( ) (sql_join_ cache.cc: 3417) cache_usage( st_join_ table*, JOIN*, unsigned long long, unsigned int, bool*, bool*) (sql_select. cc:7672) readinfo( JOIN*, unsigned long long, unsigned int) (sql_select. cc:7859) cc:1282) lex_unit* , st_select_lex*) (sql_select. cc:2599) sqlcom_ select( THD*, TABLE_LIST*) (sql_parse.cc:5081) command( THD*) (sql_parse.cc:2265) command( enum_server_ command, THD*, char*, unsigned int) (sql_parse.cc:1184)
==21368== at 0x4005BDC: malloc (vg_replace_
==21368== by 0x872E982: _mymalloc (safemalloc.c:137)
==21368== by 0x82D7599: JOIN_CACHE:
==21368== by 0x82D78FB: JOIN_CACHE::init() (sql_join_
==21368== by 0x82D9A6E: JOIN_CACHE_
==21368== by 0x82DAC64: JOIN_CACHE_
==21368== by 0x83136A2: check_join_
==21368== by 0x8313F9D: make_join_
==21368== by 0x83015E6: JOIN::optimize() (sql_select.
==21368== by 0x8305D6E: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, un
signed long long, select_result*, st_select_
==21368== by 0x82FE4AE: handle_select(THD*, st_lex*, select_result*, unsigned long) (sql_select.cc:277)
==21368== by 0x829B6D3: execute_
==21368== by 0x82920B3: mysql_execute_
==21368== by 0x829D8B4: mysql_parse(THD*, char const*, unsigned int, char const**) (sql_parse.cc:6027)
==21368== by 0x828FAE5: dispatch_
==21368== by 0x828EF8B: do_command(THD*) (sql_parse.cc:890)
==21368== Address 0x186b352a is 2 bytes after a block of size 192 alloc'...