I am getting different behaviors after updating a 5.6 database to 8.
On 5.6, if I run the following statement I get zero rows, which is what I expect to get:
SELECT * FROM EntityCustomerContact where CustomerContactID <> TRIM(CustomerContactID);
On 8.0 I get hundreds of rows returned. CustomerContactID is a varchar(32);
My understanding is that all CHAR, VARCHAR, and TEXT values in MySQL are compared without regard to any trailing spaces.
The update process consisted of importing a mysqldump from 5.6 into 8.0. The only other thing that I changed other than moving to 8.0 was updating the collation on all tables and columns from utf8mb4_unicode_ci to utf8mb4_0900_ai_ci. This is the first upgrade I've done moving to the utf8mb4_0900_ai_ci collation.
I have performed a number of other upgrades from 5.6/7 to 8.0 and never encountered this issue - I ran my test query on some other 8.0 (specifically 8.0.29) databases that were upgraded in the same fashion excepting the collation change and received the expected results.
I have searched for possible mysqld settings to address this but have come up short.