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

ALTER TABLE looses the connection string

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.10
    • 10.0.11
    • None

    Description

      After creating a table with a connection string, if ALTER TABLE is used, the connection string is lost. For instance:

      CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC tabname='lite' CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
       
      SHOW CREATE TABLE t1;
      CREATE TABLE `t1` (
        `ID` int(9) DEFAULT NULL,
        `nom` varchar(12) NOT NULL,
        `nais` datetime DEFAULT NULL,
        `rem` varchar(32) DEFAULT NULL
      ) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8'

      Now if I do:

      ALTER TABLE t1 MODIFY COLUMN nom VARCHAR(13) NOT NULL;
      SHOW CREATE TABLE t1;
      CREATE TABLE `t1` (
        `ID` int(9) DEFAULT NULL,
        `nom` varchar(13) NOT NULL,
        `nais` datetime DEFAULT NULL,
        `rem` varchar(32) DEFAULT NULL
      ) ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8';

      This has not been reported before CONNECT was implemented because the only other engine using connection string was FEDERATED(X) that does not support ALTER TABLE.

      Attachments

        Activity

          bertrandop Olivier Bertrand created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Assignee Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Affects Version/s 10.0.10 [ 14500 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0.11 [ 15200 ]
          serg Sergei Golubchik made changes -
          Labels plugins
          bertrandop Olivier Bertrand made changes -
          Description After creating a table with a connection string, if ALTER TABLE is used, the connection string is lost. For instance:
          {code}
          CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC tabname='lite' CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;

          SHOW CREATE TABLE t1;
          CREATE TABLE `t1` (
            `ID` int(9) DEFAULT NULL,
            `nom` varchar(12) NOT NULL,
            `nais` datetime DEFAULT NULL,
            `rem` varchar(32) DEFAULT NULL
          ) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8'
          {code}
          Now if I do:
          {code}
          ALTER TABLE t1 MODIFY COLUMN nom VARCHAR(13) NOT NULL;
          SHOW CREATE TABLE t1;
          CREATE TABLE `t1` (
            `ID` int(9) DEFAULT NULL,
            `nom` varchar(13) NOT NULL,
            `nais` datetime DEFAULT NULL,
            `rem` varchar(32) DEFAULT NULL
          ) ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8';
          {code}

          This has not been reported before CONNECT was implemented because the only other engine using connection string was FEDERATED(X) that does not support ALTER TABLE.


          After creating a table with a connection string, if ALTER TABLE is used, the connection string is lost. For instance:
          {code:sql}
          CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC tabname='lite' CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;

          SHOW CREATE TABLE t1;
          CREATE TABLE `t1` (
            `ID` int(9) DEFAULT NULL,
            `nom` varchar(12) NOT NULL,
            `nais` datetime DEFAULT NULL,
            `rem` varchar(32) DEFAULT NULL
          ) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='Driver=SQLite3 ODBC Driver;Database=test.sqlite3;NoWCHAR=yes' `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8'
          {code}
          Now if I do:
          {code:sql}
          ALTER TABLE t1 MODIFY COLUMN nom VARCHAR(13) NOT NULL;
          SHOW CREATE TABLE t1;
          CREATE TABLE `t1` (
            `ID` int(9) DEFAULT NULL,
            `nom` varchar(13) NOT NULL,
            `nais` datetime DEFAULT NULL,
            `rem` varchar(32) DEFAULT NULL
          ) ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='ODBC' `TABNAME`='lite' `DATA_CHARSET`='utf8';
          {code}

          This has not been reported before CONNECT was implemented because the only other engine using connection string was FEDERATED(X) that does not support ALTER TABLE.


          serg Sergei Golubchik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Status Stalled [ 10000 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 38830 ] MariaDB v2 [ 43843 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 43843 ] MariaDB v3 [ 64131 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 64131 ] MariaDB v4 [ 147783 ]

          People

            serg Sergei Golubchik
            bertrandop Olivier Bertrand
            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.