Skip to content

Index hint syntax not recognized #199

@ibennetch

Description

@ibennetch

See https://dev.mysql.com/doc/refman/8.0/en/index-hints.html and phpmyadmin/phpmyadmin#14482

Syntactical valid statements include FORCE INDEX, USE INDEX, and IGNORE INDEX, and FORCE KEY, USE KEY, and IGNORE KEY.

./vendor/bin/highlight-query --query "SELECT * FROM address FORCE INDEX(idx_fk_city_id) WHERE city_id<0"
SELECT
    *
FROM
    address FORCE INDEX(idx_fk_city_id)
WHERE
    city_id < 0
./vendor/bin/lint-query --query "SELECT * FROM address FORCE INDEX(idx_fk_city_id) WHERE city_id<0"
#1: Unrecognized keyword. (near "FORCE" at position 22)
#2: Unrecognized keyword. (near "INDEX" at position 28)
#3: Unexpected token. (near "(" at position 33)
#4: Unexpected token. (near "idx_fk_city_id" at position 34)
#5: Unexpected token. (near ")" at position 48)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions