Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: mysqld crash when exec query like "select * from a limit 0" #1394

Closed
2 of 3 tasks
adofsauron opened this issue Mar 15, 2023 · 2 comments · Fixed by #1395
Closed
2 of 3 tasks

bug: mysqld crash when exec query like "select * from a limit 0" #1394

adofsauron opened this issue Mar 15, 2023 · 2 comments · Fixed by #1395
Assignees
Labels
A-bug Something isn't working prio: high High priority

Comments

@adofsauron
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

c0a4fc3ba1ce5b3b0970f5548aec5cdd

(gdb) bt
#0  0x0000000002d466e0 in Tianmu::core::Query::Compile (this=0x7fda88581740, compiled_query=0x7fda88581670, selects_list=0x7fcfa00058c0, last_distinct=0x0, res_tab=0x0, ignore_limit=false, 
    left_expr_for_subselect=0x0, oper_for_subselect=0x0, ignore_minmax=false, for_subq_in_where=false) at /stonedb/storage/tianmu/core/query_compile.cpp:1116
#1  0x0000000002d02c05 in Tianmu::core::Engine::Execute (this=0x762a6a0, thd=0x7fcfa0000b70, lex=0x7fcfa0002e98, result_output=0x7fcfa0006b80, unit_for_union=0x0)
    at /stonedb/storage/tianmu/core/engine_execute.cpp:436
#2  0x0000000002d01f52 in Tianmu::core::Engine::HandleSelect (this=0x762a6a0, thd=0x7fcfa0000b70, lex=0x7fcfa0002e98, result=@0x7fda88581cb8: 0x7fcfa0006b80, setup_tables_done_option=0, 
    res=@0x7fda88581cb4: 0, is_optimize_after_tianmu=@0x7fda88581cac: 1, tianmu_free_join=@0x7fda88581cb0: 1, with_insert=0) at /stonedb/storage/tianmu/core/engine_execute.cpp:238
#3  0x0000000002e1007f in Tianmu::DBHandler::ha_my_tianmu_query (thd=0x7fcfa0000b70, lex=0x7fcfa0002e98, result_output=@0x7fda88581cb8: 0x7fcfa0006b80, setup_tables_done_option=0, 
    res=@0x7fda88581cb4: 0, is_optimize_after_tianmu=@0x7fda88581cac: 1, tianmu_free_join=@0x7fda88581cb0: 1, with_insert=0) at /stonedb/storage/tianmu/handler/ha_my_tianmu.cpp:89
#4  0x0000000002440239 in execute_sqlcom_select (thd=0x7fcfa0000b70, all_tables=0x7fcfa00065e0) at /stonedb/sql/sql_parse.cc:5208
#5  0x00000000024398b8 in mysql_execute_command (thd=0x7fcfa0000b70, first_level=true) at /stonedb/sql/sql_parse.cc:2851
#6  0x0000000002441277 in mysql_parse (thd=0x7fcfa0000b70, parser_state=0x7fda88582e80) at /stonedb/sql/sql_parse.cc:5646
#7  0x00000000024365f4 in dispatch_command (thd=0x7fcfa0000b70, com_data=0x7fda88583610, command=COM_QUERY) at /stonedb/sql/sql_parse.cc:1495
#8  0x000000000243543e in do_command (thd=0x7fcfa0000b70) at /stonedb/sql/sql_parse.cc:1034
#9  0x00000000025675b3 in handle_connection (arg=0xcea2640) at /stonedb/sql/conn_handler/connection_handler_per_thread.cc:313
#10 0x0000000002c363e5 in pfs_spawn_thread (arg=0xceb1c90) at /stonedb/storage/perfschema/pfs.cc:2197
#11 0x00007fda92a51ea5 in start_thread () from /lib64/libpthread.so.0
#12 0x00007fda90524b0d 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?

  • Yes, I will!
@RingsC
Copy link
Contributor

RingsC commented Mar 15, 2023

@adofsauron , pls gives out the root cause of this issue. Why the limit 0 cause server crash.

@adofsauron
Copy link
Collaborator Author

Cause: tianmu engine cannot process this scenario when limit=0 and cannot get conds, resulting in crash

@mergify mergify bot closed this as completed in #1395 Mar 17, 2023
mergify bot pushed a commit that referenced this issue Mar 17, 2023
    Cause: tianmu engine cannot process this scenario when limit=0 and cannot get conds, resulting in crash
    Solution: limit 0 is executed without tianmu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working prio: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants