~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/r/func_compress.result

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

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#1 */ 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#1 */ 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
Warning 1259    ZLIB: Input data corrupted
 
69
Warning 1256    Uncompressed data size too large; the maximum size is 4194304 (probably, length of uncompressed data was corrupted)
 
70
drop table t1;
 
71
set @@global.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
set @@global.max_allowed_packet=default;
 
76
create table t1(a blob);
 
77
insert into t1 values(NULL), (compress('a'));
 
78
select uncompress(a), uncompressed_length(a) from t1;
 
79
uncompress(a)   uncompressed_length(a)
 
80
NULL    NULL
 
81
a       1
 
82
drop table t1;
 
83
create table t1(a blob);
 
84
insert into t1 values ('0'), (NULL), ('0');
 
85
select compress(a), compress(a) from t1;
 
86
select compress(a) is null from t1;
 
87
compress(a) is null
 
88
0
 
89
1
 
90
0
 
91
drop table t1;
 
92
End of 4.1 tests
 
93
create table t1 (a varchar(32) not null);
 
94
insert into t1 values ('foo');
 
95
explain select * from t1 where uncompress(a) is null;
 
96
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
97
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       NULL
 
98
Warnings:
 
99
Warning 1259    ZLIB: Input data corrupted
 
100
select * from t1 where uncompress(a) is null;
 
101
a
 
102
foo
 
103
Warnings:
 
104
Warning 1259    ZLIB: Input data corrupted
 
105
explain select *, uncompress(a) from t1;
 
106
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
107
1       SIMPLE  t1      system  NULL    NULL    NULL    NULL    1       NULL
 
108
select *, uncompress(a) from t1;
 
109
a       uncompress(a)
 
110
foo     NULL
 
111
Warnings:
 
112
Warning 1259    ZLIB: Input data corrupted
 
113
select *, uncompress(a), uncompress(a) is null from t1;
 
114
a       uncompress(a)   uncompress(a) is null
 
115
foo     NULL    1
 
116
Warnings:
 
117
Warning 1259    ZLIB: Input data corrupted
 
118
Warning 1259    ZLIB: Input data corrupted
 
119
drop table t1;
 
120
CREATE TABLE t1 (c1 INT);
 
121
INSERT INTO t1 VALUES (1), (1111), (11111);
 
122
SELECT UNCOMPRESS(c1), UNCOMPRESSED_LENGTH(c1) FROM t1;
 
123
UNCOMPRESS(c1)  UNCOMPRESSED_LENGTH(c1)
 
124
NULL    NULL
 
125
NULL    NULL
 
126
NULL    825307441
 
127
EXPLAIN EXTENDED SELECT * FROM (SELECT UNCOMPRESSED_LENGTH(c1) FROM t1) AS s;
 
128
DROP TABLE t1;
 
129
End of 5.0 tests