Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 8ccf821

Browse files
authored
Adding table sanity check (#930)
This PR adds a sanity check and fixes crash. I plan to work on root cause of the problem is next PR ``` Oct 30 14:15:34.699 INF quesma/functionality/bulk/bulk.go:339 > Ingesting via _bulk API, batch size=6 documents Oct 30 14:15:35.882 ERR quesma/recovery/recovery_strategies.go:32 > Panic recovered: runtime error: invalid memory address or nil pointer dereference goroutine 155 [running]: runtime/debug.Stack() /Users/pdelewski/go/pkg/mod/golang.org/[email protected]/src/runtime/debug/stack.go:26 +0x64 quesma/quesma/recovery.commonRecovery({0x102e930a0, 0x103359030}, 0x1400033a380?) /Users/pdelewski/Projects/quesma/quesma/quesma/recovery/recovery_strategies.go:32 +0x154 quesma/quesma/recovery.LogPanic() /Users/pdelewski/Projects/quesma/quesma/quesma/recovery/recovery_strategies.go:37 +0x34 panic({0x102e930a0?, 0x103359030?}) /Users/pdelewski/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:785 +0x124 quesma/ingest.(*IngestProcessor).processInsertQuery(0x140001521b0, {0x102f6ff78, 0x14000706a20}, {0x1400076afd4, 0x26}, {0x14000693830, 0x2, 0x1?}, {0x102f69aa0, 0x1400022e228}, ...) /Users/pdelewski/Projects/quesma/quesma/ingest/processor.go:675 +0x31c quesma/ingest.(*IngestProcessor).processInsertQueryInternal(0x140001521b0, {0x102f6ff78, 0x14000706a20}, {0x1400076afd4?, 0x26?}, {0x14000693830?, 0x10?, 0xa?}, {0x102f69aa0?, 0x1400022e228?}, ...) /Users/pdelewski/Projects/quesma/quesma/ingest/processor.go:779 +0x48 ```
1 parent 899f1fb commit 8ccf821

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

quesma/ingest/processor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ func (ip *IngestProcessor) processInsertQuery(ctx context.Context,
672672
} else if !table.Created {
673673
createTableCmd = table.CreateTableString()
674674
}
675+
if table == nil {
676+
return nil, fmt.Errorf("table %s not found", tableName)
677+
}
675678
tableConfig = table.Config
676679
var jsonsReadyForInsertion []string
677680
var alterCmd []string

0 commit comments

Comments
 (0)