Skip to content

Recover the bare uint32 typedef in the catalog#62

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:fix/typerecover-uint32-hash-returns
Jul 16, 2026
Merged

Recover the bare uint32 typedef in the catalog#62
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:fix/typerecover-uint32-hash-returns

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The parser's type-recovery table (parser/typerecover.py _TYPE_MAP) restores the bare PostgreSQL integer typedefs that libclang collapses to int when parsing the MEOS headers without c.h. It maps int64 → int64_t and uint64 → uint64_t, but has no uint32 entry — so every MEOS *_hash function, declared uint32 in the headers, is recorded as a signed int in the catalog.

That signed int propagates to every generated binding: hash values >= 2**31 flip sign, and MobilityDuck registers span_hash/set_hash/spanset_hash as INTEGER rather than UINTEGER, disagreeing with both the hand surface and the *_hash_extended siblings (which recover to uint64_t).

This change adds the uint32 → uint32_t entry, mirroring uint64 → uint64_t, and a regression test asserting the *_hash returns recover to uint32_t.

With the entry present, all 17 *_hash functions record uint32_t, *_hash_extended stays uint64_t, and genuine int returns such as set_num_values are untouched.

The parser's type-recovery table restored the bare PostgreSQL uint64
typedef (hash seeds, cell ids) but not uint32, so every MEOS *_hash
return -- declared uint32 in the headers -- stayed collapsed to a signed
int. Hash values >= 2**31 then flipped sign in every generated binding
(e.g. MobilityDuck registered span_hash as INTEGER instead of UINTEGER).

Add the uint32 -> uint32_t entry, mirroring uint64 -> uint64_t, plus a
regression test asserting the *_hash returns recover, so this sibling of
the recurrently-dropped uint64 entry cannot be lost in a refactor.
@estebanzimanyi
estebanzimanyi merged commit 3a6ce4d into MobilityDB:master Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant