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

EXECUTE IMMEDIATE within a executable comment parses incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2.36
    • Fix Version/s: 10.2
    • Component/s: Parser
    • Labels:
      None

      Description

      MariaDB [(none)]> /*M!100203 EXECUTE IMMEDIATE CONCAT(" */ SELECT 1  /*M!100203 ") */;
      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 '*/ SELECT 1  /*M!100203' at line 1
      MariaDB [(none)]> select version();
      +-----------------+
      | version()       |
      +-----------------+
      | 10.2.36-MariaDB |
      +-----------------+
      1 row in set (0.00 sec)
      

      gdb bt

      Thread 32 "mysqld" hit Breakpoint 1, Prepared_statement::execute_immediate (this=this@entry=0x7f1aa00162d8, query=0x7f1b10cb65d0 " */ SELECT 1  /*M!100203 ", query_len=25) at /home/dan/repos/mariadb-server-10.2/sql/sql_prepare.cc:5135
      5135	  @param query  - query text
      (gdb) bt
      #0  Prepared_statement::execute_immediate (this=this@entry=0x7f1aa00162d8, query=0x7f1b10cb65d0 " */ SELECT 1  /*M!100203 ", query_len=25) at /home/dan/repos/mariadb-server-10.2/sql/sql_prepare.cc:5135
      #1  0x00000000005fe9e0 in mysql_sql_stmt_execute_immediate (thd=thd@entry=0x7f1aa0000c48) at /home/dan/repos/mariadb-server-10.2/sql/sql_prepare.cc:3010
      #2  0x00000000005ea06f in mysql_execute_command (thd=<optimized out>, thd@entry=0x7f1aa0000c48) at /home/dan/repos/mariadb-server-10.2/sql/sql_parse.cc:3564
      #3  0x00000000005e586b in mysql_parse (thd=thd@entry=0x7f1aa0000c48, rawbuf=0x7f1aa000f260 "/*M!100203 EXECUTE IMMEDIATE CONCAT(\" */ SELECT 1  /*M!100203 \") */", length=<optimized out>, parser_state=parser_state@entry=0x7f1b10cb7680, is_com_multi=false, is_next_command=false) at /home/dan/repos/mariadb-server-10.2/sql/sql_parse.cc:7761
      #4  0x00000000005e2040 in dispatch_command (command=<optimized out>, command@entry=COM_QUERY, thd=thd@entry=0x7f1aa0000c48, packet=0x7f1aa000f260 "/*M!100203 EXECUTE IMMEDIATE CONCAT(\" */ SELECT 1  /*M!100203 \") */", packet@entry=0x7f1aa0006fa9 "/*M!100203 EXECUTE IMMEDIATE CONCAT(\" */ SELECT 1  /*M!100203 \") */", packet_length=0, packet_length@entry=67, is_com_multi=<optimized out>, is_next_command=false) at /home/dan/repos/mariadb-server-10.2/sql/sql_parse.cc:1827
      #5  0x00000000005e43a0 in do_command (thd=0x7f1aa0000c48) at /home/dan/repos/mariadb-server-10.2/sql/sql_parse.cc:1381
      #6  0x00000000006b452a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x290bc98) at /home/dan/repos/mariadb-server-10.2/sql/sql_connect.cc:1336
      #7  0x00000000006b42f3 in handle_one_connection (arg=0x290bc98) at /home/dan/repos/mariadb-server-10.2/sql/sql_connect.cc:1241
      #8  0x00007f1b12bb73f9 in start_thread () from /lib64/libpthread.so.0
      #9  0x00007f1b1221e903 in clone () from /lib64/libc.so.6
      

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            danblack Daniel Black
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration