[MDEV-6946] Assertion `0' failed in mysql_execute_command on SET STATEMENT keycache1.key_buffer_size=.. FOR Created: 2014-10-25  Updated: 2014-10-26  Resolved: 2014-10-26

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: N/A
Fix Version/s: 10.1.2

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5231 Per query variables from Percona Serv... Closed
relates to MDEV-6923 Testing for SET STATEMENT .. FOR (MDE... Closed

 Description   

SET STATEMENT keycache1.key_buffer_size=1024 FOR SELECT 1;

mysqld: sql/sql_parse.cc:2693: int mysql_execute_command(THD*): Assertion `0' failed.

#6  0x00007f11828cc6f1 in *__GI___assert_fail (assertion=0x7f1185af5f48 "0", file=<optimized out>, line=2693, function=0x7f1185af8e20 "int mysql_execute_command(THD*)") at assert.c:81
#7  0x00007f11851e0ab8 in mysql_execute_command (thd=0x7f1169350070) at /sql/sql_parse.cc:2693
#8  0x00007f11851edffb in mysql_parse (thd=0x7f1169350070, rawbuf=0x7f1169080088 "SET statement keycache1.key_buffer_size=1024 for select 1", length=57, parser_state=0x7f1184ca0210) at /sql/sql_parse.cc:7046
#9  0x00007f11851dd898 in dispatch_command (command=COM_QUERY, thd=0x7f1169350070, packet=0x7f116905f071 "SET statement keycache1.key_buffer_size=1024 for select 1", packet_length=57) at /sql/sql_parse.cc:1466
#10 0x00007f11851dc6b6 in do_command (thd=0x7f1169350070) at /sql/sql_parse.cc:1095
#11 0x00007f118530ab77 in do_handle_one_connection (thd_arg=0x7f1169350070) at /sql/sql_connect.cc:1351
#12 0x00007f118530a8bc in handle_one_connection (arg=0x7f1169350070) at /sql/sql_connect.cc:1262
#13 0x00007f11848e6b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#14 0x00007f118297d20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#15 0x0000000000000000 in ?? ()

Stack trace from

commit 3a3f88e789a41b309cfe902f4823c9c7ebbce6ca
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Fri Oct 24 10:13:08 2014 +0200
 
    MDEV-5231: Per query variables from Percona Server (rewritten)

Percona server correctly produces an error:

MySQL [test]> SET statement keycache1.key_buffer_size=1024 for select 1;
ERROR 1229 (HY000): Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL



 Comments   
Comment by Oleksandr Byelkin [ 2014-10-26 ]

Assert caused because variable type is 136 which looks like illegal...

Comment by Oleksandr Byelkin [ 2014-10-26 ]

class Sys_var_keycache: public Sys_var_ulonglong
...
{
option.var_type|= GET_ASK_ADDR;
...

Comment by Oleksandr Byelkin [ 2014-10-26 ]

type should be taken by mask GET_TYPE_MASK

Generated at Thu Feb 08 07:15:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.