# UNCOMPRESSED\_LENGTH

## Syntax

```sql
UNCOMPRESSED_LENGTH(compressed_string)
```

## Description

Returns the length that the compressed string had before being compressed with [COMPRESS()](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/compress).

`UNCOMPRESSED_LENGTH()` returns `NULL` or an incorrect result if the string is not compressed.

Returns `MYSQL_TYPE_LONG`, or [int(10)](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/int), if the result fits within 32-bits.

## Examples

```sql
SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));
+-----------------------------------------------+
| UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30))) |
+-----------------------------------------------+
|                                            30 |
+-----------------------------------------------+
```

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
