~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_compress.result

  • Committer: Brian Aker
  • Date: 2009-07-11 19:23:04 UTC
  • mfrom: (1089.1.14 merge)
  • Revision ID: brian@gaz-20090711192304-ootijyl5yf9jq9kd
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
select length(compress(@test_compress_string))<length(@test_compress_string);
27
27
length(compress(@test_compress_string))<length(@test_compress_string)
28
28
1
29
 
create table t1 (a text, b char(255), c char(4)) engine=myisam;
 
29
create table t1 (a blob, b blob, c varchar(4));
30
30
insert into t1 (a,b,c) values (compress(@test_compress_string),compress(@test_compress_string),'d ');
31
31
select uncompress(a) from t1;
32
32
uncompress(a)
36
36
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
37
37
select concat('|',c,'|') from t1;
38
38
concat('|',c,'|')
39
 
|d|
 
39
|d |
40
40
drop table t1;
41
41
select compress("");
42
42
compress("")
50
50
select uncompressed_length("");
51
51
uncompressed_length("")
52
52
0
53
 
create table t1 (a text);
 
53
create table t1 (a blob);
54
54
insert t1 values (compress(null)), ('A\0\0\0BBBBBBBB'), (compress(space(50000))), (space(50000));
55
55
select length(a) from t1;
56
56
length(a)
83
83
insert into t1 values ('0'), (NULL), ('0');
84
84
select compress(a), compress(a) from t1;
85
85
select compress(a) is null from t1;
86
 
compress(a) is null
 
86
compress(a) is null 
87
87
0
88
88
1
89
89
0
93
93
insert into t1 values ('foo');
94
94
explain select * from t1 where uncompress(a) is null;
95
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
 
96
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       Using where
99
97
select * from t1 where uncompress(a) is null;
100
98
a
101
99
foo
103
101
Error   1259    ZLIB: Input data corrupted
104
102
explain select *, uncompress(a) from t1;
105
103
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
106
 
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       
 
104
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       
107
105
select *, uncompress(a) from t1;
108
106
a       uncompress(a)
109
107
foo     NULL
110
108
Warnings:
111
109
Error   1259    ZLIB: Input data corrupted
112
110
select *, uncompress(a), uncompress(a) is null from t1;
113
 
a       uncompress(a)   uncompress(a) is null
 
111
a       uncompress(a)   uncompress(a) is null 
114
112
foo     NULL    1
115
113
Warnings:
116
114
Error   1259    ZLIB: Input data corrupted
117
115
Error   1259    ZLIB: Input data corrupted
118
116
drop table t1;
119
117
End of 5.0 tests
 
118
select compress();
 
119
ERROR 42000: Incorrect parameters in the call to native function 'compress'
 
120
select uncompress();
 
121
ERROR 42000: Incorrect parameters in the call to native function 'uncompress'
 
122
select uncompressed_length();
 
123
ERROR 42000: Incorrect parameters in the call to native function 'uncompressed_length'
 
124
select compress('aeou', 'aoeu', 'aoeu');
 
125
ERROR 42000: Incorrect parameters in the call to native function 'compress'
 
126
select uncompress('aoenuthn', 'aoeu');
 
127
ERROR 42000: Incorrect parameters in the call to native function 'uncompress'
 
128
select uncompressed_length('aneohusa','naohuntah','onh');
 
129
ERROR 42000: Incorrect parameters in the call to native function 'uncompressed_length'