[MDEV-18358] Server crash when using SET STATEMENT max_statement_time Created: 2019-01-23  Updated: 2020-02-03  Resolved: 2019-03-05

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.4.1
Fix Version/s: 10.4.4

Type: Bug Priority: Critical
Reporter: Diego Dupin Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None
Environment:

windows 10


Issue Links:
Relates
relates to MDEV-21616 Server crash when using "SET STATEMEN... Closed

 Description   

Server crash when using `SET STATEMENT max_statement_time` :

Query to reproduce :

SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown';

without the 'SET STATEMENT max_statement_time=30', no problem.

error in logs :

190123 13:55:46 [ERROR] mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.4.1-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=65537
thread_count=7
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136273 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x1ed7f65b028
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
mysqld.exe!st_select_lex::init_select()[sql_lex.cc:2399]
mysqld.exe!mysql_init_select()[sql_parse.cc:7713]
mysqld.exe!MYSQLparse()[sql_yacc.yy:13606]
mysqld.exe!parse_sql()[sql_parse.cc:10124]
mysqld.exe!mysql_parse()[sql_parse.cc:8059]
mysqld.exe!dispatch_command()[sql_parse.cc:1853]
mysqld.exe!do_command()[sql_parse.cc:1395]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:358]
mysqld.exe!tp_callback()[threadpool_common.cc:186]
ntdll.dll!RtlAcquireSRWLockExclusive()
ntdll.dll!RtlReleaseSRWLockExclusive()
KERNEL32.DLL!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x1ed7f66a040): SET STATEMENT max_statement_time=30 FOR DELETE FROM mysql.user where user = 'unknown'
Connection ID (thread ID): 8
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on

This is used by java connector when setting statement timeout (Statement.setQueryTimeout(int seconds).). Since it's standard in JDBC, it can be more widly used that one can think.



 Comments   
Comment by Oleksandr Byelkin [ 2019-03-04 ]

revision-id: e8d6cf82fe4e33df326d886b2335c3dd625839d5 (mariadb-10.4.3-2-ge8d6cf82fe4)
parent(s): 9011fa1ace3c6a49afdf05c714844d938a8c6f99
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2019-03-04 12:17:13 +0100
message:

MDEV-18358: Server crash when using SET STATEMENT max_statement_time

Do not init lex before choosing main select.

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