mirror of https://github.com/mattn/go-sqlite3.git
Compare commits
3 Commits
ad08b07ade
...
5fc124438d
Author | SHA1 | Date |
---|---|---|
Simon Ser | 5fc124438d | |
Yasuhiro Matsumoto | 82bc911e85 | |
Simon Ser | 8a3f369b62 |
|
@ -224,7 +224,8 @@ import (
|
||||||
// SQLiteTimestampFormats is timestamp formats understood by both this module
|
// SQLiteTimestampFormats is timestamp formats understood by both this module
|
||||||
// and SQLite. The first format in the slice will be used when saving time
|
// and SQLite. The first format in the slice will be used when saving time
|
||||||
// values into the database. When parsing a string from a timestamp or datetime
|
// values into the database. When parsing a string from a timestamp or datetime
|
||||||
// column, the formats are tried in order.
|
// column, the formats are tried in order. If the string ends with "Z", that
|
||||||
|
// suffix is trimmed before trying the formats.
|
||||||
var SQLiteTimestampFormats = []string{
|
var SQLiteTimestampFormats = []string{
|
||||||
// By default, store timestamps with whatever timezone they come with.
|
// By default, store timestamps with whatever timezone they come with.
|
||||||
// When parsed, they will be returned with the same timezone.
|
// When parsed, they will be returned with the same timezone.
|
||||||
|
@ -929,6 +930,7 @@ func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.Name
|
||||||
s.(*SQLiteStmt).cls = true
|
s.(*SQLiteStmt).cls = true
|
||||||
na := s.NumInput()
|
na := s.NumInput()
|
||||||
if len(args)-start < na {
|
if len(args)-start < na {
|
||||||
|
s.Close()
|
||||||
return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start)
|
return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start)
|
||||||
}
|
}
|
||||||
// consume the number of arguments used in the current
|
// consume the number of arguments used in the current
|
||||||
|
|
Loading…
Reference in New Issue