2003-04-10 02:50:30 +02:00
|
|
|
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
|
|
|
|
@test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '
|
|
|
|
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
select length(@test_compress_string);
|
|
|
|
length(@test_compress_string)
|
|
|
|
117
|
|
|
|
select uncompress(compress(@test_compress_string));
|
|
|
|
uncompress(compress(@test_compress_string))
|
|
|
|
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
2003-10-30 11:57:26 +01:00
|
|
|
explain extended select uncompress(compress(@test_compress_string));
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
|
|
Warnings:
|
2004-05-13 22:47:20 +02:00
|
|
|
Note 1003 select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
|
2003-04-10 02:50:30 +02:00
|
|
|
select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
|
|
|
|
uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
|
|
|
|
1
|
2003-10-30 11:57:26 +01:00
|
|
|
explain extended select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
|
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
|
|
Warnings:
|
2004-05-13 22:47:20 +02:00
|
|
|
Note 1003 select sql_no_cache (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
|
2003-04-10 02:50:30 +02:00
|
|
|
select uncompressed_length(compress(@test_compress_string));
|
|
|
|
uncompressed_length(compress(@test_compress_string))
|
|
|
|
117
|
|
|
|
select length(compress(@test_compress_string))<length(@test_compress_string);
|
|
|
|
length(compress(@test_compress_string))<length(@test_compress_string)
|
|
|
|
1
|
2003-12-10 05:31:42 +01:00
|
|
|
create table t1 (a text, b char(255), c char(4)) engine=myisam;
|
2003-04-10 02:50:30 +02:00
|
|
|
insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d ');
|
|
|
|
select uncompress(a) from t1;
|
|
|
|
uncompress(a)
|
|
|
|
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
select uncompress(b) from t1;
|
|
|
|
uncompress(b)
|
|
|
|
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
select concat('|',c,'|') from t1;
|
|
|
|
concat('|',c,'|')
|
|
|
|
|d|
|
|
|
|
drop table t1;
|
2003-04-23 00:41:47 +02:00
|
|
|
select compress("");
|
|
|
|
compress("")
|
|
|
|
|
|
|
|
select uncompress("");
|
|
|
|
uncompress("")
|
|
|
|
|
|
|
|
select uncompress(compress(""));
|
|
|
|
uncompress(compress(""))
|
|
|
|
|
|
|
|
select uncompressed_length("");
|
|
|
|
uncompressed_length("")
|
|
|
|
0
|
2003-10-12 15:16:45 +02:00
|
|
|
create table t1 (a text);
|
|
|
|
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
|
|
|
|
select length(a) from t1;
|
|
|
|
length(a)
|
2003-09-19 09:25:03 +02:00
|
|
|
NULL
|
2003-10-12 15:16:45 +02:00
|
|
|
12
|
|
|
|
76
|
|
|
|
50000
|
|
|
|
select length(uncompress(a)) from t1;
|
|
|
|
length(uncompress(a))
|
2003-09-19 09:25:03 +02:00
|
|
|
NULL
|
2003-10-12 15:16:45 +02:00
|
|
|
NULL
|
|
|
|
50000
|
|
|
|
NULL
|
|
|
|
Warnings:
|
2004-02-28 23:36:41 +01:00
|
|
|
Error 1259 ZLIB: Input data corrupted
|
2004-06-15 22:38:36 +02:00
|
|
|
Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
|
2003-10-12 15:16:45 +02:00
|
|
|
drop table t1;
|
2004-09-13 15:43:59 +02:00
|
|
|
set @@max_allowed_packet=1048576*100;
|
2004-11-28 16:31:14 +01:00
|
|
|
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
|
|
|
|
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
|
2004-09-16 12:01:12 +02:00
|
|
|
0
|