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

Altering decimal column on a TokuDB table can corrupt data

    XMLWordPrintable

Details

    Description

      When changing a decimal column's scale but not precision on a tokudb column (and keeping everything else the same) the column's data can be corrupted.

      NB Changing NULL/NOT NULL, SIGNED/UNSIGNED or decimal precision will all result in things working properly.

      Here's a test case that can reproduce the problem:

      create table dec_test( 
      	val decimal(9,2) NOT NULL
      ) ENGINE = TOKUDB;
       
      INSERT INTO `dec_test` VALUES (0);
      INSERT INTO `dec_test` VALUES (10);
      INSERT INTO `dec_test` VALUES (20);
       
      ALTER TABLE `dec_test` CHANGE COLUMN `val` `val` DECIMAL(9,4) NOT NULL; 
       
      select  * from dec_test;
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jeffscott2 Jeff
            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.