cockroachdb / cockroachdb/cockroach
sql: improve "cached plan must not change" error message
Open
C-cleanup
E-quick-win
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
The "cached plan must not change" error is returned when we execute a prepared statement and the return schema of the statement changed.
https://github.com/cockroachdb/cockroach/blob/157e57d1f0cb88cf4a4787e807a565196479659e/pkg/sql/plan_opt.go#L671
The message here is very confusing. This has nothing to do with caching the plan, or even with the plan itself. We should check what error Postgres returns in this case and make it the same.
Jira issue: CRDB-25063
Contributor guide
Assessment
This issue has not been assessed yet.