Skip to content

Commit

Permalink
Merge pull request cockroachdb#84218 from cockroachdb/blathers/backpo…
Browse files Browse the repository at this point in the history
…rt-release-22.1-83929
  • Loading branch information
rafiss authored Jul 12, 2022
2 parents 5acdaa8 + bff5bb3 commit 46a6390
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/sql/conn_executor_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,10 @@ func (ex *connExecutor) execDescribe(
res.SetPortalOutput(ctx, portal.Stmt.Columns, portal.OutFormats)
}
default:
return retErr(errors.AssertionFailedf(
"unknown describe type: %s", errors.Safe(descCmd.Type)))
return retErr(pgerror.Newf(
pgcode.ProtocolViolation,
"invalid DESCRIBE message subtype %d", errors.Safe(byte(descCmd.Type)),
))
}
return nil, nil
}
26 changes: 26 additions & 0 deletions pkg/sql/pgwire/testdata/pgtest/portals
Original file line number Diff line number Diff line change
Expand Up @@ -1460,3 +1460,29 @@ ReadyForQuery
{"Type":"DataRow","Values":[{"text":"2"}]}
{"Type":"CommandComplete","CommandTag":"FETCH 2"}
{"Type":"ReadyForQuery","TxStatus":"T"}

send
Query {"String": "ROLLBACK"}
----

until
ReadyForQuery
----
{"Type":"CommandComplete","CommandTag":"ROLLBACK"}
{"Type":"ReadyForQuery","TxStatus":"I"}

send
Parse {"Query": "SELECT * FROM generate_series(1, 4)"}
Describe
Bind
Execute
Sync
----

until keepErrMessage
ErrorResponse
ReadyForQuery
----
{"Type":"ParseComplete"}
{"Type":"ErrorResponse","Code":"08P01","Message":"invalid DESCRIBE message subtype 0"}
{"Type":"ReadyForQuery","TxStatus":"I"}

0 comments on commit 46a6390

Please sign in to comment.