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

Surprising limit for varchar field for CONNECT database with ODBC

    XMLWordPrintable

Details

    Description

      Varchar size in the following case is limited to 203. I don't know how to extend it.
      DDL:

      drop table if exists `lite_test`;
      create table lite_test (
      `id` INT(10) UNSIGNED NOT NULL,
      `name` varchar(203) NOT NULL
      )
      ENGINE=CONNECT READONLY=1 TABLE_TYPE=ODBC tabname='test'
      CONNECTION='DSN=SQLite3 Datasource;Database=C:\\Download
      db.sqlite'
      CHARSET=utf8 DATA_CHARSET=utf8;

      And now:

      SELECT * FROM `lite_test` ORDER BY `name` ASC /* OK */

      But:

      ALTER TABLE `lite_test` CHANGE `name` `name` VARCHAR(205) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

      SELECT * FROM `lite_test` ORDER BY `name` ASC

      Throws an error:
      " ERROR #1032 - Can't find record in 'lite_test'. "
      But without ORDER BY clause works as expected.

      ENV:

      connect conv size 8,192
      connect exact info OFF
      connect indx map OFF
      connect json grp size 10
      connect timeout 10
      connect type conv NO
      connect use tempfile AUTO
      connect work size 67,108,864
      connect xtrace 0

      SQLITE DDL:

      DROP TABLE IF EXISTS "test";
      CREATE TABLE "test" ("id" INTEGER, "name" TEXT);
      INSERT INTO "test" VALUES(1,'test');
      INSERT INTO "test" VALUES(2,'test2');
      INSERT INTO "test" VALUES(3,'test3');

      Attachments

        1. db.sqlite
          128 kB
          Artur Formella

        Activity

          People

            bertrandop Olivier Bertrand
            a.formella Artur Formella
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.