stoneatom / stonedb

StoneDB is an Open-Source MySQL HTAP and MySQL-Native DataBase for OLTP, Real-Time Analytics, a counterpart of MySQLHeatWave. (https://stonedb.io)
https://stonedb.io/
GNU General Public License v2.0
865 stars 141 forks source link

bug: select * Crashes when the left join is executed(debug) #1785

Closed adofsauron closed 1 year ago

adofsauron commented 1 year ago

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

Describe the problem


#0  0x00007f4233929acf in raise () from /lib64/libc.so.6
#1  0x00007f42338fcea5 in abort () from /lib64/libc.so.6
#2  0x00007f42338fcd79 in __assert_fail_base.cold.0 () from /lib64/libc.so.6
#3  0x00007f4233922426 in __assert_fail () from /lib64/libc.so.6
#4  0x000000000233eecb in Protocol_text::store_date (this=0x7f3cec07eff8, tm=0x7f422c7a78f0) at /root/work/stonedb-dev-20230506/sql/protocol_classic.cc:1257
#5  0x0000000001de5757 in Item::send (this=0x7f3ceccac900, protocol=0x7f3cec07eff8, buffer=0x7f422c7a79e0) at /root/work/stonedb-dev-20230506/sql/item.cc:6929
#6  0x00000000023c7fa3 in THD::send_result_set_row (this=0x7f3cec07de50, row_items=0x7f3cec082ca8) at /root/work/stonedb-dev-20230506/sql/sql_class.cc:4244
#7  0x00000000023c246a in Query_result_send::send_data (this=0x7f3cecc74ed0, items=...) at /root/work/stonedb-dev-20230506/sql/sql_class.cc:2401
#8  0x0000000002cf2798 in Tianmu::core::ResultSender::SendRecord (this=0x7f3ceccba1b0, r=std::vector of length 55, capacity 64 = {...})
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/engine_results.cpp:376
#9  0x0000000002cf2097 in Tianmu::core::ResultSender::SendRow (this=0x7f3ceccba1b0, record=std::vector of length 55, capacity 64 = {...}, owner=0x7f3c60005480)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/engine_results.cpp:269
#10 0x0000000002d5a65b in Tianmu::core::TempTable::SendResult (this=0x7f3c60005480, limit=1016, offset=0, sender=..., pagewise=false)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/temp_table_low.cpp:506
#11 0x0000000002d594a5 in Tianmu::core::TempTable::FillMaterializedBuffers (this=0x7f3c60005480, local_limit=1016, local_offset=0, sender=0x7f3ceccba1b0, pagewise=false)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/temp_table_low.cpp:315
#12 0x0000000002d40393 in Tianmu::core::TempTable::Materialize (this=0x7f3c60005480, in_subq=false, sender=0x7f3ceccba1b0, lazy=false)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/temp_table.cpp:2066
#13 0x0000000002cebc88 in Tianmu::core::Engine::Execute (this=0x706ff60, thd=0x7f3cec07de50, lex=0x7f3cec080178, result_output=0x7f3cecc74ed0, unit_for_union=0x0)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/engine_execute.cpp:518
#14 0x0000000002cea83f in Tianmu::core::Engine::HandleSelect (this=0x706ff60, thd=0x7f3cec07de50, lex=0x7f3cec080178, result=@0x7f422c7a8dc8: 0x7f3cecc74ed0, setup_tables_done_option=0, 
    res=@0x7f422c7a8dc4: 0, is_optimize_after_tianmu=@0x7f422c7a8dbc: 1, tianmu_free_join=@0x7f422c7a8dc0: 1, with_insert=0)
    at /root/work/stonedb-dev-20230506/storage/tianmu/core/engine_execute.cpp:243
#15 0x0000000003084090 in Tianmu::DBHandler::ha_my_tianmu_query (thd=0x7f3cec07de50, lex=0x7f3cec080178, result_output=@0x7f422c7a8dc8: 0x7f3cecc74ed0, setup_tables_done_option=0, 
    res=@0x7f422c7a8dc4: 0, is_optimize_after_tianmu=@0x7f422c7a8dbc: 1, tianmu_free_join=@0x7f422c7a8dc0: 1, with_insert=0)
    at /root/work/stonedb-dev-20230506/storage/tianmu/sql/ha_my_tianmu.cpp:95
#16 0x0000000002427b4c in execute_sqlcom_select (thd=0x7f3cec07de50, all_tables=0x7f3cecc6aa68) at /root/work/stonedb-dev-20230506/sql/sql_parse.cc:4872
#17 0x0000000002420ec2 in mysql_execute_command (thd=0x7f3cec07de50, first_level=true) at /root/work/stonedb-dev-20230506/sql/sql_parse.cc:2672
#18 0x0000000002428bb1 in mysql_parse (thd=0x7f3cec07de50, parser_state=0x7f422c7a9f90) at /root/work/stonedb-dev-20230506/sql/sql_parse.cc:5277
#19 0x000000000241dba8 in dispatch_command (thd=0x7f3cec07de50, com_data=0x7f422c7aa730, command=COM_QUERY) at /root/work/stonedb-dev-20230506/sql/sql_parse.cc:1399
#20 0x000000000241c9e9 in do_command (thd=0x7f3cec07de50) at /root/work/stonedb-dev-20230506/sql/sql_parse.cc:976
#21 0x000000000254ef59 in handle_connection (arg=0xa4a1d30) at /root/work/stonedb-dev-20230506/sql/conn_handler/connection_handler_per_thread.cc:313
#22 0x0000000002c1e798 in pfs_spawn_thread (arg=0x9e06310) at /root/work/stonedb-dev-20230506/storage/perfschema/pfs.cc:2197
#23 0x00007f4236c951ca in start_thread () from /lib64/libpthread.so.0
#24 0x00007f4233914e73 in clone () from /lib64/libc.so.6

Expected behavior

No response

How To Reproduce

No response

Environment

No response

Are you interested in submitting a PR to solve the problem?

hustjieke commented 1 year ago

Crashed happened after pr : https://github.com/stoneatom/stonedb/pull/1751 in release mode.

  1. revert assert() --> debug_assert() to fix crash in release mode.
  2. then we fix crash in debug mode on this sql.
RingsC commented 1 year ago

Without sql statement to reproduce. Need to provide a SQL statement.

adofsauron commented 1 year ago

DEBUG模式下的崩溃,当前不修复