Skip to content

Commit

Permalink
Restore Attinmeta (by original rel, not RETURNING)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgrgis committed Dec 28, 2024
1 parent 5328180 commit b697b8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sqlite_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,7 @@ sqliteBeginForeignModify(ModifyTableState *mtstate,
SqliteFdwExecState *fmstate = NULL;
EState *estate = mtstate->ps.state;
Relation rel = resultRelInfo->ri_RelationDesc;
TupleDesc tupdesc = RelationGetDescr(rel);
AttrNumber n_params = 0;
Oid typefnoid = InvalidOid;
bool isvarlena = false;
Expand Down Expand Up @@ -1906,6 +1907,10 @@ sqliteBeginForeignModify(ModifyTableState *mtstate,
ALLOCSET_SMALL_INITSIZE,
ALLOCSET_SMALL_MAXSIZE);

/* Prepare for input conversion of RETURNING results. */
if (fmstate->has_returning)
fmstate->attinmeta = TupleDescGetAttInMetadata(tupdesc);

/* Set up for remaining transmittable parameters */
foreach(lc, fmstate->retrieved_attrs)
{
Expand Down Expand Up @@ -5425,7 +5430,7 @@ sqlite_store_returning_result(SqliteFdwExecState *fmstate,
{
if (SQLITE_ROW == rc )
{
/*

TupleDesc tupleDescriptor = tupleSlot->tts_tupleDescriptor;
make_tuple_from_result_row(fmstate->stmt,
tupleDescriptor,
Expand All @@ -5434,7 +5439,7 @@ sqlite_store_returning_result(SqliteFdwExecState *fmstate,
tupleSlot->tts_isnull,
fmstate->rel,
fmstate->attinmeta,
NULL);
NULL);/*
ereport(WARNING, (errcode(ERRCODE_FDW_UNABLE_TO_CREATE_EXECUTION), errmsg("row")));
*/
}
Expand Down

0 comments on commit b697b8b

Please sign in to comment.