MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestTransactionErrorOnCopyFailure

Function TestTransactionErrorOnCopyFailure

server/conn_test.go:3671–3691  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3669 }
3670 if _, ok := c.cursors["cur2"]; !ok {
3671 t.Error("expected cur2 to still exist")
3672 }
3673 if _, ok := c.cursors["cur1"]; ok {
3674 t.Error("expected cur1 to be removed")
3675 }
3676}
3677
3678func TestCursorCloseNonexistent(t *testing.T) {
3679 c := &clientConn{
3680 cursors: map[string]*cursorState{
3681 "cur1": {query: "SELECT 1"},
3682 },
3683 }
3684
3685 // Should not panic
3686 c.closeCursor("nonexistent")
3687
3688 if len(c.cursors) != 1 {
3689 t.Errorf("expected 1 cursor, got %d", len(c.cursors))
3690 }
3691}
3692
3693func TestTransactionStatusWithCopyCommands(t *testing.T) {
3694 c := &clientConn{txStatus: txStatusIdle}

Callers

nothing calls this directly

Calls 2

updateTxStatusMethod · 0.95
setTxErrorMethod · 0.95

Tested by

no test coverage detected