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

connect table truncates table column defined as an utf8 char string

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.4.21, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
    • N/A
    • None
    • Linux RH8

    Description

      After upgrading MariaDB from 10.4.12 to 10.4.21, we observed problems on existing connect tables:
      Result set fetched
      SQLWarning:

      1) Code: 1105 --- Out of range value for column col1 at row 2
      2) Code: 1366 --- Incorrect string value: '\xC3' for column `lanm2434`.`testconnect`.`col1` at row 2
      3) Code: 1105 --- Out of range value glac� for column 'col1' at row 2
      

      The query is:
      select 'testconnect' , col1, length(col1) , char_length(col1) from lanm2434.testconnect;

      Looking at the column size in bytes and chars on the table and connect table we can see difference in count for column with multi-bytes char:

      select 'testtable' , col1, length(col1)  , char_length(col1) from lanm2434.testtable 
      union
      select 'testconnect' , col1, length(col1)  , char_length(col1) from lanm2434.testconnect ;
       
      testtable    col1   length(col1)  char_length(col1)  
      -----------  -----  ------------  -----------------  
      testtable    glace  5             5                  
      testtable    glacé  6             5                  
      testconnect  glace  5             5                  
      testconnect  glac?  5             5                  
      

      And, of course, the accentuated character is not printed as bytes of the character is truncated.

      Steps to reproduce:

      CREATE TABLE `testtable` (
        `col1` char(5) 
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
       
      INSERT INTO `lanm2434`.`testtable` (`col1`) VALUES ('glace');
      INSERT INTO `lanm2434`.`testtable` (`col1`) VALUES ('glacé');
       
      CREATE or REPLACE TABLE `testconnect` ENGINE=CONNECT DEFAULT CHARSET=utf8 
      CONNECTION='mysql://lanm2434:pppppppp@hostname:3306/lanm2434/testtable' `TABLE_TYPE`='mysql';
      

      Attachments

        Issue Links

          Activity

            marc.langevin@usherbrooke.ca Marc added a comment -

            Hi, have you been able to reproduce the problem? Need any other information?

            marc.langevin@usherbrooke.ca Marc added a comment - Hi, have you been able to reproduce the problem? Need any other information?
            alice Alice Sherepa added a comment -

            Thank you, I could repeat it on current 10.2-10.6, regression since 10.2.37
            test for mtr (run from connect suite) :

            -- source include/have_innodb.inc
             
            set names utf8;
            let $PORT= select @@port;
             
            CREATE TABLE t1 ( col1 char(5)) engine=innodb DEFAULT charset=utf8;
            INSERT INTO t1 (col1) VALUES ('glace');
            INSERT INTO t1 (col1) VALUES ('glacé');
            select * from t1;
             
            --eval CREATE  TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
             
            SHOW CREATE TABLE t2;
            SELECT * FROM t2;
            

            alice Alice Sherepa added a comment - Thank you, I could repeat it on current 10.2-10.6, regression since 10.2.37 test for mtr (run from connect suite) : -- source include/have_innodb.inc   set names utf8; let $PORT= select @@port;   CREATE TABLE t1 ( col1 char (5)) engine=innodb DEFAULT charset=utf8; INSERT INTO t1 (col1) VALUES ( 'glace' ); INSERT INTO t1 (col1) VALUES ( 'glacé' ); select * from t1;   --eval CREATE TABLE t2 ENGINE=CONNECT DEFAULT CHARSET=utf8 TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'   SHOW CREATE TABLE t2; SELECT * FROM t2;
            marc.langevin@usherbrooke.ca Marc added a comment -

            Hi,

            Any information when this will be fixed?

            Regards,

            Marc

            marc.langevin@usherbrooke.ca Marc added a comment - Hi, Any information when this will be fixed? Regards, Marc
            long.skinny.boy long.skinny.boy added a comment - - edited

            Hmm, it looks like I have a similar problem MDEV-28489

            It seems to me that the problem started with the updated version Connect 1.07.0002.
            Because there is no problem in 10.5.8, but in 10.5.9 there is, and accordingly there is in 10.6.0, 10.4.18, etc.

            long.skinny.boy long.skinny.boy added a comment - - edited Hmm, it looks like I have a similar problem MDEV-28489 It seems to me that the problem started with the updated version Connect 1.07.0002. Because there is no problem in 10.5.8, but in 10.5.9 there is, and accordingly there is in 10.6.0, 10.4.18, etc.

            Closing this one as a duplicate. It is the same problem and I included the test for this ticket in the fix for the other one.

            TheLinuxJedi Andrew Hutchings (Inactive) added a comment - Closing this one as a duplicate. It is the same problem and I included the test for this ticket in the fix for the other one.

            People

              TheLinuxJedi Andrew Hutchings (Inactive)
              marc.langevin@usherbrooke.ca Marc
              Votes:
              1 Vote for this issue
              Watchers:
              8 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.