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

table_exists procedure fails when arguments contain escaped backticks as an quoted identifiers

    XMLWordPrintable

Details

    Description

      • It fails with quoted identifiers (exepcted output empty)

        MariaDB [test]> CREATE TABLE `ab``c` (t1_id int PRIMARY KEY, t1_val varchar(10));
        MariaDB [test]> show create table `ab``c`;
        +-------+-------------------------------------------------------------------------------------------+
        | Table | Create Table                                                                              |
        +-------+-------------------------------------------------------------------------------------------+
        | ab`c  | CREATE TABLE `ab``c` (
          `i` int(11) DEFAULT NULL
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
        +-------+-------------------------------------------------------------------------------------------+
        1 row in set (0.000 sec)
         
        MariaDB [test]> call sys.table_exists('test', '`ab``c`',@type);
        ERROR 1103 (42000): Incorrect table name ''
        

      • It even fails with valid table name (after removing enveloped and escaped backtick qoute) - expected output type of the table:

        MariaDB [test]> call sys.table_exists('test','ab`c', @ext);
        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 '` (id INT PRIMARY KEY)' at line 1
        

      Attachments

        Issue Links

          Activity

            People

              anel Anel Husakovic
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.