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

Connect engine: remote smallint unsigned is considered as smallint signed

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1.14, 10.0(EOL), 10.1(EOL)
    • 10.1.16, 10.0.27
    • None
    • 3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux

    Description

      Scenario:

      Remote Server
      ---------------------

      CREATE TABLE a (
      `v` SMALLINT UNSIGNED
      ) Engine = InnoDB;

      INSERT INTO `a` VALUES(40000);

      Local server
      ---------------------

      CREATE TABLE `rem` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='MYSQL' `DBNAME`='db' `SRCDEF`='SELECT * FROM a' `OPTION_LIST`='host=127.0.0.1,port=3301,user=user,password=password';

      SELECT * FROM `rem`;

      Actual result
      -----------------------
      0) `rem` table has `v` column defined as smallint(5).
      1) Value of `v` column is selected as 32767 instead of 40000.
      2) Out of range warning is generated.

      Desired result
      -------------------------
      0) `rem` table has `v` column defined as smallint unsigned.
      1) Value of `v` column is selected as 40000.

      Attachments

        Activity

          Sergey.Antonyuk Sergey Antonyuk created issue -
          Sergey.Antonyuk Sergey Antonyuk made changes -
          Field Original Value New Value
          Description Scenario:

          Remote Server
          ---------------------
          {quote}
          CREATE TABLE a (
              `v` SMALLINT UNSIGNED
          ) Engine = InnoDB;

          INSERT INTO `a` VALUES(40000);
          {quote}

          Local server
          ---------------------
          {quote}
          CREATE TABLE `rem` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='MYSQL' `DBNAME`='db' `SRCDEF`='SELECT * FROM a' `OPTION_LIST`='host=127.0.0.1,port=3301,user=user,password=password';

          SELECT * FROM `rem`;
          {quote}

          Actual result
          -----------------------
          0) `rem` table has `v` column defined as smallint(5).
          1) Value of `v` column is selected as 32767 instead of 40000.
          2) Out of range warning is generated.

          Desired result
          -------------------------
          0) `rem` table has `v` column defined as integer because there is no unsigned smallint datatype in Connect engine.
          1) Value of `v` column is selected as 40000.
          Scenario:

          Remote Server
          ---------------------
          {quote}
          CREATE TABLE a (
              `v` SMALLINT UNSIGNED
          ) Engine = InnoDB;

          INSERT INTO `a` VALUES(40000);
          {quote}

          Local server
          ---------------------
          {quote}
          CREATE TABLE `rem` ENGINE=CONNECT DEFAULT CHARSET=utf8 `TABLE_TYPE`='MYSQL' `DBNAME`='db' `SRCDEF`='SELECT * FROM a' `OPTION_LIST`='host=127.0.0.1,port=3301,user=user,password=password';

          SELECT * FROM `rem`;
          {quote}

          Actual result
          -----------------------
          0) `rem` table has `v` column defined as smallint(5).
          1) Value of `v` column is selected as 32767 instead of 40000.
          2) Out of range warning is generated.

          Desired result
          -------------------------
          0) `rem` table has `v` column defined as smallint unsigned.
          1) Value of `v` column is selected as 40000.
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]

          Thanks for the report.

          elenst Elena Stepanova added a comment - Thanks for the report.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.1 [ 16100 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          Assignee Olivier Bertrand [ bertrandop ]

          This was not specific to smallint but to creating a MySQL table with srcdef.
          A turnaround, waiting to a fixed version, is to manually specifiy the column definitions.

          bertrandop Olivier Bertrand added a comment - This was not specific to smallint but to creating a MySQL table with srcdef. A turnaround, waiting to a fixed version, is to manually specifiy the column definitions.
          bertrandop Olivier Bertrand made changes -
          issue.field.resolutiondate 2016-06-02 17:39:04.0 2016-06-02 17:39:04.369
          bertrandop Olivier Bertrand made changes -
          Fix Version/s 10.0.26 [ 22016 ]
          Fix Version/s 10.1.15 [ 22018 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Confirmed [ 10101 ] Closed [ 6 ]
          bertrandop Olivier Bertrand made changes -
          Fix Version/s 10.1.16 [ 22019 ]
          Fix Version/s 10.1.15 [ 22018 ]
          bertrandop Olivier Bertrand made changes -
          Fix Version/s 10.0.27 [ 22017 ]
          Fix Version/s 10.0.26 [ 22016 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 75762 ] MariaDB v4 [ 150451 ]

          People

            bertrandop Olivier Bertrand
            Sergey.Antonyuk Sergey Antonyuk
            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.