~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/crc32.test

  • Committer: Stewart Smith
  • Date: 2009-06-16 03:02:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1065.
  • Revision ID: stewart@flamingspork.com-20090616030259-tn2thqrajk6cappd
ER_NISAMCHK is unused, mark it as so. Thanks to Paul DuBois for researching this for MySQL.

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
# Check for error if no parameter provided
 
21
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
 
22
SELECT CRC32();
 
23
--error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
 
24
SELECT CRC32('foo','bar','zoo');
 
25
 
 
26
# Check that various inputs are processed correctly
 
27
SELECT CRC32('');
 
28
SELECT CRC32(100);
 
29
SELECT CRC32(4294967295);
 
30
SELECT CRC32('a');
 
31
SELECT CRC32('taohuoahusoahusoa haneo uhnteoahu ntoahu saonhu aoeuoa hun');
 
32
 
 
33
DROP TABLE t1;