1
# Verify that CRC32() function returns a deterministic result
2
# when successively supplied with the same constant.
3
SELECT CRC32("I love testing");
4
SELECT CRC32("I love testing");
7
# Check that the hash of a constant is identical to the hash
8
# of the same constant stored in a table column.
11
DROP TABLE IF EXISTS t1;
15
some_text VARCHAR(100) NOT NULL
17
INSERT INTO t1 VALUES ("I love testing");
18
SELECT CRC32("I love testing") = CRC32(some_text) FROM t1;
20
# Result of calls to the CRC32 function always produce a 64-byte value
21
SELECT BIT_LENGTH(CRC32("I love testing"));
22
SELECT BIT_LENGTH(CRC32(some_text)) FROM t1;
24
# Check for error if no parameter provided
25
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
27
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
28
SELECT CRC32('foo','bar','zoo');
30
# Check that various inputs are processed correctly
33
SELECT CRC32(4294967295);
35
SELECT CRC32('taohuoahusoahusoa haneo uhnteoahu ntoahu saonhu aoeuoa hun');