mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	mysql-test/r/func_compress.result: Fix for bug #18643: crazy UNCOMPRESS(). - test-case mysql-test/t/func_compress.test: Fix for bug #18643: crazy UNCOMPRESS(). - test-case sql/item_strfunc.cc: Fix for bug #18643: crazy UNCOMPRESS(). - set null_value.
		
			
				
	
	
		
			82 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 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 
 | |
| 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:
 | |
| Note	1003	select sql_no_cache uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`
 | |
| select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
 | |
| uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
 | |
| 1
 | |
| 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:
 | |
| 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)`
 | |
| 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
 | |
| create table t1 (a text, b char(255), c char(4)) engine=myisam;
 | |
| 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;
 | |
| select compress("");
 | |
| compress("")
 | |
| 
 | |
| select uncompress("");
 | |
| uncompress("")
 | |
| 
 | |
| select uncompress(compress(""));
 | |
| uncompress(compress(""))
 | |
| 
 | |
| select uncompressed_length("");
 | |
| uncompressed_length("")
 | |
| 0
 | |
| 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)
 | |
| NULL
 | |
| 12
 | |
| 76
 | |
| 50000
 | |
| select length(uncompress(a)) from t1;
 | |
| length(uncompress(a))
 | |
| NULL
 | |
| NULL
 | |
| 50000
 | |
| NULL
 | |
| Warnings:
 | |
| Error	1259	ZLIB: Input data corrupted
 | |
| Error	1256	Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
 | |
| drop table t1;
 | |
| set @@max_allowed_packet=1048576*100;
 | |
| select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
 | |
| compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
 | |
| 0
 | |
| create table t1(a blob);
 | |
| insert into t1 values(NULL), (compress('a'));
 | |
| select uncompress(a), uncompressed_length(a) from t1;
 | |
| uncompress(a)	uncompressed_length(a)
 | |
| NULL	NULL
 | |
| a	1
 | |
| drop table t1;
 |