Commit Graph

768 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto a9ad8a09c9 remove trailing space 2016-11-05 00:28:43 +09:00
mattn f4e49e6484 Merge pull request #348 from mattn/ping
new go1.8 feature
2016-11-04 23:24:02 +09:00
Yasuhiro Matsumoto 57eaf4c070 separate test 2016-11-04 15:17:21 +09:00
Yasuhiro Matsumoto 755d5be32c add BeginContext 2016-11-04 15:15:16 +09:00
Yasuhiro Matsumoto 025b917610 add PrepareContext 2016-11-04 15:11:24 +09:00
Yasuhiro Matsumoto 29b191f206 build tag 2016-11-04 15:07:51 +09:00
Yasuhiro Matsumoto 4d2dc45165 Merge branch 'type' into ping 2016-11-04 15:05:42 +09:00
Yasuhiro Matsumoto b23526fb3c support named params 2016-11-04 15:00:29 +09:00
Yasuhiro Matsumoto c95a77965c context features 2016-11-04 14:24:22 +09:00
Yasuhiro Matsumoto d0e4959926 add go18 new feature 2016-11-04 00:03:16 +09:00
Yasuhiro Matsumoto 6796d46c3a implement go18 Pinger 2016-11-03 23:05:34 +09:00
Yasuhiro Matsumoto 86681de00a remove -Wno-c99-extension
Close #343
2016-10-28 23:22:18 +09:00
mattn dbe15b0408 Merge pull request #339 from brauner/2016-10-17/fix_libsqlite3_build
actually link to <sqlite3.h> when -tags libsqlite3
2016-10-28 17:48:50 +09:00
Christian Brauner 420dc664ed
upgrade: add ifdefines
This makes it possible to correctly link against the system sqlite. Also, don't
use defers with log.Fatal() since they won't be run on exit.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
2016-10-28 10:28:19 +02:00
Christian Brauner f6e7921d24
actually link to <sqlite3.h> when -tags libsqlite3
Building with -tags libsqlite3 used the sqlite3.h from the system but the go
compiler will compile all *.{c,h} files in the same direcory:

	"When the Go tool sees that one or more Go files use the special import
	"C", it will look for other non-Go files in the directory and compile
	them as part of the Go package. Any .c, .s, or .S files will be compiled
	with the C compiler." (https://golang.org/cmd/cgo/)

So if users actually want to link against the system sqlite3 we should make
sqlite3-binding.* a noop.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
2016-10-28 10:28:17 +02:00
mattn 955dae4ebd Merge pull request #345 from joeshaw/backup-finalizer-fix
fix double free in SQLiteBackup.Close() on error
2016-10-28 08:55:17 +09:00
Joe Shaw bdab31cc98 fix double free in SQLiteBackup.Close() on error
The sqlite3_backup_finish() function never fails, it just returns the
error code from previous operations.  Previously if it returned an
error, the finalizer wouldn't be unset and sqlite3_backup_finish() would
be run again on an already-finished backup.  This results in a
double-free and often segfaults.

The error handling is described in more detail in the "Error handling"
section of https://www.sqlite.org/backup.html.
2016-10-27 16:44:56 -07:00
mattn e5a3c16c5c Merge pull request #333 from nyarly/master
Added CFLAG config to ignore deprecations
2016-10-05 01:01:36 +09:00
Judson 61c9552d18
Added CFLAG config to ignore deprecations 2016-10-04 16:51:54 +01:00
mattn 4b0af852c1 Merge pull request #331 from a-p-/test-backup-error
Test the error reporting when preparing to perform a backup.
2016-09-27 11:28:46 +09:00
a-p- 0e686cadf6 Test the error reporting when preparing to perform a backup. 2016-09-23 08:41:32 -04:00
Yasuhiro Matsumoto 3fb7a0e792 TestAggregatorRegistration may fail if trace feature is not implemented 2016-09-08 01:20:43 +09:00
Yasuhiro Matsumoto 0cc5236296 add tracecallback_noimpl.go 2016-09-08 01:13:15 +09:00
Yasuhiro Matsumoto e63ddcaa1a wrapper is not needress when not use libsqlite3 2016-09-08 01:00:36 +09:00
Yasuhiro Matsumoto bf2cfc371a fix build 2016-09-08 00:59:25 +09:00
Yasuhiro Matsumoto 467e3720d8 fix build 2016-09-08 00:39:47 +09:00
Yasuhiro Matsumoto 2bc6ac72c0 fix build 2016-09-08 00:30:54 +09:00
Yasuhiro Matsumoto a8bf79c7d7 Merge branch 'master' into trace 2016-09-08 00:15:31 +09:00
Yasuhiro Matsumoto 6f7ceed867 test of backup is too long 2016-09-08 00:15:10 +09:00
A.N 17a684694a Example program for the new SetTrace()
Does INSERT, then SELECT on the inserted rows (in-memory database).
The purpose of all these is to cause activity so there will be trace
messages to display. Trace message formatting is included
(a useful format, with explanations).
2016-09-07 23:48:36 +09:00
A.N 2b0a8971e3 Remove obsolete comment
The implementation which caused it was abandoned before first commit.
2016-09-07 23:48:27 +09:00
A.N 911ebeea74 TraceInfo: fix RunTimeNanosec retrieval, add AutoCommit
Also change type of EventCode to uint32 so adding AutoCommit
is "free" = does not enlarge the TraceInfo struct.
32 bits are more than enough, since only 4 (four) are used now.
2016-09-07 23:48:17 +09:00
A.N 0a2fcd29b6 Provide access to sqlite3_trace_v2(). 2016-09-07 23:48:06 +09:00
mattn e87c35082b Merge pull request #323 from FiloSottile/master
Make Go 1.7 fail compilation without cgo
2016-09-04 09:19:41 +09:00
Filippo Valsorda 98981b4a3b Make Go 1.7 fail compilation
The package is useless without cgo, but Go 1.7 will happily build it
since doc.go is a pure-Go file, even if CGO_ENABLED=0, like when
cross-compiling.

This is particularly problematic since the package is usually imported
for its side effects, and users would successfully build a broken binary.

Workaround golang/go#16981
2016-09-03 20:02:56 +01:00
mattn b5c99a7203 Merge pull request #322 from a-p-/backup-tests
Add some testing of the backup functionality.
2016-08-21 16:55:01 +09:00
a-p- 3a5d0a7e5b Add some testing of the backup functionality. 2016-08-20 18:57:12 -04:00
Yasuhiro Matsumoto c3e9588849 Close file 2016-08-11 18:51:38 +09:00
Yasuhiro Matsumoto 5a7763c649 add upgrade.go 2016-08-11 18:43:56 +09:00
Yasuhiro Matsumoto 5176d6e6cb add *.o 2016-08-11 18:43:49 +09:00
Yasuhiro Matsumoto ee996d6946 use amalgamation 3.14.0 2016-08-11 01:47:31 +09:00
Yasuhiro Matsumoto 297d6f8d2d update amalgamation code 2016-08-11 01:15:52 +09:00
mattn e118d44513 Merge pull request #300 from sqweek/issue184
Fix inconsistent tx state with database/sql.
2016-07-15 22:38:49 +09:00
mattn 38ee283dab Merge pull request #304 from steffengy/master
upgrade sqlite amalgamation to 3.12.2
2016-05-14 21:23:48 +09:00
Steffen 5505c7c92e upgrade sqlite amalgamation to 3.12.2 2016-05-14 11:53:28 +02:00
mattn 7204887cf3 Merge pull request #302 from shaxbee/master
Build with libsqlite3 on Ubuntu 14.04 LTS
2016-05-03 09:00:58 +09:00
Zbigniew Mandziejewicz 42d411769d Bump Travis to Ubuntu 14.04 2016-04-23 00:00:50 +08:00
Zbigniew Mandziejewicz 9f06636f8c FTS4 is not available on Trusty 2016-04-23 00:00:49 +08:00
Zbigniew Mandziejewicz c8316feaa3 Test with libsqlite3 2016-04-23 00:00:49 +08:00
Zbigniew Mandziejewicz 3ebb821e65 Set SQLITE_DETERMINISTIC if undefined 2016-04-23 00:00:49 +08:00