Re: [sqlite] String interpreted as a column name when creating an index

2019-04-28 Thread Manuel Rigger
@Simon: Thanks for pointing that out! The difference in the effects of using single vs. double quotes in the select query is still the same though. @Richard: Thanks for taking time to explain this to me and for pointing me to the comment in the source code! I've found another case where, depending

Re: [sqlite] String interpreted as a column name when creating an index

2019-04-27 Thread Richard Hipp
On 4/27/19, Manuel Rigger wrote: > Thanks for your quick and helpful reply! So if I understood correctly, > there is no way to ensure that a string is not interpreted as a column in > an arbitrary expression, right? String literal is always just a string literal in an arbitrary expression. Strin

Re: [sqlite] String interpreted as a column name when creating an index

2019-04-27 Thread Simon Slavin
On 27 Apr 2019, at 8:46pm, Manuel Rigger wrote: > INSERT INTO test(c0, c1) VALUES ("c1", 0); Technically, SQLite should return an error for that, since you supplied an entity name "c1" where it wanted an expression. For historical compatibility reasons, SQLite will accept the "c1" and interpr

Re: [sqlite] String interpreted as a column name when creating an index

2019-04-27 Thread Manuel Rigger
Thanks for your quick and helpful reply! So if I understood correctly, there is no way to ensure that a string is not interpreted as a column in an arbitrary expression, right? In another example, it was the other way around and I had to use single quotes rather than double quotes to prevent the st

Re: [sqlite] String interpreted as a column name when creating an index

2019-04-27 Thread Richard Hipp
On 4/27/19, Manuel Rigger wrote: > > when executing the example below, I get "Error: no such column: asdf". This > behavior is surprising to me, as I would have expected "asdf" to be > interpreted as a string and not as a column name. > > CREATE TABLE test (c0); > CREATE INDEX index_1 ON test('asd

[sqlite] String interpreted as a column name when creating an index

2019-04-27 Thread Manuel Rigger
Hi everyone, when executing the example below, I get "Error: no such column: asdf". This behavior is surprising to me, as I would have expected "asdf" to be interpreted as a string and not as a column name. CREATE TABLE test (c0); CREATE INDEX index_1 ON test('asdf'); According to the docs, sing