chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Collating prepared statements in sqlite3: bug?


From: Peter Danenberg
Subject: [Chicken-hackers] Collating prepared statements in sqlite3: bug?
Date: Fri, 14 May 2010 23:43:17 -0500
User-agent: Mutt/1.5.16 (2007-06-11)

When I attempt to collate a prepared statement, the arguments to the
collation function are the names of the column and not the values
thereof.

Given a collation function of, for instance:

  (define-collation db "COLLATETHIS" (lambda (x y) ...))

and a prepared statement:

  "SELECT * FROM test ORDER BY ? COLLATE COLLATETHIS LIMIT ? OFFSET ?;"

x and y in COLLATETHIS will be "id", "id" and not, say, "1", "2".

ASC and DESC are similary afflicted, and don't seem to sort prepared
statements; I suspect that they, too, are passed not values but column
names.

Looking at sqlite3.scm, it's not immediately obvious how to fix it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]