Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
N/A
-
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
- is caused by
-
MDEV-27208 Implement 2-ary CRC32() and the CRC32C() function
- Closed