[MDEV-23425] Assertion `(st_select_lex*)join->select_lex == this' in st_select_lex::cleanup Created: 2020-08-07  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Prepared Statements
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None


 Description   

1)

connect (con1,localhost,root,,);
let $id=`select connection_id()`;
 
connection default;
 
--eval prepare stmt from "kill query (select $id)";
execute stmt;
execute stmt;

5.5 821a6939087d411f97256d00f

Version: '5.5.69-MariaDB-debug' 
mysqld: /d1/git/5.5/sql/sql_union.cc:1018: bool st_select_lex::cleanup(): Assertion `(st_select_lex*)join->select_lex == this' failed.
200807  8:38:07 [ERROR] mysqld got signal 6 ;
 
linux/raise.c:51(__GI_raise)[0x7f3294e1b7bb]
stdlib/abort.c:81(__GI_abort)[0x7f3294e06535]
intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f3294e0640f]
sql/sql_union.cc:1019(st_select_lex::cleanup())[0x55fe1e21f8b6]
sql/item_subselect.cc:3085(subselect_single_select_engine::prepare(THD*))[0x55fe1e3b38fe]
sql/item_subselect.cc:249(Item_subselect::fix_fields(THD*, Item**))[0x55fe1e3abc1f]
sql/sql_parse.cc:3761(mysql_execute_command(THD*))[0x55fe1e16fb34]
sql/sql_prepare.cc:3942(Prepared_statement::execute(String*, bool))[0x55fe1e18d2c3]
sql/sql_prepare.cc:3600(Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*))[0x55fe1e18c38c]
sql/sql_prepare.cc:2751(mysql_sql_stmt_execute(THD*))[0x55fe1e18a4c6]
sql/sql_parse.cc:2232(mysql_execute_command(THD*))[0x55fe1e16b73d]
sql/sql_parse.cc:5928(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55fe1e17538f]
sql/sql_parse.cc:1069(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x55fe1e168cb2]
sql/sql_parse.cc:793(do_command(THD*))[0x55fe1e167ec7]
sql/sql_connect.cc:1268(do_handle_one_connection(THD*))[0x55fe1e26cb2b]
sql/sql_connect.cc:1185(handle_one_connection)[0x55fe1e26c8a4]
perfschema/pfs.cc:1017(pfs_spawn_thread)[0x55fe1e5ed171]
nptl/pthread_create.c:487(start_thread)[0x7f32957f0fa3]
x86_64/clone.S:97(clone)[0x7f3294edd4cf]
 
Query (0x7f328e787110): kill query (select 3)

2) Another case while using values():

connect (con1,localhost,root,,);
let $id=`select connection_id()`;
 
connection default;
 
--eval prepare stmt from "kill query (values ($id))";
execute stmt;
execute stmt;

connect  con1,localhost,root,,;
connection default;
prepare stmt from "kill query (values (5))";;
execute stmt;
execute stmt;
main.1_my                                [ fail ]
        Test ended at 2020-08-07 10:45:17
 
CURRENT_TEST: main.1_my
mysqltest: At line 9: query 'execute stmt' failed: 1970: KILL does not support subqueries or stored functions

First execucion was processed, but the second fails.

3)

MariaDB [test]> prepare stmt from "kill query ( (select 9) order by `9` limit 1 )";
Query OK, 0 rows affected (0.001 sec)
Statement prepared
 
MariaDB [test]> execute stmt;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> execute stmt;
ERROR 1054 (42S22): Unknown column '???' in 'order clause'


First execucion was processed, but on the second `9` is not a name of column?


Generated at Thu Feb 08 09:22:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.