Bug #87925 Optionally don't make a query fail with USE INDEX (non_existing_index)

Submitted: 30 Sep 2017 17:27
Reporter: Federico Razzoli (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[30 Sep 2017 17:27] Federico Razzoli
Description:
A query like this:

SELECT ... FROM t USE/FORCE/IGNORE INDEX (index_name) ...

will fail with an error if specified index does not exist. This seems to me the best behaviour in test environment, but dangerous in production.

Think about this case: my db is used in production, at some point I remove an index which seems useless, and suddenly some queries fail.

So what I'm asking (unless you have better ideas to solve this problem) is having a new system variable which determines if queries like this should fail with an error, or just produce a warning.

How to repeat:
SELECT * FROM information_schema.TABLES USE INDEX (not_existing_index);

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.