sql: prepared statement doesn't work with CHAR type
Describe the problem
When using Spring Batch with the default job repository using cockroach as the backend, SQL error happens.
In my understanding, when cockroach receives a prepared statement, it will decode the arguments by encoding.go#DecodeOidDatum.
In #28951, the handling of string types is improved. However, in the switch case statement inside DecodeOidDatum, oid.T_bpchar is not processed, leading to the error unsupported OID %v with format code %s.
To Reproduce
When Spring Batch is configured with the default options, the error will happen.
Expected behavior
oid.T_bpchar should be handled in DecodeOidDatum.
Additional data / screenshots
Environment:
- CockroachDB version : 2.1.0
- Server OS: Docker on macOS
- Client app: JDBC / Spring Batch
Additional context
Thanks for your analysis!
@mjibson could you have a look?
Yes, I think we can easily support this.