Fixed a long-standing bug but having done no harm over all existing
versions. SPI_execute_plan's third paramter is char [] but it is
called with bool []. The bool value is false and it is different from
'n', which represents !is_null so it has been worked as expected as the
result.
Oid argtypes[3] = { OIDOID, INT2OID, BOOLOID };
int nargs;
Datum values[3];
- bool nulls[3] = { false, false, false };
Oid save_userid;
int save_sec_context;
values[1] = Int16GetDatum(attnum ? *attnum : 0);
values[2] = BoolGetDatum(inh);
- ret = SPI_execute_plan(*plan, values, nulls, true, 1);
+ ret = SPI_execute_plan(*plan, values, NULL, true, 1);
}
PG_CATCH();
{