Skip to main content
Version: 5.x

UNCOMPRESS

Description

The UNCOMPRESS function decompresses binary data into strings or values. You must ensure the binary data is the result of the COMPRESS function.

Syntax

UNCOMPRESS(<compressed_str>)

Parameters

ParameterDescription
<compressed_str>Compressed binary data, parameter type is varchar or string

Return Value

The return value type is the same as the input compressed_str type.

Special cases:

  • Returns NULL if compressed_str is not binary data obtained from COMPRESS.

Examples

select uncompress(compress('abc'));
+-----------------------------+
| uncompress(compress('abc')) |
+-----------------------------+
| abc |
+-----------------------------+
select uncompress(compress(''));
+--------------------------+
| uncompress(compress('')) |
+--------------------------+
| |
+--------------------------+
select uncompress('abc');
+-------------------+
| uncompress('abc') |
+-------------------+
| NULL |
+-------------------+

Keywords

UNCOMPRESS, COMPRESS