Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit981e769

Browse files
committed
Add compat version of parse_analyze routine
1 parentf19deb3 commit981e769

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

‎src/include/compat/pg_compat.h

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,21 +347,39 @@ void McxtStatsInternal(MemoryContext context, int level,
347347
#endif
348348

349349

350+
/*
351+
* parse_analyze()
352+
*
353+
* for v10 cast first arg to RawStmt type
354+
*/
355+
#ifPG_VERSION_NUM >=100000
356+
#defineparse_analyze_compat(parse_tree,query_string,param_types,nparams, \
357+
query_env) \
358+
parse_analyze((RawStmt *) (parse_tree), (query_string), (param_types), \
359+
(nparams), (query_env))
360+
#elifPG_VERSION_NUM >=90500
361+
#defineparse_analyze_compat(parse_tree,query_string,param_types,nparams, \
362+
query_env) \
363+
parse_analyze((Node *) (parse_tree), (query_string), (param_types), \
364+
(nparams))
365+
#endif
366+
367+
350368
/*
351369
* pg_analyze_and_rewrite
352370
*
353371
* for v10 cast first arg to RawStmt type
354372
*/
355373
#ifPG_VERSION_NUM >=100000
356-
#definepg_analyze_and_rewrite_compat(parsetree,query_string,paramTypes, \
357-
numParams,queryEnv) \
374+
#definepg_analyze_and_rewrite_compat(parsetree,query_string,param_types, \
375+
nparams,query_env) \
358376
pg_analyze_and_rewrite((RawStmt *) (parsetree), (query_string), \
359-
(paramTypes), (numParams), (queryEnv))
377+
(param_types), (nparams), (query_env))
360378
#elifPG_VERSION_NUM >=90500
361-
#definepg_analyze_and_rewrite_compat(parsetree,query_string,paramTypes, \
362-
numParams,queryEnv) \
379+
#definepg_analyze_and_rewrite_compat(parsetree,query_string,param_types, \
380+
nparams,query_env) \
363381
pg_analyze_and_rewrite((Node *) (parsetree), (query_string), \
364-
(paramTypes), (numParams))
382+
(param_types), (nparams))
365383
#endif
366384

367385

‎src/relation_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ canonicalize_partitioning_expression(const Oid relid,
798798
(void)parse_partitioning_expression(relid,expr_cstr,
799799
&query_string,&parse_tree);
800800

801-
query=parse_analyze(parse_tree,query_string,NULL,0);
801+
query=parse_analyze_compat(parse_tree,query_string,NULL,0,NULL);
802802
expr= ((TargetEntry*)linitial(query->targetList))->expr;
803803

804804
/* We don't care about memory efficiency here */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp