﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
406	sql-de-lite: `close-database' throws `Error: bad argument type - not a structure of the required type #<lru-node>'	Mario Domenech Goulart	Jim Ursetto	"Myabe I'm doing something stupid, but I get an error when closing a database connection with sql-de-lite.  Here's a simple example:

{{{
$ sqlite3 test.db
SQLite version 3.6.22
Enter "".help"" for instructions
Enter SQL statements terminated with a "";""
sqlite> create table my_table ( col text );
}}}

{{{
$ cat test-db.scm

(use sql-de-lite)

(let ((db (open-database ""test.db"")))
  (exec (sql db ""insert into my_table (col) values ('foo');""))
  (close-database db))
}}}

{{{
$ csi -s test-db.scm

Error: bad argument type - not a structure of the required type
#<lru-node>
lru-cache#lru-node

        Call history:

        ##sys#block-set!          
        sql-de-lite#bind-parameter-count          
        sql-de-lite#exec*         
        sql-de-lite#fetch         
        sql-de-lite#step          
        ##sys#block-set!          
        sql-de-lite#column-count          
        sql-de-lite#change-count          
        <eval>    (close-database db)
        lru-cache#lru-cache-flush!              <--
}}}

If I remove {{{close-database}}}, I don't get the error message.

Some environment info (Ubuntu 10.04):

{{{
$ csi -version

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.1 
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2010-09-22 on dellito (Linux)

$ chicken-status '^sql-de-lite$' '^lru-cache$'
lru-cache ..................................................... version: 0.5.3
sql-de-lite ................................................... version: 0.4.1
}}}"	defect	closed	major	4.9.0	extensions	4.6.x	invalid	sql-de-lite		
