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

Unescaped table name during detection of table structure

Details

    Description

      Engine CONNECT doesn't escape table name when autodetecting table structure for TABLE_TYPE=MYSQL using SHOW columns FROM source_table.

      That means that following query fails:

      CREATE TABLE new_table ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://user:pass@hostname/db_name/85e3adc9789111e7960b00163e6c8245'
      

      Escaping table name within the CREATE doesn't help. The CREATE works, but the engine retrieves data using invalid double escaped query

      SELECT * FROM ``85e3adc9789111e7960b00163e6c8245``.
      

      The create works fine with explicit definition of columns.

      Attachments

        Activity

          pavel_hadac Pavel Hadač created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Description Engine CONNECT doesn't escape table name when autodetecting table structure for *TABLE_TYPE=MYSQL* using *SHOW columns FROM source_table*.

          That means that following query fails:

          CREATE TABLE new_table ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://user:pass@hostname/db_name/85e3adc9789111e7960b00163e6c8245'

          Escaping table name within the CREATE doesn't help. The CREATE works, but the engine retrieves data using invalid double escaped query SELECT * FROM ``85e3adc9789111e7960b00163e6c8245``.

          The create works fine with explicit definition of columns.
          Engine CONNECT doesn't escape table name when autodetecting table structure for *TABLE_TYPE=MYSQL* using *SHOW columns FROM source_table*.

          That means that following query fails:

          {code:sql}
          CREATE TABLE new_table ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://user:pass@hostname/db_name/85e3adc9789111e7960b00163e6c8245'
          {code}

          Escaping table name within the CREATE doesn't help. The CREATE works, but the engine retrieves data using invalid double escaped query
          {code:sql}
          SELECT * FROM ``85e3adc9789111e7960b00163e6c8245``.
          {code}

          The create works fine with explicit definition of columns.
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Fix Version/s 10.2 [ 14601 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          Affects Version/s 10.2 [ 14601 ]
          Assignee Olivier Bertrand [ bertrandop ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.0 [ 16000 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.1 [ 16100 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 81926 ] MariaDB v4 [ 143962 ]

          People

            bertrandop Olivier Bertrand
            pavel_hadac Pavel Hadač
            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.