| From: | PG Bug reporting form <noreply(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Cc: | rekgrpth(at)gmail(dot)com |
| Subject: | BUG #16268: SPI_getvalue requires IsTransactionState but TextDatumGetCString of SPI_getbinval - not! |
| Date: | 2020-02-20 05:06:24 |
| Message-ID: | 16268-3d91474b3e57a5bf@postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 16268
Logged by: RekGRpth
Email address: rekgrpth(at)gmail(dot)com
PostgreSQL version: 12.2
Operating system: Docker alpine edge
Description:
const char *data = SPI_getvalue(SPI_tuptable->vals[row],
SPI_tuptable->tupdesc, SPI_fnumber(SPI_tuptable->tupdesc, "data"));
raise TRAP: FailedAssertion("!(IsTransactionState())", File: "catcache.c",
Line: 1213)
but
const char *data = SPI_getvalue_my(SPI_tuptable->vals[row],
SPI_tuptable->tupdesc, SPI_fnumber(SPI_tuptable->tupdesc, "data"));
where
char *SPI_getvalue_my(HeapTuple tuple, TupleDesc tupdesc, int fnumber) {
bool isnull;
Datum datum = SPI_getbinval(tuple, tupdesc, fnumber, &isnull);
if (isnull) return NULL;
return TextDatumGetCString(datum);
}
works ok
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2020-02-20 05:31:31 | Re: BUG #16268: SPI_getvalue requires IsTransactionState but TextDatumGetCString of SPI_getbinval - not! |
| Previous Message | Artur Zakirov | 2020-02-20 01:04:54 | Re: Full text search bug ('russian' regconfig) |