I've come across tables that have columns named 'min' and 'max',
I've also never seen max used as a keyword, only as a function.
consider the following example:
SELECT min, max FROM foo
;
Token.Keyword.DML :SELECT
Token.Keyword : min
Token.Keyword : max
Token.Keyword :FROM
Token.Name : foo
In this case, min and max are not keywords, or atleast this query works in mysql to mean literal column names.
When min and max are used as functions they behave as expected, although the ttype 'Keyword' still seems inaccurate.
SELECT min(bar), max(baz) FROM foo
;
Token.Keyword.DML :SELECT
Token.Keyword :min
Token.Name : bar
Token.Keyword :max
Token.Name : baz
Token.Keyword :FROM
Token.Name : foo
Of course this can be avoided by explicitly backticking columns names:
SELECT `min`, `max` FROM foo
;
Token.Keyword.DML :SELECT
Token.Name : `min`
Token.Name : `max`
Token.Keyword :FROM
Token.Name : foo
But I can't expect the quires I deal with to be well-escaped so long as they run as expected on mysql.
I've come across tables that have columns named 'min' and 'max',
I've also never seen
maxused as a keyword, only as a function.consider the following example:
In this case, min and max are not keywords, or atleast this query works in mysql to mean literal column names.
When min and max are used as functions they behave as expected, although the ttype 'Keyword' still seems inaccurate.
Of course this can be avoided by explicitly backticking columns names:
But I can't expect the quires I deal with to be well-escaped so long as they run as expected on mysql.