mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 20:14:21 +01:00
Merge 'string sometimes used as identifier quoting' from Lâm Hoàng Phúc
fix https://github.com/tursodatabase/turso/issues/2886#issuecomment- 3244885481 Closes #2894
This commit is contained in:
@@ -58,7 +58,12 @@ impl RoundToPrecision for f64 {
|
||||
}
|
||||
|
||||
// https://sqlite.org/lang_keywords.html
|
||||
const QUOTE_PAIRS: &[(char, char)] = &[('"', '"'), ('[', ']'), ('`', '`')];
|
||||
const QUOTE_PAIRS: &[(char, char)] = &[
|
||||
('"', '"'),
|
||||
('[', ']'),
|
||||
('`', '`'),
|
||||
('\'', '\''), // string sometimes used as identifier quoting
|
||||
];
|
||||
|
||||
pub fn normalize_ident(identifier: &str) -> String {
|
||||
let quote_pair = QUOTE_PAIRS
|
||||
|
||||
@@ -20,4 +20,11 @@ do_execsql_test_on_specific_db {:memory:} create_table_rowid_unique_regression_t
|
||||
create table u(x integer unique primary key);
|
||||
insert into u values (1),(2),(3);
|
||||
select * from u where x > 2;
|
||||
} {3}
|
||||
} {3}
|
||||
|
||||
# https://github.com/tursodatabase/turso/issues/2886#issuecomment-3244885481
|
||||
do_execsql_test_on_specific_db {:memory:} create_table_with_empty_string_name {
|
||||
create table ''('' INTEGER) strict;
|
||||
insert into '' values(9);
|
||||
select * from '';
|
||||
} {9}
|
||||
|
||||
Reference in New Issue
Block a user