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

2-argument CRC32 call upon Columnstore table returns a wrong value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • N/A
    • 6.3.1
    • PrimProc
    • None

    Description

      preview-10.8-MDEV-27265-misc 6e615c62b8

      MariaDB [test]> create table tc (a int unsigned, b varchar(8)) engine=Columnstore;
      Query OK, 0 rows affected (0.374 sec)
       
      MariaDB [test]> insert into tc values (1,'foo');
      Query OK, 1 row affected (0.224 sec)
       
      MariaDB [test]> select a, b, crc32(a,b), crc32(a,'foo'), crc32(1,b), crc32(1,'foo') from tc;
      +------+------+------------+----------------+------------+----------------+
      | a    | b    | crc32(a,b) | crc32(a,'foo') | crc32(1,b) | crc32(1,'foo') |
      +------+------+------------+----------------+------------+----------------+
      |    1 | foo  | 2212294583 |     2212294583 | 2212294583 |     2377191190 |
      +------+------+------------+----------------+------------+----------------+
      1 row in set (0.076 sec)
      

      So, whichever argument of the function is read from the table, the result ends up to be wrong.

      With a one-argument version it seems to work all right:

      MariaDB [test]> select a, b, crc32(b), crc32('foo') from tc;
      +------+------+------------+--------------+
      | a    | b    | crc32(b)   | crc32('foo') |
      +------+------+------------+--------------+
      |    1 | foo  | 2356372769 |   2356372769 |
      +------+------+------------+--------------+
      1 row in set (0.011 sec)
      

      With a two-argument function and a more conventional engine it also works all right:

      MariaDB [test]> create table ti (a int unsigned, b varchar(8)) engine=InnoDB;
      Query OK, 0 rows affected (0.012 sec)
       
      MariaDB [test]> insert into ti values (1,'foo');
      Query OK, 1 row affected (0.002 sec)
       
      MariaDB [test]> select a, b, crc32(a,b), crc32(a,'foo'), crc32(1,b), crc32(1,'foo') from ti;
      +------+------+------------+----------------+------------+----------------+
      | a    | b    | crc32(a,b) | crc32(a,'foo') | crc32(1,b) | crc32(1,'foo') |
      +------+------+------------+----------------+------------+----------------+
      |    1 | foo  | 2377191190 |     2377191190 | 2377191190 |     2377191190 |
      +------+------+------------+----------------+------------+----------------+
      1 row in set (0.000 sec)
      

      CRC32C function is not a subject of this report, because it's rejected as unsupported by Columnstore right away:

      MariaDB [test]> select crc32c(a,b) from tc;
      ERROR 1178 (42000): The storage engine for the table doesn't support MCS-1001: Function 'crc32c' isn't supported.
      

      Attachments

        Issue Links

          Activity

            People

              drrtuy Roman
              elenst Elena Stepanova
              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.