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

Assertion `lex->current_select->linkage != GLOBAL_OPTIONS_TYPE' failed when parsing the query using derived table

    XMLWordPrintable

Details

    Description

      The issue is similar to MDEV-25484.

      SELECT * FROM (( ((VALUES (2)) ORDER BY 1);
      

      Leads to:

      10.3.36 1848804840f5595f982c4cd502ba2112f6dd7911 (Debug)

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

      10.3.36 1848804840f5595f982c4cd502ba2112f6dd7911 (Debug)

      Core was generated by `/test/MD190722-mariadb-10.3.36-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x146644143700 (LWP 4145383))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014664ed61859 in __GI_abort () at abort.c:79
      #2  0x000014664ed61729 in __assert_fail_base (fmt=0x14664eef7588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5603fe00cdd8 "lex->current_select->linkage != GLOBAL_OPTIONS_TYPE", file=0x5603fe00c8e0 "/test/10.3_dbg/sql/sql_yacc.yy", line=17642, function=<optimized out>) at assert.c:92
      #3  0x000014664ed72fd6 in __GI___assert_fail (assertion=assertion@entry=0x5603fe00cdd8 "lex->current_select->linkage != GLOBAL_OPTIONS_TYPE", file=file@entry=0x5603fe00c8e0 "/test/10.3_dbg/sql/sql_yacc.yy", line=line@entry=17642, function=function@entry=0x5603fe006e51 "int MYSQLparse(THD*)") at assert.c:101
      #4  0x00005603fd6f21cf in MYSQLparse (thd=thd@entry=0x1465e4000d90) at /test/10.3_dbg/sql/sql_yacc.yy:17642
      #5  0x00005603fd51706a in parse_sql (thd=thd@entry=0x1465e4000d90, parser_state=parser_state@entry=0x1466441425e0, creation_ctx=creation_ctx@entry=0x0, do_pfs_digest=do_pfs_digest@entry=true) at /test/10.3_dbg/sql/sql_parse.cc:10163
      #6  0x00005603fd5173a5 in mysql_parse (thd=thd@entry=0x1465e4000d90, rawbuf=<optimized out>, length=42, parser_state=parser_state@entry=0x1466441425e0, 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:7822
      #7  0x00005603fd5194fe in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1465e4000d90, packet=packet@entry=0x1465e4019751 "SELECT * FROM (( ((VALUES (2)) ORDER BY 1)", packet_length=packet_length@entry=42, 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:1152
      #8  0x00005603fd51b928 in do_command (thd=0x1465e4000d90) at /test/10.3_dbg/sql/sql_parse.cc:1398
      #9  0x00005603fd62675f in do_handle_one_connection (connect=<optimized out>) at /test/10.3_dbg/sql/sql_connect.cc:1403
      #10 0x00005603fd62688f in handle_one_connection (arg=<optimized out>) at /test/10.3_dbg/sql/sql_connect.cc:1308
      #11 0x000014664ef39609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #12 0x000014664ee5e133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.36 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.36 (opt), 10.4.26 (dbg), 10.4.26 (opt), 10.5.17 (dbg), 10.5.17 (opt), 10.6.9 (dbg), 10.6.9 (opt), 10.7.5 (dbg), 10.7.5 (opt), 10.8.4 (dbg), 10.8.4 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.0 (dbg), 10.10.0 (opt)

      Attachments

        Activity

          People

            igor Igor Babaev
            ramesh Ramesh Sivaraman
            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.