[MDEV-12563] Server crashes in handler::ha_index_or_rnd_end on recursive CTE Created: 2017-04-22  Updated: 2017-04-29  Resolved: 2017-04-29

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - CTE
Affects Version/s: 10.2
Fix Version/s: 10.2.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: 10.2-ga


 Description   

CREATE TABLE t (i INT);
INSERT INTO t VALUES (1),(2);
 
SET standard_compliant_cte=0;
 
WITH RECURSIVE cte(f) AS (
  SELECT i FROM t
  UNION
  SELECT i FROM t WHERE i NOT IN ( SELECT * FROM cte )
) SELECT * FROM cte;

10.2 54a995cd2206

#3  <signal handler called>
#4  0x00007fda71808daa in handler::ha_index_or_rnd_end (this=0x8f8f8f8f8f8f8f8f) at /data/src/10.2/sql/handler.h:2840
#5  0x00007fda7189d6c5 in free_tmp_table (thd=0x7fda58000b00, entry=0x7fda58037118) at /data/src/10.2/sql/sql_select.cc:17771
#6  0x00007fda717bced9 in close_thread_tables (thd=0x7fda58000b00) at /data/src/10.2/sql/sql_base.cc:784
#7  0x00007fda7183954d in mysql_execute_command (thd=0x7fda58000b00) at /data/src/10.2/sql/sql_parse.cc:6255
#8  0x00007fda7183dbf6 in mysql_parse (thd=0x7fda58000b00, rawbuf=0x7fda58012348 "WITH RECURSIVE cte(f) AS (\nSELECT i FROM t\nUNION\nSELECT i FROM t WHERE i NOT IN ( SELECT * FROM cte )\n) SELECT * FROM cte", length=121, parser_state=0x7fda6964a210, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7874
#9  0x00007fda7182bcce in dispatch_command (command=COM_QUERY, thd=0x7fda58000b00, packet=0x7fda580087a1 "", packet_length=121, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
#10 0x00007fda7182a63e in do_command (thd=0x7fda58000b00) at /data/src/10.2/sql/sql_parse.cc:1362
#11 0x00007fda71974e05 in do_handle_one_connection (connect=0x7fda757ce260) at /data/src/10.2/sql/sql_connect.cc:1354
#12 0x00007fda71974b92 in handle_one_connection (arg=0x7fda757ce260) at /data/src/10.2/sql/sql_connect.cc:1260
#13 0x00007fda71d8deb8 in pfs_spawn_thread (arg=0x7fda757a8b10) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#14 0x00007fda70e50064 in start_thread (arg=0x7fda6964b700) at pthread_create.c:309
#15 0x00007fda6f24062d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111



 Comments   
Comment by Igor Babaev [ 2017-04-29 ]

The fix for this bug was pushed into the 10.2 tree.

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