From: mason_s <ma...@us...> - 2010-06-16 15:08:42
|
Project "Postgres-XC". The branch, master has been updated via a0429d3f49568868602efb8881a79c3716201134 (commit) from b65c64d294d9a91583534d951b758c5bccacea48 (commit) - Log ----------------------------------------------------------------- commit a0429d3f49568868602efb8881a79c3716201134 Author: Mason S <masonsharp@mason-sharps-macbook.local> Date: Wed Jun 16 11:07:40 2010 -0400 Do not allow WITH RECURSIVE or windowing functions until we add support for them. diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index 78c13a1..cc8a664 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -403,7 +403,7 @@ get_plan_nodes_insert(Query *query) if (!IsA(tle->expr, Const)) { - eval_expr = eval_const_expressions(NULL, tle->expr); + eval_expr = eval_const_expressions(NULL, (Node *) tle->expr); checkexpr = get_numeric_constant(eval_expr); } @@ -540,7 +540,7 @@ examine_conditions(Special_Conditions *conditions, List *rtables, Node *expr_nod if (!IsA(arg2, Const)) { /* this gets freed when the memory context gets freed */ - Expr *eval_expr = eval_const_expressions(NULL, arg2); + Expr *eval_expr = eval_const_expressions(NULL, (Node *) arg2); checkexpr = get_numeric_constant(eval_expr); } @@ -1413,6 +1413,31 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) case T_DeleteStmt: /* just use first one in querytree_list */ query = (Query *) linitial(querytree_list); + + /* Perform some checks to make sure we can support the statement */ + if (nodeTag(parsetree) == T_SelectStmt) + { + if (query->intoClause) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("INTO clause not yet supported")))); + + if (query->setOperations) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("UNION, INTERSECT and EXCEPT are not yet supported")))); + + if (query->hasRecursive) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("WITH RECURSIVE not yet supported")))); + + if (query->hasWindowFuncs) + ereport(ERROR, + (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), + (errmsg("Window functions not yet supported")))); + } + query_step->exec_nodes = get_plan_nodes_command(query_plan, query); if (query_step->exec_nodes) @@ -1463,16 +1488,6 @@ GetQueryPlan(Node *parsetree, const char *sql_statement, List *querytree_list) */ if (nodeTag(parsetree) == T_SelectStmt) { - if (query->intoClause) - ereport(ERROR, - (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), - (errmsg("INTO clause not yet supported")))); - - if (query->setOperations) - ereport(ERROR, - (errcode(ERRCODE_STATEMENT_TOO_COMPLEX), - (errmsg("UNION, INTERSECT and EXCEPT are not yet supported")))); - if (StrictStatementChecking && query_step->exec_nodes && list_length(query_step->exec_nodes->nodelist) > 1) { ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/plan/planner.c | 39 +++++++++++++++++++++++++++------------ 1 files changed, 27 insertions(+), 12 deletions(-) hooks/post-receive -- Postgres-XC |