Bug #115386 SELECT hex(trim(' ')) doesn't return NULL
Submitted: 19 Jun 2024 18:59 Modified: 20 Jun 2024 9:15
Reporter: Fabrizio Toso Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:8.0.36 OS:Linux (fedora)
Assigned to: CPU Architecture:x86
Tags: trim function

[19 Jun 2024 18:59] Fabrizio Toso
Description:
SELECT hex(trim('   '))  doesn't return NULL
SELECT trim('   ')  doesn't return NULL

How to repeat:
run SELECT trim('   ') or SELECT hex(trim('   '))
[20 Jun 2024 9:15] MySQL Verification Team
Hi Mr. Toso,

Thanks a lot for your bug report.

However, this is not a bug.

TRIM('        ') returnes an empty string, which is '';

Empty string is not NULL.

NULL means no data and empty string is definitely a datum.

Not a bug.