~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/suite/crc32/t/crc32.test

  • Committer: Monty Taylor
  • Date: 2009-03-03 08:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 910.
  • Revision ID: mordred@inaugust.com-20090303080810-gwtc2ppv93od4knp
Hardcoding /opt/csw/include in was doing some bad things with gettext.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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");
5
 
 
6
 
7
 
# Check that the hash of a constant is identical to the hash
8
 
# of the same constant stored in a table column.
9
 
#
10
 
--disable_warnings
11
 
DROP TABLE IF EXISTS t1;
12
 
--enable_warnings
13
 
CREATE TABLE t1
14
 
(
15
 
  some_text VARCHAR(100) NOT NULL
16
 
);
17
 
INSERT INTO t1 VALUES ("I love testing");
18
 
SELECT CRC32("I love testing") = CRC32(some_text) FROM t1;
19
 
 
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;
23
 
 
24
 
# Check for error if no parameter provided
25
 
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
26
 
SELECT CRC32();
27
 
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
28
 
SELECT CRC32('foo','bar','zoo');
29
 
 
30
 
# Check that various inputs are processed correctly
31
 
SELECT CRC32('');
32
 
SELECT CRC32(100);
33
 
SELECT CRC32(4294967295);
34
 
SELECT CRC32('a');
35
 
SELECT CRC32('taohuoahusoahusoa haneo uhnteoahu ntoahu saonhu aoeuoa hun');
36
 
 
37
 
DROP TABLE t1;