Re: [sqlite] "ORDER BY ?" sqlite3_bind_int OK, but does weird things

2018-01-29 Thread Keith Medcalf
out anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Danny Milosavljevic >Sent: Monday, 29 January, 2018 12:14 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] "ORDER BY ?"

Re: [sqlite] "ORDER BY ?" sqlite3_bind_int OK, but does weird things

2018-01-29 Thread Jens Alfke
> On Jan 29, 2018, at 11:13 AM, Danny Milosavljevic > wrote: > > Should this use case work? Nope. The ORDER BY clause can affect the query plan and the generated bytecode, so it's not something you can change in a binding. You have to compile a new statement with a

Re: [sqlite] "ORDER BY ?" sqlite3_bind_int OK, but does weird things

2018-01-29 Thread Clemens Ladisch
Danny Milosavljevic wrote: > I'm trying to prepare a statement for "SELECT a FROM t ORDER BY ?" and > then sqlite3_bind_int the parameter to 1 (on sqlite 3.19.3). > > Expected result: Orders result by column "a", in ascending order. > Observed result: Orders in some strange order. Ordering by

[sqlite] "ORDER BY ?" sqlite3_bind_int OK, but does weird things

2018-01-29 Thread Danny Milosavljevic
Hi, I'm trying to prepare a statement for "SELECT a FROM t ORDER BY ?" and then sqlite3_bind_int the parameter to 1 (on sqlite 3.19.3). Expected result: Orders result by column "a", in ascending order. Observed result: Orders in some strange order. I also tried sqlite3_bind_int64, didn't change