plcontainer icon indicating copy to clipboard operation
plcontainer copied to clipboard

WRONG ANSWER when the output record descriptor changes

Open BaiShaoqi opened this issue 6 years ago • 1 comments

Expected behavior


  v2 | v3 | v1
 ----+----+----
   2 |  3 |  1
 (1 row)

  v1 | v4 | v2
 ----+----+----
   1 |  3 |  2
 (1 row)

Actual behavior


  v2 | v3 | v1
 ----+----+----
   3 |  2 |  1
 (1 row)

ERROR: PL/Container client exception occurred: DETAIL: Cannot find key 'v3' in result dictionary for converting it into UDT

Step to reproduce the behavior

CREATE FUNCTION return_record_2(t text) RETURNS record AS $$
# container: plc_python_shared
return {'v1':1,'v2':2,t:3}
$$ LANGUAGE plcontainer;

SELECT * FROM return_record_2('v3') AS (v2 int, v3 int, v1 int);

SELECT * FROM return_record_2('v4') AS (v1 int, v4 int, v2 int);

BaiShaoqi avatar Jun 01 '18 07:06 BaiShaoqi