Bug #110648 TRIM function not working for trailing spaces
Submitted: 10 Apr 2023 11:43 Modified: 10 Apr 2023 12:44
Reporter: Tony Courtens Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.51-91.0 OS:Linux
Assigned to: CPU Architecture:Any
Tags: spaces, trailing, trim

[10 Apr 2023 11:43] Tony Courtens
Description:
Checking with TRIM-function if a column in a table has trailing spaces does not work. Ik works with leading spaces though.

How to repeat:
create table test(name VARCHAR(10));
insert into test(name) values(' leading'); // record with leading space
insert into test(name) values('trailing '); // record with traling space
insert into test(name) values('none'); // record with no spaces

select * from test where TRIM(name) != name;

result is only the record ' leading' where I expect also to have 'trailing ' as a result
[10 Apr 2023 12:44] MySQL Verification Team
Hi Mr. Courtens,

Thank you for your bug report.

However, we do not support version 5.6 for many years already.

This is the output that I get with the latest 8.0 release:

 leading
trailing

Unsupported.