From 5d9fdcab9300de16c24a5fe2c4286b074096fb94 Mon Sep 17 00:00:00 2001 From: Alien Science Date: Thu, 19 Jan 2012 20:26:09 +0100 Subject: [PATCH 1/4] Fixed double free when closing SQLiteStmt Rows should not close the statement because Stmt has its own close function. This caused a double free error/crash on Fedora 16 x86_64. --- sqlite3.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index 731cf73..6de2123 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -228,10 +228,6 @@ type SQLiteRows struct { } func (rc *SQLiteRows) Close() error { - rv := C.sqlite3_finalize(rc.s.s) - if rv != C.SQLITE_OK { - return errors.New(C.GoString(C.sqlite3_errmsg(rc.s.c.db))) - } return nil } From f0825967469ebc1a342acc4b756b098d81ab511a Mon Sep 17 00:00:00 2001 From: Scott Lawrence Date: Fri, 20 Jan 2012 11:44:24 -0500 Subject: [PATCH 2/4] Fixing build at tip --- sqlite3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlite3.go b/sqlite3.go index 6de2123..088b110 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -20,8 +20,8 @@ _sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) { import "C" import ( "errors" - "exp/sql" - "exp/sql/driver" + "database/sql" + "database/sql/driver" "unsafe" ) From c7906ff723157e36b1a3bb8b778a5ae87adc6baa Mon Sep 17 00:00:00 2001 From: Scott Lawrence Date: Fri, 20 Jan 2012 11:44:56 -0500 Subject: [PATCH 3/4] Updating example --- example/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/main.go b/example/main.go index a17fa8b..6d6aa0e 100644 --- a/example/main.go +++ b/example/main.go @@ -1,7 +1,7 @@ package main import ( - "exp/sql" + "database/sql" "fmt" _ "github.com/mattn/go-sqlite3" "os" From 593643ef111fdb475f0e851b6adb8a9834eed268 Mon Sep 17 00:00:00 2001 From: Scott Lawrence Date: Fri, 20 Jan 2012 11:45:29 -0500 Subject: [PATCH 4/4] Updating README --- README.mkd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.mkd b/README.mkd index baa786a..555ac1d 100644 --- a/README.mkd +++ b/README.mkd @@ -4,7 +4,7 @@ go-sqlite3 DESCRIPTION ----------- -sqlite3 driver for go that using exp/sql +sqlite3 driver for go that using database/sql LICENSE -------