Skip to content

Treat INTERVAL as keyword in MySQL, TiDB and SingleStoreDB - #1000

Closed
zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/mysql-interval-keyword
Closed

zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/mysql-interval-keyword

Conversation

@zzoraemon043

Copy link
Copy Markdown

Fixes #985

INTERVAL was in both the function and keyword lists of the MySQL-like dialects. Function names win in the tokenizer and turn into plain identifiers when not followed by (, so interval 30 day ignored keywordCase.

It is now only a keyword there, as in MariaDB, and the shared MariaDB-like post-processing turns INTERVAL followed by ( into a function name, the same way it already handles SET( and VALUES(. This also makes MariaDB format INTERVAL(5, 1, 10) as a function call instead of INTERVAL (5, 1, 10).

@zzoraemon043

Copy link
Copy Markdown
Author

duplicate of #995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FORMATTING] MySQL: INTERVAL is not affected by keywordCase (it is in MariaDB)

1 participant