Be more careful about int vs. Oid in ecpglib.
Tom Lane <tgl@sss.pgh.pa.us>
Be more careful about int vs. Oid in ecpglib. Print an OID value inserted into a SQL query with %u not %d. The existing code accidentally fails to malfunction when given an OID above 2^31, but only accidentally; future changes to our SQL parser could perhaps break it. Declare the Oid values that ecpg_type_infocache_push() and ecpg_is_type_an_array() work with as "Oid" not "int". This doesn't have any functional effect, but it's clearer. At the moment I don't see a need to back-patch this. Bug: #19429 Author: fairyfar@msn.com Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/19429-aead3b1874be1a99@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/interfaces/ecpg/ecpglib/ecpglib_extern.h | modified | +1 −1 |
| src/interfaces/ecpg/ecpglib/execute.c | modified | +5 −4 |
Discussion
- BUG #19429: An issue regarding the processing of Oid as an int type in ecpg 2 messages · 2026-03-12 → 2026-03-15