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

Wrong comparision of BLOB's empty preffix with non-preffixed BLOB causes rows count mismatch for clustered and secondary indexes during non-locking read

    XMLWordPrintable

    Details

      Description

      origin/10.7 commit 3351dfaab0599268eaf25f9d6995ef128910a8b9
       
      SET GLOBAL default_storage_engine = 'InnoDB' ;
      SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION' ;
      CREATE TABLE IF NOT EXISTS t1 ( col_text TEXT NOT NULL, KEY ( col_text(9) ) ) ENGINE = InnoDB ROW_FORMAT = Dynamic ;
      SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ;
      INSERT INTO t1 (col_text) VALUES ( REPEAT(SUBSTR(CAST( 24 - 1 AS CHAR),1,1), @fill_amount) ) ;
      UPDATE t1 SET col_text = REPEAT(SUBSTR(CAST( NULL AS CHAR),1,1), @fill_amount) ;
      Warnings:
      Warning 1048    Column 'col_text' cannot be null
      UPDATE t1 SET col_text = REPEAT(SUBSTR(CAST( NULL AS CHAR),1,1), @fill_amount) ;
      Warnings:
      Warning 1048    Column 'col_text' cannot be null
      UPDATE t1 SET col_text = REPEAT(SUBSTR(CAST( 18 AS CHAR),1,1), @fill_amount) ;
      CHECK TABLE t1 ;
      Table   Op      Msg_type        Msg_text
      test.t1 check   Warning InnoDB: Index 'col_text' contains 2 entries, should be 1.
      test.t1 check   error   Corrupt
       
      I cannot exclude that the uploaded MTR test contains more SQL than required for showing the problem.
      Warning:
      The layout of the table with one column only comes from the attempt to get the smallest test possible.
      In case the table contains additional columns of type INT and/or CHAR/VARCHAR I get the same bad effect.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vlad.lesin Vladislav Lesin
              Reporter:
              mleich Matthias Leich
              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.