[MDEV-22039] Server crashes in MYSQLparse upon IF with double brackets Created: 2020-03-25  Updated: 2020-10-27  Resolved: 2020-10-27

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.4, 10.5
Fix Version/s: 10.4.16, 10.5.7

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Dmitry Shulga
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-22000 Server crashes in st_select_lex::inc_... Closed
relates to MDEV-23094 Multiple calls to a Stored Procedure ... Closed

 Description   

For MTR

--delimiter $
query IF AVG( ( SELECT 1 ) ) THEN 1 ; END IF $
--delimiter ;

For client

DELIMITER $
IF AVG( ( SELECT 1 ) ) THEN 1 ; END IF $
DELIMITER ;

10.4 efc97eff

#3  <signal handler called>
#4  0x000055f0dc3b60eb in MYSQLparse (thd=0x7f3610000af0) at /data/src/10.4/sql/sql_yacc.yy:11922
#5  0x000055f0dc11203a in parse_sql (thd=0x7f3610000af0, parser_state=0x7f36229cb160, creation_ctx=0x0, do_pfs_digest=true) at /data/src/10.4/sql/sql_parse.cc:10206
#6  0x000055f0dc10c85e in mysql_parse (thd=0x7f3610000af0, rawbuf=0x7f36100132f0 "IF AVG( ( SELECT 1 ) ) THEN 1 ; END IF", length=38, parser_state=0x7f36229cb160, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7853
#7  0x000055f0dc0f7bd0 in dispatch_command (command=COM_QUERY, thd=0x7f3610000af0, packet=0x7f3610136171 "IF AVG( ( SELECT 1 ) ) THEN 1 ; END IF ", packet_length=39, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
#8  0x000055f0dc0f625d in do_command (thd=0x7f3610000af0) at /data/src/10.4/sql/sql_parse.cc:1360
#9  0x000055f0dc27f70f in do_handle_one_connection (connect=0x55f0dfe0b510) at /data/src/10.4/sql/sql_connect.cc:1412
#10 0x000055f0dc27f45e in handle_one_connection (arg=0x55f0dfe0b510) at /data/src/10.4/sql/sql_connect.cc:1316
#11 0x000055f0dcc87db3 in pfs_spawn_thread (arg=0x55f0dfd1f4a0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#12 0x00007f362a7aa4a4 in start_thread (arg=0x7f36229cc700) at pthread_create.c:456
#13 0x00007f36288ded0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Reproducible on 10.4, 10.5, debug, non-debug and ASAN alike.
Not reproducible on 10.3.



 Comments   
Comment by Dmitry Shulga [ 2020-10-27 ]

This issue was fixed in https://jira.mariadb.org/browse/MDEV-23094

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