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

data corruption when setting NUMERIC columns to NULL through the python and C++ API

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.1.3
    • 1.1.7, 1.2.0
    • None
    • None
    • 2018-18

    Description

      Using the bulkInsert.setNull() function on a NUMERIC column results in data corruption. The columns and the ones that follow are affected.

      A test case that reproduces this:

      The table

      CREATE TABLE `test_null_decimal3` (
        `id` varchar(128) NOT NULL,
        `num1` decimal(8,6) DEFAULT NULL,
        `num2` decimal(9,6) DEFAULT NULL,
        `b` tinyint(1) DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
      

      Python code usage

      import pymcsapi
      driver = pymcsapi.ColumnStoreDriver(columnstore_config_path)
      bulk_insert = driver.createBulkInsert(db, table, 0, 0)
       
      # INSERT INTO table VALUES ('text', NULL, NULL, 4)
      bulk_insert.setColumn(0, 'text')
      bulk_insert.setNull(1)
      bulk_insert.setNull(2)
      bulk_insert.setColumn(3, 4)
       
      bulk_insert.writeRow()
      bulk_insert.commit()
      

      The commit finishes successfully with no error counts. Querying the table gives this result:

      MariaDB [db]> select * from test_null_decimal3;
      +------+----------+----------+------+
      | id   | num1     | num2     | b    |
      +------+----------+----------+------+
      | text | 0.000000 | 8.388608 |    0 |
      +------+----------+----------+------+
      1 row in set (0.10 sec)
      

      You can see the values for num2 and b are wrong. I've had corruption errors on the table after this:

      2018-04-04 17:27:02 (27472) ERR  : writeToFile: error initializing to-be-compressed buffer for OID 5625;  Error in uncompressing data.  [1652]
      2018-04-04 17:27:02 (27472) ERR  : writeToFileExtentCheck: write token extent failed:  Error in uncompressing data.  [1652]
      2018-04-04 17:27:02 (27472) ERR  : finishParsing: flush error with column ;  Error in uncompressing data.  [1652]
      2018-04-04 17:27:02 (27472) ERR  : setParseComplete completion error; Failed to load table: t;  Error in uncompressing data.  [1652]
      

      Doing the same insert through INSERT or cpimport gives the correct results. I'm running the 1.1.3 release

      Attachments

        Issue Links

          Activity

            People

              jens.rowekamp Jens Röwekamp (Inactive)
              dtheodor Dimitris Theodorou
              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.