func_compress.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:3k
源码类别:

MySQL数据库

开发平台:

Visual C++

  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 Extra
  12. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
  13. Warnings:
  14. Note 1003 select sql_no_cache 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 Extra
  20. 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
  21. Warnings:
  22. 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)`
  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. select uncompress("");
  44. uncompress("")
  45. select uncompress(compress(""));
  46. uncompress(compress(""))
  47. select uncompressed_length("");
  48. uncompressed_length("")
  49. 0
  50. create table t1 (a text);
  51. insert t1 values (compress(null)), ('ABBBBBBBB'), (compress(space(50000))), (space(50000));
  52. select length(a) from t1;
  53. length(a)
  54. NULL
  55. 12
  56. 76
  57. 50000
  58. select length(uncompress(a)) from t1;
  59. length(uncompress(a))
  60. NULL
  61. NULL
  62. 50000
  63. NULL
  64. Warnings:
  65. Error 1259 ZLIB: Input data corrupted
  66. Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
  67. drop table t1;
  68. set @@max_allowed_packet=1048576*100;
  69. select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
  70. compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
  71. 0