diff options
author | lye <lye@> | 2012-02-06 22:59:24 +0000 |
---|---|---|
committer | lye <lye@> | 2012-02-06 22:59:24 +0000 |
commit | 3524ead0a51cad63768e5f2277b28455d1a4a968 (patch) | |
tree | d592973524b57e0e482f4dfa7155a3972d8e97dc /sqlite3.go | |
parent | Added additional testcase for boolean roundtrips (diff) | |
download | golite-3524ead0a51cad63768e5f2277b28455d1a4a968.tar.gz golite-3524ead0a51cad63768e5f2277b28455d1a4a968.tar.xz |
For boolean values, marshal true to SQLite 1, not -1
SQLite stores boolean values as an integer, serializing true as 1 and
false as 0 [1], but it does not actually enforce this range. To match
the documentation (and fix the broken test case), this patch makes a Go
boolean true serialize properly to 1.
[1] http://www.sqlite.org/datatype3.html
Diffstat (limited to 'sqlite3.go')
-rw-r--r-- | sqlite3.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -169,7 +169,7 @@ func (s *SQLiteStmt) bind(args []interface{}) error { rv = C.sqlite3_bind_int(s.s, n, C.int(v)) case bool: if bool(v) { - rv = C.sqlite3_bind_int(s.s, n, -1) + rv = C.sqlite3_bind_int(s.s, n, 1) } else { rv = C.sqlite3_bind_int(s.s, n, 0) } |