mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
Fix quote escape in literals
This commit is contained in:
@@ -1854,7 +1854,7 @@ pub fn translate_expr(
|
||||
}
|
||||
ast::Literal::String(s) => {
|
||||
program.emit_insn(Insn::String8 {
|
||||
value: s[1..s.len() - 1].to_string(),
|
||||
value: s[1..s.len() - 1].replace("''", "'").to_string(),
|
||||
dest: target_register,
|
||||
});
|
||||
Ok(target_register)
|
||||
|
||||
@@ -11,6 +11,10 @@ do_execsql_test select-const-2 {
|
||||
SELECT 2
|
||||
} {2}
|
||||
|
||||
do_execsql_test select-text-escape-1 {
|
||||
SELECT '''a'
|
||||
} {'a}
|
||||
|
||||
do_execsql_test select-blob-empty {
|
||||
SELECT x'';
|
||||
} {}
|
||||
|
||||
Reference in New Issue
Block a user