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

Crash when parsing query using derived table containing TVC

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3
    • 10.3.31
    • Parser
    • None

    Description

      SELECT * FROM ( ( (VALUES (3),(7),(1) LIMIT 2) ORDER BY 1 DESC)) AS dt;
      

      Leads to:

      10.3.29 eb7c5530eccb7d6782077e5562f5a471d2ccbc01 (Debug)

      mysqld: /test/10.3_dbg/sql/sql_yacc.yy:17546: int MYSQLparse(THD*): Assertion `lex->current_select->linkage != GLOBAL_OPTIONS_TYPE' failed.
      

      10.3.29 eb7c5530eccb7d6782077e5562f5a471d2ccbc01 (Debug)

      Core was generated by `/test/MD160321-mariadb-10.3.29-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x14c2fc0d7700 (LWP 2581077))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055f825558b86 in my_write_core (sig=sig@entry=6) at /test/10.3_dbg/mysys/stacktrace.c:386
      #2  0x000055f824d03b91 in handle_fatal_signal (sig=6) at /test/10.3_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014c314189859 in __GI_abort () at abort.c:79
      #6  0x000014c314189729 in __assert_fail_base (fmt=0x14c31431f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55f825656548 "lex->current_select->linkage != GLOBAL_OPTIONS_TYPE", file=0x55f825656028 "/test/10.3_dbg/sql/sql_yacc.yy", line=17546, function=<optimized out>) at assert.c:92
      #7  0x000014c31419af36 in __GI___assert_fail (assertion=assertion@entry=0x55f825656548 "lex->current_select->linkage != GLOBAL_OPTIONS_TYPE", file=file@entry=0x55f825656028 "/test/10.3_dbg/sql/sql_yacc.yy", line=line@entry=17546, function=function@entry=0x55f825650631 "int MYSQLparse(THD*)") at assert.c:101
      #8  0x000055f824c8bae8 in MYSQLparse (thd=thd@entry=0x14c2b4000d90) at /test/10.3_dbg/sql/sql_yacc.yy:17546
      #9  0x000055f824a80e44 in parse_sql (thd=thd@entry=0x14c2b4000d90, parser_state=parser_state@entry=0x14c2fc0d6540, creation_ctx=creation_ctx@entry=0x0, do_pfs_digest=do_pfs_digest@entry=true) at /test/10.3_dbg/sql/sql_parse.cc:10178
      #10 0x000055f824a812b3 in mysql_parse (thd=thd@entry=0x14c2b4000d90, rawbuf=<optimized out>, length=70, parser_state=parser_state@entry=0x14c2fc0d6540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:7819
      #11 0x000055f824a83c32 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c2b4000d90, packet=packet@entry=0x14c2b40198f1 "SELECT * FROM ( ( (VALUES (3),(7),(1) LIMIT 2) ORDER BY 1 DESC)) AS dt", packet_length=packet_length@entry=70, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_class.h:1139
      #12 0x000055f824a86ddf in do_command (thd=0x14c2b4000d90) at /test/10.3_dbg/sql/sql_parse.cc:1398
      #13 0x000055f824bac7db in do_handle_one_connection (connect=connect@entry=0x55f82774ccd0) at /test/10.3_dbg/sql/sql_connect.cc:1403
      #14 0x000055f824baca12 in handle_one_connection (arg=0x55f82774ccd0) at /test/10.3_dbg/sql/sql_connect.cc:1308
      #15 0x000014c31468f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #16 0x000014c314286293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.29 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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