Bug #108990 | Update integer value via integer key raises collation error | ||
---|---|---|---|
Submitted: | 3 Nov 2022 14:59 | Modified: | 22 Nov 2022 12:20 |
Reporter: | Drazen Herendic | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S3 (Non-critical) |
Version: | 8.0.29 | OS: | Debian (11) |
Assigned to: | CPU Architecture: | x86 | |
Tags: | COllation bug |
[3 Nov 2022 14:59]
Drazen Herendic
[4 Nov 2022 12:33]
MySQL Verification Team
Hi Mr. Herendic, Thank you for your bug report. However, we need a fully reproducible test case. The only thing that is missing is one INSERT command for several rows, which would also cover the id of 5. We are waiting on your feedback.
[7 Nov 2022 9:29]
Drazen Herendic
Hello. When I try to insert record with PK 5, I get regular response: Error Code: 1062. Duplicate entry '5' for key 'ad_priceplans.PRIMARY' INSERT INTO table1 (id, name, description, description_name, validity, active_from, active_to, status, type, group) values (5, 'test name', 'test name', 'test description name', 35, '2022-10-01', '2023-10-01', 1, 3, 4); When I try to insert a new record with unused PK value, I get the same collation error as initially mentioned: Error Code: 1267. Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=' INSERT INTO table1 (id, name, description, description_name, validity, active_from, active_to, status, type, group) values (12200, 'test name', 'test name', 'test description name', 35, '2022-10-01', '2023-10-01', 1, 3, 4); Among other things, I tried the select below to get more additional info about columns. I have tried some time ago to look into the source code to figure out something about the issue, but I gave up, it's not so simple. :) Anyway, select: select id, collation(validity), coercibility(validity), collation(id), coercibility(id), collation(name), coercibility(name) from table1 where id = 5; Result: 5 binary 5 binary 5 utf8_general_ci 2 I would like to mention, this server is the test server and I would rather find out what is going on sooner, than to witness this behavior on production server without knowing anything about what is going on. Remark: production server has version 8.0.25
[7 Nov 2022 13:18]
MySQL Verification Team
Hi Mr. Herendic, We were not able to reproduce the behaviour that you report, with the data that you provided. We need fully repeatable test case, with all data, which also means with all rows in the table that are required to see that behaviour. We will attempt to repeat the behaviour in 8.0.31. We also need a full query and all the settings. Can't repeat.
[7 Nov 2022 14:24]
Drazen Herendic
Thank you for your quick response. As I mentioned before, after I created local copy of problematic table inside the same schema (same DDL, same data), new table had no issues, compared to the original. So, very probably you won't observe this behavior in your lab. Regarding the data to send to you, I'm not allowed to send it as-is, since it's business data not to be easily shared (maybe it would require NDA). I spoke to my boss and we concluded that our only option currently is to create new table and align everything else to the new one. But before I do that, my hope is that you can give me some hint what else I can check on the server to get more diagnostic information about possible causes of the behavior. Any hints, tips and tricks are welcome.
[7 Nov 2022 15:31]
MySQL Verification Team
Thank you, Mr. Herendic.
[22 Nov 2022 12:20]
Drazen Herendic
Hello. I have some relevant news. It turned out that one trigger was making problems on several tables that use it. I just checked my previous texts, I haven't mention any triggers before. The only statement in the trigger (after insert, update, delete) UPDATE `cache_table` SET `timestamp` = UNIX_TIMESTAMP() WHERE `name` = tbl_name; Now I force the collation to align with the table/field collation of this update: UPDATE `cache_table` SET `timestamp` = UNIX_TIMESTAMP() WHERE `name` = tbl_name COLLATE utf8_general_ci; If this was obvious to me then, I wouldn't have opened this ticket at first place. Good thing is there is no bug here. :) I think you can close this ticket. Thank you.
[22 Nov 2022 13:04]
MySQL Verification Team
Hi Mr. Herendic, You are truly welcome.