diff --git a/sqlite3.go b/sqlite3.go index efb7cca..758cfdf 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -292,10 +292,11 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { // _busy_timeout if val := params.Get("_busy_timeout"); val != "" { - busy_timeout = int(strconv.ParseInt(val, 10, 64)) + iv, err := strconv.ParseInt(val, 10, 64) if err != nil { return nil, fmt.Errorf("Invalid _busy_timeout: %v: %v", val, err) } + busy_timeout = int(iv) } if !strings.HasPrefix(dsn, "file:") { diff --git a/sqlite3_test.go b/sqlite3_test.go index 3e89746..1d06fd4 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -640,7 +640,7 @@ func TestTimezoneConversion(t *testing.T) { zones := []string{"UTC", "US/Central", "US/Pacific", "Local"} for _, tz := range zones { tempFilename := TempFilename() - db, err := sql.Open("sqlite3", tempFilename+"?loc="+url.QueryEscape(tz)) + db, err := sql.Open("sqlite3", tempFilename+"?_loc="+url.QueryEscape(tz)) if err != nil { t.Fatal("Failed to open database:", err) } @@ -845,7 +845,7 @@ func TestStress(t *testing.T) { func TestDateTimeLocal(t *testing.T) { zone := "Asia/Tokyo" tempFilename := TempFilename() - db, err := sql.Open("sqlite3", tempFilename+"?loc="+zone) + db, err := sql.Open("sqlite3", tempFilename+"?_loc="+zone) if err != nil { t.Fatal("Failed to open database:", err) } @@ -888,7 +888,7 @@ func TestDateTimeLocal(t *testing.T) { db.Exec("INSERT INTO foo VALUES(?);", dt) db.Close() - db, err = sql.Open("sqlite3", tempFilename+"?loc="+zone) + db, err = sql.Open("sqlite3", tempFilename+"?_loc="+zone) if err != nil { t.Fatal("Failed to open database:", err) }