db: fixed space leak in statement finalizer thread

This "fixes" the segfault in the test program, but it seems
like there must be another underlying problem.
This commit is contained in:
Ryan Culpepper 2011-11-13 14:32:41 -07:00
parent 0754e6b702
commit b4e856cc3c
2 changed files with 22 additions and 2 deletions

View File

@ -109,5 +109,5 @@
[else
"prepared statement finalizer thread handled non-exception"])
e))])
(will-execute will-executor)
(loop))))))
(will-execute will-executor))
(loop)))))

View File

@ -0,0 +1,20 @@
#lang racket
(require db)
(define db (sqlite3-connect #:database 'memory))
(query-exec
db
"CREATE TABLE IF NOT EXISTS
log_word_map(word TEXT, log_id INTEGER,
PRIMARY KEY (word, log_id)
ON CONFLICT FAIL)")
(query-exec db "BEGIN TRANSACTION")
(for ([x (in-range 20000)])
(query-exec db
"insert into log_word_map values (?, ?)"
(number->string x) 99))
(query-exec db "COMMIT")