I downloaded sqlite-3.1.3 and made the fix.  The patch is attached.
Also created a ticket here:
http://www.sqlite.org/cvstrac/tktview?tn=1151

-Charlie


On Feb 16, 2005, at 2:15 PM, Charles Mills wrote:

open the database "test.db"
then execute the following sql commands
ATTACH 'test.db' AS hey
PRAGMA database_list
# [0, "main", "/Users/boson/workspace/test.db"]
# [2, "hey", "/Users/boson/workspace/test.db"]
DETACH [hey]
# error: no such database: [hey]
DETACH hey
# success

# also note:
ATTACH 'test.db' AS [hey]
PRAGMA database_list
# [0, "main", "/Users/boson/workspace/test.db"],
# [2, "hey", "/Users/boson/workspace/test.db"]]

So it seems that the [database name] syntax is not understood by DETACH. This seems inconsistent.

In attach.c the function
void sqlite3Detach(Parse *pParse, Token *pDbname)
sqlite3NameFromToken() is not called on the Dbname token.

I am using sqlite 3.0.8, haven't had chance to grab the latest release yet. (So maybe this is already fixed?)

-Charlie

Reply via email to