Crashing repeated execution of SET STATEMENT ... FOR <SELECT FROM view> | Assertion `sl->join == 0' failed in reinit_stmt_before_use | sig 6 abort in sql/sql_prepare.cc:2619

Bug #1392375 reported by Ramesh Sivaraman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
High
Laurynas Biveinis
5.7
Fix Released
High
Laurynas Biveinis

Bug Description

** Testcase (reproducible with debug build)

DROP DATABASE test;CREATE DATABASE test;USE test;
create view t1 as select 1 as a;
PREPARE stmt1 FROM 'SET STATEMENT binlog_format=row FOR SELECT * FROM t1';
execute stmt1;
EXECUTE stmt1;

** GDB info

#0 0x00007fdefd58e771 in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000000ab7e66 in my_write_core (sig=6) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/mysys/stacktrace.c:422
#2 0x000000000072fcd3 in handle_fatal_signal (sig=6) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/signal_handler.cc:236
#3 <signal handler called>
#4 0x00007fdefc1925c9 in raise () from /lib64/libc.so.6
#5 0x00007fdefc193cd8 in abort () from /lib64/libc.so.6
#6 0x00007fdefc18b536 in __assert_fail_base () from /lib64/libc.so.6
#7 0x00007fdefc18b5e2 in __assert_fail () from /lib64/libc.so.6
#8 0x0000000000801f27 in reinit_stmt_before_use (thd=0x7fde68bf2000, lex=0x7fde4088b018) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_prepare.cc:2619
#9 0x000000000080606a in Prepared_statement::execute (this=0x7fde40881280, expanded_query=0x7fdefdb3cb60, open_cursor=false) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_prepare.cc:4311
#10 0x00000000008051be in Prepared_statement::execute_loop (this=0x7fde40881280, expanded_query=0x7fdefdb3cb60, open_cursor=false, packet=0x0, packet_end=0x0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_prepare.cc:3991
#11 0x0000000000802b5b in mysql_sql_stmt_execute (thd=0x7fde68bf2000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_prepare.cc:2921
#12 0x00000000007e3115 in mysql_execute_command (thd=0x7fde68bf2000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:2975
#13 0x00000000007ed49f in mysql_parse (thd=0x7fde68bf2000, rawbuf=0x7fde4081f010 "EXECUTE stmt1", length=13, parser_state=0x7fdefdb3ddf0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:6777
#14 0x00000000007df8be in dispatch_command (command=COM_QUERY, thd=0x7fde68bf2000, packet=0x7fde5f667001 "EXECUTE stmt1", packet_length=13) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:1432
#15 0x00000000007de7dc in do_command (thd=0x7fde68bf2000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:1049
#16 0x00000000007a6785 in do_handle_one_connection (thd_arg=0x7fde68bf2000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_connect.cc:1532
#17 0x00000000007a628d in handle_one_connection (arg=0x7fde68bf2000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_connect.cc:1443
#18 0x0000000000dc648c in pfs_spawn_thread (arg=0x7fdef6b49ba0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/perfschema/pfs.cc:1860
#19 0x00007fdefd589df3 in start_thread () from /lib64/libpthread.so.0
#20 0x00007fdefc25301d in clone () from /lib64/libc.so.6

tags: added: qa set-statement
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The root cause is shared with bug 1635927

summary: + SET STATEMENT ... FOR <statement> crashes for selects from views |
Assertion `sl->join == 0' failed in reinit_stmt_before_use | sig 6 abort
in sql/sql_prepare.cc:2619
summary: - SET STATEMENT ... FOR <statement> crashes for selects from views |
- Assertion `sl->join == 0' failed in reinit_stmt_before_use | sig 6 abort
- in sql/sql_prepare.cc:2619
+ Crashing repeated execution of SET STATEMENT ... FOR <SELECT FROM view>
+ | Assertion `sl->join == 0' failed in reinit_stmt_before_use | sig 6
+ abort in sql/sql_prepare.cc:2619
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-845

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.