You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f13b60c
Browse filesBrowse the repository at this point in the historyBrowse files
fix!: let the backend state its own reserved words
`common_get_info_raw` answered `SQL_KEYWORDS` (89) with the empty string for
every backend. By core's own rule -- is empty "unknown", or is it an answer? --
that is an answer. The spec defines the info type as the data source's keywords
*excluding* ODBC's own, so `""` says "this data source reserves nothing beyond
ODBC", and applications read it to decide which identifiers need quoting. Both
existing drivers have plenty; a wrong empty list is how a generated identifier
goes unquoted and the statement fails to parse.
Add a required `Backend::keywords` for the raw list, and move the half that is
spec data rather than data-source data into core: `ODBC_RESERVED_KEYWORDS` (the
Appendix C list, transcribed in the order the spec page gives it) now lives in
`types/constants.rs`, and the subtraction, sort and comma-join happen once in
`data_source_specific_keywords`.
Computed per call rather than cached: a `static` cannot be generic over `B`,
and this is a linear scan of a short list on a path `SQLGetInfo` reaches a
handful of times per connection. A backend whose list is expensive to produce
caches on its own side -- said so in the hook's doc comment.
Required, not defaulted, for the same reason as the rest of the capability
group: an empty list is a falsifiable claim about the data source that core has
no way to make. The two classification mocks declare different lists, so
`the_two_classification_mocks_share_no_capability_declaration` covers it.
Asserted through the full `sql_get_info_w` path: `&[]` still yields `""`,
`["SELECT", "UNNEST"]` yields `"UNNEST"`, and `["select"]` yields `""`.
BREAKING CHANGE: `Backend::keywords` is a new required trait method. Every
backend must implement it; there is no default, because an empty list is the
claim that the data source reserves nothing beyond ODBC. Returning `&[]`
reproduces the value core previously gave everyone.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments