1
by brian
clean slate |
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 text, b char(255), c char(4)) engine=myisam;
|
|
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 text); |
|
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 system NULL NULL NULL NULL 1 |
|
97 |
Warnings: |
|
98 |
Error 1259 ZLIB: Input data corrupted |
|
99 |
select * from t1 where uncompress(a) is null; |
|
100 |
a |
|
101 |
foo |
|
102 |
Warnings: |
|
103 |
Error 1259 ZLIB: Input data corrupted |
|
104 |
explain select *, uncompress(a) from t1; |
|
105 |
id select_type table type possible_keys key key_len ref rows Extra |
|
106 |
1 SIMPLE t1 system NULL NULL NULL NULL 1 |
|
107 |
select *, uncompress(a) from t1; |
|
108 |
a uncompress(a) |
|
109 |
foo NULL |
|
110 |
Warnings: |
|
111 |
Error 1259 ZLIB: Input data corrupted |
|
112 |
select *, uncompress(a), uncompress(a) is null from t1; |
|
113 |
a uncompress(a) uncompress(a) is null |
|
114 |
foo NULL 1 |
|
115 |
Warnings: |
|
116 |
Error 1259 ZLIB: Input data corrupted |
|
117 |
Error 1259 ZLIB: Input data corrupted |
|
118 |
drop table t1; |
|
119 |
End of 5.0 tests |