From eb446c9c9f9ee5b241a9f7ecceb0402a7e39f200 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Sat, 31 Jul 2021 09:58:32 -0400 Subject: [PATCH] Return non-nil result https://github.com/mattn/go-sqlite3/issues/963 --- sqlite3.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlite3.go b/sqlite3.go index 36a1daba..7a10a8a6 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -829,6 +829,10 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue) tail := s.(*SQLiteStmt).t s.Close() if tail == "" { + if res == nil { + // https://github.com/mattn/go-sqlite3/issues/963 + res = &SQLiteResult{0, 0} + } return res, nil } query = tail