~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_compress.result

  • 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
 
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
2
 
@test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '
3
 
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
4
 
select length(@test_compress_string);
5
 
length(@test_compress_string)
6
 
117
7
 
select uncompress(compress(@test_compress_string));
8
 
uncompress(compress(@test_compress_string))
9
 
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
10
 
explain extended select uncompress(compress(@test_compress_string));
11
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
12
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
13
 
Warnings:
14
 
Note    1003    select uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
15
 
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
16
 
uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
17
 
1
18
 
explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
19
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
20
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
21
 
Warnings:
22
 
Note    1003    select (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
23
 
select uncompressed_length(compress(@test_compress_string));
24
 
uncompressed_length(compress(@test_compress_string))
25
 
117
26
 
select length(compress(@test_compress_string))<length(@test_compress_string);
27
 
length(compress(@test_compress_string))<length(@test_compress_string)
28
 
1
29
 
create table t1 (a blob, b blob, c varchar(4));
30
 
insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d ');
31
 
select uncompress(a) from t1;
32
 
uncompress(a)
33
 
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
34
 
select uncompress(b) from t1;
35
 
uncompress(b)
36
 
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
37
 
select concat('|',c,'|') from t1;
38
 
concat('|',c,'|')
39
 
|d |
40
 
drop table t1;
41
 
select compress("");
42
 
compress("")
43
 
 
44
 
select uncompress("");
45
 
uncompress("")
46
 
 
47
 
select uncompress(compress(""));
48
 
uncompress(compress(""))
49
 
 
50
 
select uncompressed_length("");
51
 
uncompressed_length("")
52
 
0
53
 
create table t1 (a blob);
54
 
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
55
 
select length(a) from t1;
56
 
length(a)
57
 
NULL
58
 
12
59
 
76
60
 
50000
61
 
select length(uncompress(a)) from t1;
62
 
length(uncompress(a))
63
 
NULL
64
 
NULL
65
 
50000
66
 
NULL
67
 
Warnings:
68
 
Error   1259    ZLIB: Input data corrupted
69
 
Error   1256    Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
70
 
drop table t1;
71
 
set @@max_allowed_packet=1048576*100;
72
 
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
73
 
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
74
 
0
75
 
create table t1(a blob);
76
 
insert into t1 values(NULL), (compress('a'));
77
 
select uncompress(a), uncompressed_length(a) from t1;
78
 
uncompress(a)   uncompressed_length(a)
79
 
NULL    NULL
80
 
a       1
81
 
drop table t1;
82
 
create table t1(a blob);
83
 
insert into t1 values ('0'), (NULL), ('0');
84
 
select compress(a), compress(a) from t1;
85
 
select compress(a) is null from t1;
86
 
compress(a) is null 
87
 
0
88
 
1
89
 
0
90
 
drop table t1;
91
 
End of 4.1 tests
92
 
create table t1 (a varchar(32) not null);
93
 
insert into t1 values ('foo');
94
 
explain select * from t1 where uncompress(a) is null;
95
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
96
 
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using where
97
 
select * from t1 where uncompress(a) is null;
98
 
a
99
 
foo
100
 
Warnings:
101
 
Error   1259    ZLIB: Input data corrupted
102
 
explain select *, uncompress(a) from t1;
103
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
104
 
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       
105
 
select *, uncompress(a) from t1;
106
 
a       uncompress(a)
107
 
foo     NULL
108
 
Warnings:
109
 
Error   1259    ZLIB: Input data corrupted
110
 
select *, uncompress(a), uncompress(a) is null from t1;
111
 
a       uncompress(a)   uncompress(a) is null 
112
 
foo     NULL    1
113
 
Warnings:
114
 
Error   1259    ZLIB: Input data corrupted
115
 
Error   1259    ZLIB: Input data corrupted
116
 
drop table t1;
117
 
End of 5.0 tests