Skip to content

Commit ecd6e77

Browse files
committed
fix build and tests for current dev
1 parent 4790a62 commit ecd6e77

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

expected/plpgsql_check_active_4.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,8 +3175,7 @@ end;
31753175
$$ language plpgsql;
31763176
-- should to fail
31773177
select testseq();
3178-
ERROR: cannot open relation "test_table"
3179-
DETAIL: This operation is not supported for tables.
3178+
ERROR: "test_table" is not a sequence
31803179
CONTEXT: SQL statement "SELECT nextval('test_table')"
31813180
PL/pgSQL function testseq() line 3 at PERFORM
31823181
select * from plpgsql_check_function('testseq()', fatal_errors := false);

src/check_function.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,11 @@ plpgsql_check_setup_fcinfo(plpgsql_check_info *cinfo,
10051005
TupleDescInitEntry(resultTupleDesc,
10061006
(AttrNumber) 1, "__result__",
10071007
result_rettype, -1, 0);
1008+
1009+
#if PG_VERSION_NUM >= 190000
1010+
TupleDescFinalize(resultTupleDesc);
1011+
#endif
1012+
10081013
resultTupleDesc = BlessTupleDesc(resultTupleDesc);
10091014
}
10101015
}

src/format.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#include "utils/json.h"
2222
#include "utils/xml.h"
2323

24+
#if PG_VERSION_NUM >= 190000
25+
#include "utils/tuplestore.h"
26+
#endif
27+
2428
static void put_text_line(plpgsql_check_result_info *ri, const char *message, int len);
2529
static const char *error_level_str(int level);
2630
static void init_tag(plpgsql_check_result_info *ri, Oid fn_oid);

src/plpgsql_check.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include "access/tupdesc.h"
88
#include "storage/ipc.h"
99

10+
#if PG_VERSION_NUM >= 190000
11+
#include "portability/instr_time.h"
12+
#endif
13+
1014
typedef uint64 pc_queryid;
1115
#define NOQUERYID (UINT64CONST(0))
1216

src/typdesc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,10 @@ plpgsql_check_expr_get_desc(PLpgSQL_checkstate *cstate,
432432

433433
TupleDescInitEntry(rettupdesc, 1, "__array_element__", elemtype, -1, 0);
434434

435+
#if PG_VERSION_NUM >= 190000
436+
TupleDescFinalize(rettupdesc);
437+
#endif
438+
435439
FreeTupleDesc(tupdesc);
436440
BlessTupleDesc(rettupdesc);
437441

@@ -580,6 +584,10 @@ plpgsql_check_expr_get_desc(PLpgSQL_checkstate *cstate,
580584
i++;
581585
}
582586

587+
#if PG_VERSION_NUM >= 190000
588+
TupleDescFinalize(rettupdesc);
589+
#endif
590+
583591
FreeTupleDesc(tupdesc);
584592
BlessTupleDesc(rettupdesc);
585593

0 commit comments

Comments
 (0)