Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38272

Sig11 in LEX::resolve_references_to_cte at sql/sql_cte.cc

    XMLWordPrintable

Details

    • Bug
    • Status: In Testing (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 12.3
    • 12.3
    • Optimizer - CTE
    • None
    • Can result in hang or crash

    Description

      Issue: Segmentation fault seen while testing MDEV-37220

      -------------
      MariaDB [m2]> with cte as (select * from t1) delete from t1,cte where t1.a=cte.a;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'where t1.a=cte.a' at line 1

      MariaDB [m2]> with cte as (select * from t1) delete from t1 using t1,cte where t1.a=cte.a;
      ERROR 2026 (HY000): TLS/SSL error: unexpected eof while reading

      Version used:

      --------------
      Branch: 12.2-MDEV-38258
      commit 7fde72db9e1574ca1fa1075de279df4d331093d5
      Issue seen on both debug and release build

      Stack trace:

      #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=11, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=11) at ./nptl/pthread_kill.c:89
      #3  my_write_core (sig=11) at /home/ppandith/wl-12/mysys/stacktrace.c:424
      #4  handle_fatal_signal (sig=11) at /home/ppandith/wl-12/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  Query_tables_list::add_to_query_tables (this=, table=) at /home/ppandith/wl-12/sql/sql_lex.h:1771
      #7  LEX::resolve_references_to_cte (this=, tables=, tables_last=, excl_spec=) at /home/ppandith/wl-12/sql/sql_cte.cc:163
      #8  LEX::check_cte_dependencies_and_resolve_references (this=) at /home/ppandith/wl-12/sql/sql_cte.cc:262
      #9  LEX::check_main_unit_semantics (this=) at /home/ppandith/wl-12/sql/sql_lex.cc:10060
      #10 MYSQLparse (thd=) at /home/ppandith/wl-12/sql/sql_yacc.yy:13833
      #11 parse_sql (thd=, parser_state=, creation_ctx=, do_pfs_digest=true) at /home/ppandith/wl-12/sql/sql_parse.cc:10315
      #12 mysql_parse (thd=, rawbuf="with cte as (select * from t1) delete from t1 using t1,cte where t1.a=cte.a", length=75, 
          parser_state=) at /home/ppandith/wl-12/sql/sql_parse.cc:7847
      #13 dispatch_command (command=COM_QUERY, thd=, 
          packet="with cte as (select * from t1) delete from t1 using t1,cte where t1.a=cte.a", packet_length=75, blocking=true)
          at /home/ppandith/wl-12/sql/sql_parse.cc:1878
      #14 do_command (thd=, blocking=true) at /home/ppandith/wl-12/sql/sql_parse.cc:1417
      #15 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-12/sql/sql_connect.cc:1503
      #16 handle_one_connection (arg=) at /home/ppandith/wl-12/sql/sql_connect.cc:1415
      #17 pfs_spawn_thread (arg=) at /home/ppandith/wl-12/storage/perfschema/pfs.cc:2198
      #18 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #19 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      How to reproduce:

      create table t1( a int);
      with cte as (select * from t1) delete from t1,cte where t1.a=cte.a;
      with cte as (select * from t1) delete from t1 using t1,cte where t1.a=cte.a;
      

      Attachments

        Activity

          People

            mariadb-pavithrapandith Pavithra Pandith
            mariadb-pavithrapandith Pavithra Pandith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.