~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_compress.test

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#-- source include/have_compress.inc
2
 
#
3
 
# Test for compress and uncompress functions:
4
 
#
5
 
# Note that this test gives error in the gzip library when running under
6
 
# valgrind, but these warnings can be ignored
7
 
 
8
 
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
9
 
select length(@test_compress_string);
10
 
 
11
 
select uncompress(compress(@test_compress_string));
12
 
explain extended select uncompress(compress(@test_compress_string));
13
 
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
14
 
explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
15
 
select uncompressed_length(compress(@test_compress_string));
16
 
select length(compress(@test_compress_string))<length(@test_compress_string);
17
 
 
18
 
create table t1 (a blob, b blob, c varchar(4));
19
 
insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d ');
20
 
select uncompress(a) from t1;
21
 
select uncompress(b) from t1;
22
 
select concat('|',c,'|') from t1;
23
 
drop table t1;
24
 
 
25
 
select compress("");
26
 
select uncompress("");
27
 
select uncompress(compress(""));
28
 
select uncompressed_length("");
29
 
 
30
 
#
31
 
# errors
32
 
#
33
 
 
34
 
create table t1 (a blob);
35
 
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
36
 
select length(a) from t1;
37
 
select length(uncompress(a)) from t1;
38
 
drop table t1;
39
 
 
40
 
 
41
 
#
42
 
# Bug #5497: a problem with large strings
43
 
# note that when LOW_MEMORY is set the "test" below is meaningless
44
 
#
45
 
 
46
 
set @@max_allowed_packet=1048576*100;
47
 
--replace_result "''" XXX "'1'" XXX
48
 
eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null;
49
 
 
50
 
#
51
 
# Bug #18643: problem with null values
52
 
#
53
 
 
54
 
create table t1(a blob);
55
 
insert into t1 values(NULL), (compress('a'));
56
 
select uncompress(a), uncompressed_length(a) from t1;
57
 
drop table t1;
58
 
 
59
 
#
60
 
# Bug #23254: problem with compress(NULL)
61
 
#
62
 
 
63
 
create table t1(a blob);
64
 
insert into t1 values ('0'), (NULL), ('0');
65
 
--disable_result_log
66
 
select compress(a), compress(a) from t1;
67
 
--enable_result_log
68
 
select compress(a) is null from t1;
69
 
drop table t1;
70
 
 
71
 
--echo End of 4.1 tests
72
 
 
73
 
#
74
 
# Bug #18539: uncompress(d) is null: impossible?
75
 
#
76
 
create table t1 (a varchar(32) not null);
77
 
insert into t1 values ('foo');
78
 
explain select * from t1 where uncompress(a) is null;
79
 
select * from t1 where uncompress(a) is null;
80
 
explain select *, uncompress(a) from t1;
81
 
select *, uncompress(a) from t1;
82
 
select *, uncompress(a), uncompress(a) is null from t1;
83
 
drop table t1;
84
 
 
85
 
--echo End of 5.0 tests