Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-895

INSERT after ALTER TABLE can corrupt HWM

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.0.10, 1.1.0
    • 1.0.12, 1.1.1
    • None
    • 2017-18, 2017-19, 2017-20, 2017-21

    Description

      This is the test case:

      drop table if exists c1;
      create table c1 (a int, b bigint, c tinyint, d int) engine=columnstore;
      insert into c1 values (12345,54321,21,98765);
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
      insert into c1 select * from c1;
       
      alter table c1 drop column c;
      alter table c1 add column c bigint;
      start transaction;
      insert into c1 select * from c1;
      commit;
      insert into c1 select * from c1;
      

      The last insert will error because the previous insert (which is in a transaction to use DMLProc instead of cpimport) has corrupted the HWMs. This is the resulting HWMs (the 4 byte HWMs should match):

      *************************** 1. row ***************************
                OBJECT_ID: 16306
              OBJECT_TYPE: Column
      LOGICAL_BLOCK_START: 834560
        LOGICAL_BLOCK_END: 838655
                MIN_VALUE: 12345
                MAX_VALUE: 12345
                    WIDTH: 4
                   DBROOT: 1
             PARTITION_ID: 0
               SEGMENT_ID: 0
             BLOCK_OFFSET: 0
               MAX_BLOCKS: 4096
          HIGH_WATER_MARK: 67
                    STATE: Valid
                   STATUS: Available
                DATA_SIZE: 557056
      *************************** 2. row ***************************
                OBJECT_ID: 16307
              OBJECT_TYPE: Column
      LOGICAL_BLOCK_START: 838656
        LOGICAL_BLOCK_END: 846847
                MIN_VALUE: NULL
                MAX_VALUE: NULL
                    WIDTH: 8
                   DBROOT: 1
             PARTITION_ID: 0
               SEGMENT_ID: 0
             BLOCK_OFFSET: 0
               MAX_BLOCKS: 8192
          HIGH_WATER_MARK: 135
                    STATE: Invalid
                   STATUS: Available
                DATA_SIZE: 1114112
      *************************** 3. row ***************************
                OBJECT_ID: 16309
              OBJECT_TYPE: Column
      LOGICAL_BLOCK_START: 847872
        LOGICAL_BLOCK_END: 851967
                MIN_VALUE: NULL
                MAX_VALUE: NULL
                    WIDTH: 4
                   DBROOT: 1
             PARTITION_ID: 0
               SEGMENT_ID: 0
             BLOCK_OFFSET: 0
               MAX_BLOCKS: 4096
          HIGH_WATER_MARK: 119
                    STATE: Invalid
                   STATUS: Available
                DATA_SIZE: 983040
      *************************** 4. row ***************************
                OBJECT_ID: 16310
              OBJECT_TYPE: Column
      LOGICAL_BLOCK_START: 851968
        LOGICAL_BLOCK_END: 860159
                MIN_VALUE: NULL
                MAX_VALUE: NULL
                    WIDTH: 8
                   DBROOT: 1
             PARTITION_ID: 0
               SEGMENT_ID: 0
             BLOCK_OFFSET: 0
               MAX_BLOCKS: 8192
          HIGH_WATER_MARK: 135
                    STATE: Invalid
                   STATUS: Available
                DATA_SIZE: 1114112
      4 rows in set (0.19 sec)
      

      Attachments

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            LinuxJedi Andrew Hutchings (Inactive)
            Votes:
            1 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.