v.22.10Improvement

Add tryDecrypt function that returns NULL on decryption failure

Add function tryDecrypt that returns NULL when decrypt fails (e.g. decrypt with incorrect key) instead of throwing an exception. #41206 (Duc Canh Le).
Introduces the tryDecrypt function which attempts to decrypt data and returns NULL if decryption fails instead of raising an exception.

Why it matters

This feature addresses the issue where decryption failures (such as using an incorrect key) cause exceptions that interrupt query execution. With tryDecrypt, users can handle decryption errors gracefully by receiving NULL values, enabling more robust and fault-tolerant query processing.

How to use it

Use the tryDecrypt function in SQL queries to decrypt data safely. For example:
SELECT tryDecrypt(encrypted_column, 'encryption_key') FROM table

This will return decrypted values or NULL if decryption fails.