[CONJ-1048] INTERVAL missing from getSQLKeywords Created: 2023-01-31 Updated: 2023-03-01 Resolved: 2023-02-28 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | metadata |
| Affects Version/s: | 3.1.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Diego Dupin |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Seems to be missing from https://github.com/mariadb-corporation/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/DatabaseMetaData.java#L1348 |
| Comments |
| Comment by Diego Dupin [ 2023-02-02 ] | |||||
|
danblack have you any idea when INTERVAL has been defined in SQL standard ? | |||||
| Comment by Daniel Black [ 2023-02-02 ] | |||||
|
Does this help?
| |||||
| Comment by Diego Dupin [ 2023-02-28 ] | |||||
|
INTERVAL is a reserved word from SQL2003 ( https://ronsavage.github.io/SQL/sql-2003-2.bnf.html#reserved%20word) so doesn't have to be in DatabaseMetadata.getSQLKeywords. | |||||
| Comment by Daniel Black [ 2023-02-28 ] | |||||
|
So why isn't it escaped in the INSERT sql? Is that a responsibility higher up the stack? | |||||
| Comment by Diego Dupin [ 2023-03-01 ] | |||||
|
because connector doesn't parse sql command. it would really be a pain in term of performance if connector need to parse all sql commands in order to escape part that connector imagine can be a property. I imagine that initially, this DatabaseMetadata.getSQLKeywords was designed in order to prevent user to use reserved words, but that was badly designed, since it is not static, but need a connection first. I've seen some ORM use a list of reserved words like this, but checking now, not even hibernate does so. So i imagine there not so much we can do about that. |