mirror of
https://github.com/HypoPG/hypopg
synced 2026-05-23 09:08:45 +00:00
Fix long standing Int8GetDatum bugs
A plain SQL integer (int4) should use Int32GetDatum. Also, pg_amproc.amprocnum is a smallint (int2), so the correct macro to get a Datum is Int16GetDatum.
This commit is contained in:
parent
0b5782baff
commit
f44074fa5e
1 changed files with 3 additions and 3 deletions
|
|
@ -1249,7 +1249,7 @@ hypopg(PG_FUNCTION_ARGS)
|
|||
values[i++] = CStringGetTextDatum(entry->indexname);
|
||||
values[i++] = ObjectIdGetDatum(entry->oid);
|
||||
values[i++] = ObjectIdGetDatum(entry->relid);
|
||||
values[i++] = Int8GetDatum(entry->ncolumns);
|
||||
values[i++] = Int32GetDatum(entry->ncolumns);
|
||||
values[i++] = BoolGetDatum(entry->unique);
|
||||
values[i++] = PointerGetDatum(buildint2vector(entry->indexkeys, entry->ncolumns));
|
||||
values[i++] = PointerGetDatum(buildoidvector(entry->indexcollations, entry->ncolumns));
|
||||
|
|
@ -2290,7 +2290,7 @@ hypo_can_return(hypoIndex * entry, Oid atttype, int i, char *amname)
|
|||
ObjectIdGetDatum(entry->opfamily[i]),
|
||||
ObjectIdGetDatum(entry->opcintype[i]),
|
||||
ObjectIdGetDatum(entry->opcintype[i]),
|
||||
Int8GetDatum(GIST_FETCH_PROC));
|
||||
Int16GetDatum(GIST_FETCH_PROC));
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
return false;
|
||||
|
|
@ -2315,7 +2315,7 @@ hypo_can_return(hypoIndex * entry, Oid atttype, int i, char *amname)
|
|||
ObjectIdGetDatum(entry->opfamily[i]),
|
||||
ObjectIdGetDatum(entry->opcintype[i]),
|
||||
ObjectIdGetDatum(entry->opcintype[i]),
|
||||
Int8GetDatum(SPGIST_CONFIG_PROC));
|
||||
Int16GetDatum(SPGIST_CONFIG_PROC));
|
||||
|
||||
/* just in case */
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
|
|
|
|||
Loading…
Reference in a new issue