aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2015-03-22 03:16:35 +0900
committermattn <mattn.jp@gmail.com>2015-03-22 03:16:35 +0900
commitc1abf95b381746cfae7fcb2796d72356f38dce63 (patch)
tree454ddb6a300d313ed4301ff2c5e778df91082ca9
parentShould use C.int() (diff)
downloadgolite-c1abf95b381746cfae7fcb2796d72356f38dce63.tar.gz
golite-c1abf95b381746cfae7fcb2796d72356f38dce63.tar.xz
Fix build
-rw-r--r--sqlite3.go3
-rw-r--r--sqlite3_test.go6
2 files changed, 5 insertions, 4 deletions
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)
}