update code from github.com/mattn/go-sqlite3

This commit is contained in:
Frank Braun 2015-09-13 16:28:51 +02:00
parent c043586245
commit 6d954fda7b
3 changed files with 9 additions and 10 deletions

View File

@ -9,7 +9,7 @@ tracked for changes (maintenance details below):
Update code from https://github.com/mattn/go-sqlite3
----------------------------------------------------
Current HEAD: 542ae647f8601bafd96233961b150cae198e0295
Current HEAD: 3b3f1d01b2696af5501697c35629048c227586ab
Track files:

View File

@ -55,7 +55,6 @@ func main() {
rows.Scan(&id, &name)
fmt.Println(id, name)
}
rows.Close()
stmt, err = db.Prepare("select name from foo where id = ?")
if err != nil {

View File

@ -48,21 +48,21 @@ _sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
#include <stdint.h>
static int
_sqlite3_exec(sqlite3* db, const char* pcmd, long* rowid, long* changes)
_sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes)
{
int rv = sqlite3_exec(db, pcmd, 0, 0, 0);
*rowid = (long) sqlite3_last_insert_rowid(db);
*changes = (long) sqlite3_changes(db);
*rowid = (long long) sqlite3_last_insert_rowid(db);
*changes = (long long) sqlite3_changes(db);
return rv;
}
static int
_sqlite3_step(sqlite3_stmt* stmt, long* rowid, long* changes)
_sqlite3_step(sqlite3_stmt* stmt, long long* rowid, long long* changes)
{
int rv = sqlite3_step(stmt);
sqlite3* db = sqlite3_db_handle(stmt);
*rowid = (long) sqlite3_last_insert_rowid(db);
*changes = (long) sqlite3_changes(db);
*rowid = (long long) sqlite3_last_insert_rowid(db);
*changes = (long long) sqlite3_changes(db);
return rv;
}
@ -242,7 +242,7 @@ func (c *SQLiteConn) exec(cmd string) (driver.Result, error) {
pcmd := C.CString(cmd)
defer C.free(unsafe.Pointer(pcmd))
var rowid, changes C.long
var rowid, changes C.longlong
rv := C._sqlite3_exec(c.db, pcmd, &rowid, &changes)
if rv != C.SQLITE_OK {
return nil, c.lastError()
@ -514,7 +514,7 @@ func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
C.sqlite3_clear_bindings(s.s)
return nil, err
}
var rowid, changes C.long
var rowid, changes C.longlong
rv := C._sqlite3_step(s.s, &rowid, &changes)
if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
err := s.c.lastError()