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

debian-start erroneously reports issues due to table names not being escaped properly

    XMLWordPrintable

Details

    Description

      Every time I restart my MariaDB server, it comes up with multiple instances of the same two errors in an email to me titled "WARNING: mariadb-check has found corrupt tables".

      However, these tables are NOT corrupt. There are two errors occurring here which are BOTH due to the table names not being escaped properly:

      • The use of a '-' symbol in the database table name which the script calling mariadb-check isn't escaping
      • The use of a space character in the database table name which the script calling mariadb-check isn't escaping

      The two examples (also showing that they both work when the database and table names are escaped with a back-tick) are:

      MariaDB [(none)]> select count(*) into @discard from mydatabase.mytable-dev;
      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 '-dev' at line 1
      MariaDB [(none)]> select count(*) into @discard from `mydatabase`.`mytable-dev`;
      Query OK, 1 row affected (0.000 sec)
       
      MariaDB [(none)]>

      and

      MariaDB [(none)]> select count(*) into @discard from mydatabase.mytable name;
      ERROR 1146 (42S02): Table 'beer_copy.id' doesn't exist
      MariaDB [(none)]> select count(*) into @discard from `mydatabase`.`mytable name`;
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [(none)]>

      I have traced this down to a the following change to debian/additions/debian-start.inc.sh:
      https://github.com/MariaDB/server/commit/2adaf5c261df948dc89a2c2520000f8f886184b4

      I have fixed my local copy by replacing the 4 instances of the now-superflous '\'' with a single back-tick. The upstream change author seems to have missed that the reason for the apostrophe combination was that the text was previously enclosed with single-quotes. I don't quite understand why the back-ticks were removed.

      Happy to submit a push / merge request of my change into the repository, if I can get access to do so.

      Attachments

        Issue Links

          Activity

            People

              illuusio Tuukka Pasanen
              alexpresland477 Alex Presland
              Votes:
              1 Vote for this issue
              Watchers:
              5 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.