PG15: handle pg_analyze_and_rewrite_* renaming.

From PG commit 791b1b71da.
pull/5920/head
Jeff Davis 2022-04-11 12:02:24 -07:00 committed by jeff-davis
parent 33ee4877d4
commit b6a5617ea8
4 changed files with 10 additions and 7 deletions

View File

@ -617,7 +617,8 @@ RewriteRawQueryStmt(RawStmt *rawStmt, const char *queryString, Oid *paramOids, i
numParams)
{
List *queryTreeList =
pg_analyze_and_rewrite(rawStmt, queryString, paramOids, numParams, NULL);
pg_analyze_and_rewrite_fixedparams(rawStmt, queryString, paramOids, numParams,
NULL);
if (list_length(queryTreeList) != 1)
{

View File

@ -49,9 +49,9 @@ deparse_shard_query_test(PG_FUNCTION_ARGS)
Node *parsetree = NULL;
foreach_ptr(parsetree, parseTreeList)
{
List *queryTreeList = pg_analyze_and_rewrite((RawStmt *) parsetree,
queryStringChar,
NULL, 0, NULL);
List *queryTreeList = pg_analyze_and_rewrite_fixedparams((RawStmt *) parsetree,
queryStringChar,
NULL, 0, NULL);
Query *query = NULL;
foreach_ptr(query, queryTreeList)

View File

@ -259,9 +259,9 @@ relation_count_in_query(PG_FUNCTION_ARGS)
Node *parsetree = NULL;
foreach_ptr(parsetree, parseTreeList)
{
List *queryTreeList = pg_analyze_and_rewrite((RawStmt *) parsetree,
queryStringChar,
NULL, 0, NULL);
List *queryTreeList = pg_analyze_and_rewrite_fixedparams((RawStmt *) parsetree,
queryStringChar,
NULL, 0, NULL);
Query *query = NULL;
foreach_ptr(query, queryTreeList)

View File

@ -34,6 +34,8 @@ typedef Value String;
#endif
#define RelationCreateStorage_compat(a, b, c) RelationCreateStorage(a, b)
#define pgstat_init_relation(r) pgstat_initstats(r)
#define pg_analyze_and_rewrite_fixedparams(a, b, c, d, e) pg_analyze_and_rewrite(a, b, c, \
d, e)
static inline int64
pg_strtoint64(char *s)