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

InnoDB: Strange printed result on SELECT DISTINCT col_bit ... ORDER BY col_bit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.5.18, 10.6.10
    • Fix Version/s: 10.5, 10.6
    • Component/s: Data types
    • Labels:
      None

      Description

      CREATE TABLE `t_innodb` ( `pk` int(11) NOT NULL, `col_bit` bit(29) NOT NULL DEFAULT b'0',  PRIMARY KEY (`pk`))  ENGINE = InnoDB DEFAULT CHARSET=latin1;
      CREATE TABLE `t_myisam` ( `pk` int(11) NOT NULL, `col_bit` bit(29) NOT NULL DEFAULT b'0',  PRIMARY KEY (`pk`))  ENGINE = MyISAM DEFAULT CHARSET=latin1;
      INSERT INTO `t_innodb` ( `pk` ) VALUES ( 38502 ) ;
      INSERT INTO t_myisam SELECT * FROM t_innodb;
      SELECT `col_bit` FROM `t_innodb`;
      col_bit
                        <= I guess the value is just not printable like in several other cases below.
      SELECT `col_bit` FROM `t_myisam`;
      col_bit
       
      SELECT `col_bit` FROM `t_innodb` ORDER BY `col_bit`;
      col_bit
       
      SELECT `col_bit` FROM `t_myisam` ORDER BY `col_bit`;
      col_bit
       
      SELECT DISTINCT `col_bit` FROM `t_innodb` ORDER BY `pk`;
      col_bit
       
      SELECT DISTINCT `col_bit` FROM `t_myisam` ORDER BY `pk`;
      col_bit
       
      SELECT DISTINCT `col_bit` FROM `t_innodb` ORDER BY `col_bit`;
      col_bit
      0                     <== Why that?
      SELECT DISTINCT `col_bit` FROM `t_myisam` ORDER BY `col_bit`;
      col_bit
       
      CREATE TABLE t_aux AS SELECT DISTINCT `col_bit` FROM `t_innodb` ORDER BY `pk`;
      SHOW CREATE TABLE t_aux;
      Table   Create Table
      t_aux   CREATE TABLE `t_aux` (
        `col_bit` bit(29) NOT NULL DEFAULT b'0'
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      SELECT * FROM t_aux;
      col_bit
                         
      SELECT pk, col_bit FROM t_innodb INNER JOIN t_myisam USING (pk, col_bit);
      pk      col_bit
      38502                <==  This looks reasonable.
      DROP TABLE t_innodb;
      DROP TABLE t_myisam;
      DROP TABLE t_aux;
      
      

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            mleich Matthias Leich
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.