Skip to content

Commit 3dd82f7

Browse files
committed
Fix panic when querying with json_array_elements_text. Closes #207
1 parent 17d36b4 commit 3dd82f7

File tree

4 files changed

+189
-38
lines changed

4 files changed

+189
-38
lines changed

fdw.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,12 @@ func handleCommandInsert(rinfo *C.ResultRelInfo, slot *C.TupleTableSlot, rel C.R
445445

446446
//export goFdwShutdown
447447
func goFdwShutdown() {
448+
defer func() {
449+
if r := recover(); r != nil {
450+
log.Printf("[WARN] goFdwShutdown failed with panic: %v", r)
451+
// DO NOT call FdwError or we will recurse
452+
}
453+
}()
448454
log.Printf("[INFO] .\n******************************************************\n\n\t\tsteampipe postgres fdw shutdown\n\n******************************************************\n")
449455
pluginHub, err := hub.GetHub()
450456
if err != nil {

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ require (
8989
github.com/olekukonko/tablewriter v0.0.5 // indirect
9090
github.com/opencontainers/go-digest v1.0.0 // indirect
9191
github.com/opencontainers/image-spec v1.0.2 // indirect
92+
github.com/pegasus-kv/thrift v0.13.0 // indirect
9293
github.com/pelletier/go-toml v1.9.5 // indirect
9394
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
9495
github.com/pkg/errors v0.9.1 // indirect

0 commit comments

Comments
 (0)