Bug #96010 | Non-unique functional index prevents PRIMARY KEY from being dropped | ||
---|---|---|---|
Submitted: | 26 Jun 2019 17:29 | Modified: | 1 Jul 2019 12:59 |
Reporter: | Manuel Rigger | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 8.0.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Jun 2019 17:29]
Manuel Rigger
[26 Jun 2019 20:13]
MySQL Verification Team
Thank you for the bug report.
[1 Jul 2019 12:58]
Dmitry Lenev
Posted by developer: Hello! The underlying issue described in this bug report is the same as one that is described in bug #95997/#29959656 "INDEX MAKES DELETE FAIL WITH "TRUNCATED INCORRECT DOUBLE VALUE"". In strict SQL mode, which is default nowadays (see section 5.1.11 Server SQL Modes/ Strict SQL Mode in MySQL 8.0 manual -- https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sql-mode-strict) warning about invalid value for the row being inserted or processed by ALTER TABLE is promoted to error and causes statement failure. However, usage of IGNORE clause in INSERT (or turning strict mode off temporarily) allows to avoid this promotion and thus the row with invalid value gets inserted. This is documented effect of IGNORE clause (see 13.2.6 INSERT Syntax in 8.0 manual https://dev.mysql.com/doc/refman/8.0/en/insert.html): "... Data conversions that would trigger errors abort the statement if IGNORE is not specified. With IGNORE, invalid values are adjusted to the closest values and inserted; warnings are produced but the statement does not abort. ..." So we end up with table containing row for which index expression produces invalid value and for which other statements that require evaluation of this value (ALTER TABLE in case of this bug report and DELETE in case of bug #95997/#29959656) will produce error in strict mode. The workaround is to either use IGNORE clause in these statements (where supported) or to temporarily turn off strict mode temporarily for them. Taking into account the above I am closing this report as duplicate of #95997/#29959656 "INDEX MAKES DELETE FAIL WITH "TRUNCATED INCORRECT DOUBLE VALUE"". I will provide more elaborate explanation/comments for the former bug report.