Skip to content

Commit b309198

Browse files
EDsCODEclaude
andcommitted
Fix described flag set before RowDescription is actually sent
The described flag was being set unconditionally at the start of Describe portal handling, but then NoData might be sent instead of RowDescription (for non-SELECT, failed describe, or empty columns). This caused Execute to skip sending RowDescription (thinking Describe already sent it), resulting in DataRows without field structure error: "Received resultset tuples, but no field structure for them" Now described=true is only set when we actually send RowDescription. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b0725ee commit b309198

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/conn.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,6 @@ func (c *clientConn) handleDescribe(body []byte) {
10681068
c.sendError("ERROR", "34000", fmt.Sprintf("portal %q does not exist", name))
10691069
return
10701070
}
1071-
p.described = true
10721071

10731072
// For non-SELECT, send NoData
10741073
upperQuery := strings.ToUpper(strings.TrimSpace(p.stmt.query))
@@ -1105,6 +1104,9 @@ func (c *clientConn) handleDescribe(body []byte) {
11051104
return
11061105
}
11071106

1107+
// Only mark as described when we actually send RowDescription.
1108+
// If we sent NoData above, Execute should still send RowDescription.
1109+
p.described = true
11081110
c.sendRowDescription(cols, colTypes)
11091111

11101112
default:

0 commit comments

Comments
 (0)