turso icon indicating copy to clipboard operation
turso copied to clipboard

Double-quoted String Literals in function

Open JeanArhancet opened this issue 1 year ago • 3 comments

Currently, double-quoted strings are misinterpreted as column identifiers in functions. For instance, the query select upper("abc"); results in a Parse error: column with name "abc" not found. This needs correction to properly recognize double-quoted strings within functions.

JeanArhancet avatar Jul 21 '24 18:07 JeanArhancet

Isn't this as expected in SQL?

jussisaurio avatar Jul 24 '24 10:07 jussisaurio

SQLite version 3.46.0 2024-05-23 13:25:27
Enter ".help" for usage hints.
sqlite> select 'limbo';
limbo
sqlite> select "limbo";
Parse error: no such column: "limbo" - should this be a string literal in single-quotes?
sqlite> select length("limbo");
Parse error: no such column: "limbo" - should this be a string literal in single-quotes?

jussisaurio avatar Jul 24 '24 10:07 jussisaurio

@jussisaurio According to the SQLite documentation, support for double quotes is configurable. Is it possible that this feature is disabled in your version?

On my laptop (Mac - SQLite version 3.43.2), the SQL command behavior is: image

JeanArhancet avatar Jul 24 '24 12:07 JeanArhancet

This still happens as of e1c8c676ca21490ec36ff13fb921db808861cd00

sqlite> SELECT "limbo";
limbo
sqlite> SELECT length("limbo");
5

limbo> SELECT "limbo";
  × Parse error: Column "limbo" not found

limbo> SELECT length("limbo");
  × Parse error: Column "limbo" not found

limbo>

penberg avatar Jun 27 '25 07:06 penberg

turso> SELECT length("limbo");
┌──────────────────┐
│ length ("limbo") │
├──────────────────┤
│                5 │
└──────────────────┘

jussisaurio avatar Aug 16 '25 20:08 jussisaurio