Skip to content

Commit e3e4e17

Browse files
committed
fix build against master branch
1 parent 5492db8 commit e3e4e17

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/format.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
#include "plpgsql_check.h"
1515

1616
#include "access/htup_details.h"
17+
#include "catalog/pg_collation.h"
1718
#include "mb/pg_wchar.h"
18-
#include "tsearch/ts_locale.h"
1919
#include "utils/builtins.h"
20+
#include "utils/formatting.h"
2021
#include "utils/json.h"
2122
#include "utils/xml.h"
2223

@@ -165,7 +166,7 @@ plpgsql_check_format_num(char *format_str)
165166
{
166167
int result;
167168

168-
char *format_lower_str = lowerstr(format_str);
169+
char *format_lower_str = str_tolower(format_str, strlen(format_str), DEFAULT_COLLATION_OID);
169170

170171
if (strcmp(format_lower_str, "text") == 0)
171172
result = PLPGSQL_CHECK_FORMAT_TEXT;

src/plpgsql_check.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,14 @@ extern plpgsql_check__ns_lookup_t plpgsql_check__ns_lookup_p;
537537
#define FORMAT_0PARAM_OID 3540
538538
#define FORMAT_NPARAM_OID 3539
539539

540+
#if PG_VERSION_NUM < 180000
541+
540542
#ifndef TupleDescAttr
541543
#define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)])
542544
#endif
543545

546+
#endif
547+
544548
#define recvar_tuple(rec) (rec->erh ? expanded_record_get_tuple(rec->erh) : NULL)
545549
#define recvar_tupdesc(rec) (rec->erh ? expanded_record_fetch_tupdesc(rec->erh) : NULL)
546550

0 commit comments

Comments
 (0)