mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 13:45:53 +00:00
The function cql3::util::maybe_quote() is used throughout Scylla to convert identifier names (column names, table names, etc.) into strings that can be embedded in CQL commands. maybe_quote() sometimes needs to quote these identifier names, but when the identifier name is lowercase, and not a CQL keyword, it is not quoted. Not quoting identifier names when not needed is nice and pretty, but has a forward-compatibility problem: If some CQL command with an unquoted identifier is saved somewhere, and new version of Scylla adss this identifier as a new reserved keyword - the CQL command will break. So this patch introduces a new function, cql3::util::quote(), which unconditionally quotes the given identifier. The new function is not yet used in Scylla, but we add a unit test (based on the test of maybe_quote()) to confirm it behaves correctly. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20220118161217.231811-2-nyh@scylladb.com>
4.2 KiB
4.2 KiB