diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-06-21 13:10:40 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2018-06-21 16:10:40 -0400 |
commit | 8526739066ccb00ccd24b74650a7d7b284442985 (patch) | |
tree | 282512ae2ad95c98a9ca82de304a410b6b56685c /vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go | |
parent | a59ccaa8b3844895dde3980e6224fef46ff4a1c8 (diff) | |
download | chat-8526739066ccb00ccd24b74650a7d7b284442985.tar.gz chat-8526739066ccb00ccd24b74650a7d7b284442985.tar.bz2 chat-8526739066ccb00ccd24b74650a7d7b284442985.zip |
MM-10934 Update server dependencies. (#8981)
* Changing throttled import path.
* Upgrading dependencies.
Diffstat (limited to 'vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go')
-rw-r--r-- | vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go b/vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go index ece60355e..ee93a0f08 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go @@ -2,7 +2,8 @@ // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. -// +build trace + +// +build sqlite_trace trace package sqlite3 @@ -28,10 +29,10 @@ import ( // Trace... constants identify the possible events causing callback invocation. // Values are same as the corresponding SQLite Trace Event Codes. const ( - TraceStmt = C.SQLITE_TRACE_STMT - TraceProfile = C.SQLITE_TRACE_PROFILE - TraceRow = C.SQLITE_TRACE_ROW - TraceClose = C.SQLITE_TRACE_CLOSE + TraceStmt = uint32(C.SQLITE_TRACE_STMT) + TraceProfile = uint32(C.SQLITE_TRACE_PROFILE) + TraceRow = uint32(C.SQLITE_TRACE_ROW) + TraceClose = uint32(C.SQLITE_TRACE_CLOSE) ) type TraceInfo struct { @@ -71,7 +72,7 @@ type TraceUserCallback func(TraceInfo) int type TraceConfig struct { Callback TraceUserCallback - EventMask C.uint + EventMask uint32 WantExpandedSQL bool } @@ -105,6 +106,8 @@ func traceCallbackTrampoline( // Parameter named 'X' in SQLite docs (eXtra event data?): xValue unsafe.Pointer) C.int { + eventCode := uint32(traceEventCode) + if ctx == nil { panic(fmt.Sprintf("No context (ev 0x%x)", traceEventCode)) } @@ -114,7 +117,7 @@ func traceCallbackTrampoline( var traceConf TraceConfig var found bool - if traceEventCode == TraceClose { + if eventCode == TraceClose { // clean up traceMap: 'pop' means get and delete traceConf, found = popTraceMapping(connHandle) } else { @@ -123,16 +126,16 @@ func traceCallbackTrampoline( if !found { panic(fmt.Sprintf("Mapping not found for handle 0x%x (ev 0x%x)", - connHandle, traceEventCode)) + connHandle, eventCode)) } var info TraceInfo - info.EventCode = uint32(traceEventCode) + info.EventCode = eventCode info.AutoCommit = (int(C.sqlite3_get_autocommit(contextDB)) != 0) info.ConnHandle = connHandle - switch traceEventCode { + switch eventCode { case TraceStmt: info.StmtHandle = uintptr(p) @@ -183,7 +186,7 @@ func traceCallbackTrampoline( // registering this callback trampoline with SQLite --- for cleanup. // In the future there may be more events forced to "selected" in SQLite // for the driver's needs. - if traceConf.EventMask&traceEventCode == 0 { + if traceConf.EventMask&eventCode == 0 { return 0 } |