You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(3) |
2
(5) |
3
|
4
(4) |
5
|
6
|
7
(7) |
8
(10) |
9
(6) |
10
(5) |
11
(1) |
12
|
13
|
14
|
15
|
16
|
17
(4) |
18
(1) |
19
|
20
|
21
(5) |
22
(15) |
23
(18) |
24
(7) |
25
(4) |
26
|
27
|
28
(3) |
29
(2) |
30
(11) |
31
(4) |
|
|
From: Abbas B. <ga...@us...> - 2011-03-28 17:00:29
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via f61d2df4e202e715877b676bbb194552588b43bd (commit) via 09be104bfe29525f3423b3b07a9f88b943c8845e (commit) from 75b80f6575e6c29dc07d2e8cd803a8c2cb309bde (commit) - Log ----------------------------------------------------------------- commit f61d2df4e202e715877b676bbb194552588b43bd Merge: 09be104 75b80f6 Author: Abbas <abb...@en...> Date: Mon Mar 28 21:58:20 2011 +0500 Merge branch 'merge_postgres_9_0_3' of ssh://postgres-xc.git.sourceforge.net/gitroot/postgres-xc/postgres-xc into merge_postgres_9_0_3 commit 09be104bfe29525f3423b3b07a9f88b943c8845e Author: Abbas <abb...@en...> Date: Mon Mar 28 21:49:14 2011 +0500 This patch fixes the problem in XC that error detail was not being handled. This would fix bug id 3220325 and numeric test case would now pass. diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 95f23f3..7c9ec5b 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -213,6 +213,7 @@ CreateResponseCombiner(int node_count, CombineType combine_type) combiner->copy_in_count = 0; combiner->copy_out_count = 0; combiner->errorMessage = NULL; + combiner->errorDetail = NULL; combiner->query_Done = false; combiner->currentRow.msg = NULL; combiner->currentRow.msglen = 0; @@ -812,6 +813,11 @@ HandleError(RemoteQueryState *combiner, char *msg_body, size_t len) memcpy(combiner->errorCode, code, 5); } + if (!combiner->errorDetail && detail != NULL) + { + combiner->errorDetail = pstrdup(detail); + } + /* * If data node have sent ErrorResponse it will never send CommandComplete. * Increment the counter to prevent endless waiting for it. @@ -950,6 +956,8 @@ CloseCombiner(RemoteQueryState *combiner) FreeTupleDesc(combiner->tuple_desc); if (combiner->errorMessage) pfree(combiner->errorMessage); + if (combiner->errorDetail) + pfree(combiner->errorDetail); if (combiner->cursor_connections) pfree(combiner->cursor_connections); if (combiner->tapenodes) @@ -994,6 +1002,8 @@ ValidateAndResetCombiner(RemoteQueryState *combiner) list_free_deep(combiner->rowBuffer); if (combiner->errorMessage) pfree(combiner->errorMessage); + if (combiner->errorDetail) + pfree(combiner->errorDetail); if (combiner->tapenodes) pfree(combiner->tapenodes); @@ -1006,6 +1016,7 @@ ValidateAndResetCombiner(RemoteQueryState *combiner) combiner->copy_in_count = 0; combiner->copy_out_count = 0; combiner->errorMessage = NULL; + combiner->errorDetail = NULL; combiner->query_Done = false; combiner->currentRow.msg = NULL; combiner->currentRow.msglen = 0; @@ -3344,9 +3355,14 @@ do_query(RemoteQueryState *node) if (node->errorMessage) { char *code = node->errorCode; - ereport(ERROR, - (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), - errmsg("%s", node->errorMessage))); + if (node->errorDetail != NULL) + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", node->errorMessage), errdetail("%s", node->errorDetail) )); + else + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", node->errorMessage))); } } @@ -3712,9 +3728,14 @@ handle_results: if (node->errorMessage) { char *code = node->errorCode; - ereport(ERROR, - (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), - errmsg("%s", node->errorMessage))); + if (node->errorDetail != NULL) + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", node->errorMessage), errdetail("%s", node->errorDetail) )); + else + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", node->errorMessage))); } /* @@ -4311,9 +4332,14 @@ ExecRemoteUtility(RemoteQuery *node) if (remotestate->errorMessage) { char *code = remotestate->errorCode; - ereport(ERROR, - (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), - errmsg("%s", remotestate->errorMessage))); + if (remotestate->errorDetail != NULL) + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", remotestate->errorMessage), errdetail("%s", remotestate->errorDetail) )); + else + ereport(ERROR, + (errcode(MAKE_SQLSTATE(code[0], code[1], code[2], code[3], code[4])), + errmsg("%s", remotestate->errorMessage))); } } diff --git a/src/include/pgxc/execRemote.h b/src/include/pgxc/execRemote.h index 2b8b8ce..1113468 100644 --- a/src/include/pgxc/execRemote.h +++ b/src/include/pgxc/execRemote.h @@ -82,6 +82,7 @@ typedef struct RemoteQueryState int copy_out_count; /* count of received CopyOut messages */ char errorCode[5]; /* error code to send back to client */ char *errorMessage; /* error message to send back to client */ + char *errorDetail; /* error detail to send back to client */ bool query_Done; /* query has been sent down to data nodes */ RemoteDataRowData currentRow; /* next data ro to be wrapped into a tuple */ /* TODO use a tuplestore as a rowbuffer */ diff --git a/src/test/regress/expected/numeric_1.out b/src/test/regress/expected/numeric_1.out index 89c19c9..b93d694 100644 --- a/src/test/regress/expected/numeric_1.out +++ b/src/test/regress/expected/numeric_1.out @@ -688,10 +688,12 @@ INSERT INTO fract_only VALUES (1, '0.0'); INSERT INTO fract_only VALUES (2, '0.1'); INSERT INTO fract_only VALUES (3, '1.0'); -- should fail ERROR: numeric field overflow +DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1. INSERT INTO fract_only VALUES (4, '-0.9999'); INSERT INTO fract_only VALUES (5, '0.99994'); INSERT INTO fract_only VALUES (6, '0.99995'); -- should fail ERROR: numeric field overflow +DETAIL: A field with precision 4, scale 4 must round to an absolute value less than 1. INSERT INTO fract_only VALUES (7, '0.00001'); INSERT INTO fract_only VALUES (8, '0.00017'); SELECT * FROM fract_only ORDER BY id; @@ -1035,16 +1037,16 @@ SELECT '' AS to_char_15, to_char(val, 'FM9999999990999999.099999999999999') FRO SELECT '' AS to_char_16, to_char(val, 'L9999999999999999.099999999999999') FROM num_data ORDER BY val; to_char_16 | to_char ------------+------------------------------------ - | $ -83028485.000000000000000 + | -83028485.000000000000000 | -34338492.215397047000000 - | $ -24926804.045047420000000 - | $ .000000000000000 - | $ .000000000000000 + | -24926804.045047420000000 + | .000000000000000 + | .000000000000000 | 4.310000000000000 | 16397.038491000000000 | 74881.000000000000000 - | $ 93901.577630260000000 - | $ 7799461.411900000000000 + | 93901.577630260000000 + | 7799461.411900000000000 (10 rows) SELECT '' AS to_char_17, to_char(val, 'FM9999999999999999.99999999999999') FROM num_data ORDER BY val; @@ -1137,6 +1139,21 @@ SELECT '' AS to_char_22, to_char(val, 'FM9999999999999999.999999999999999') FROM | 7799461.4119 (10 rows) +SELECT '' AS to_char_23, to_char(val, '9.999EEEE') FROM num_data ORDER BY val; + to_char_23 | to_char +------------+------------ + | -8.303e+07 + | -3.434e+07 + | -2.493e+07 + | 0.000e+00 + | 0.000e+00 + | 4.310e+00 + | 1.640e+04 + | 7.488e+04 + | 9.390e+04 + | 7.799e+06 +(10 rows) + -- TO_NUMBER() -- SELECT '' AS to_number_1, to_number('-34,338,492', '99G999G999'); diff --git a/src/test/regress/sql/numeric.sql b/src/test/regress/sql/numeric.sql index 83ee939..1ab688c 100644 --- a/src/test/regress/sql/numeric.sql +++ b/src/test/regress/sql/numeric.sql @@ -762,6 +762,7 @@ SELECT '' AS to_char_19, to_char(val, 'FMS 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 SELECT '' AS to_char_20, to_char(val, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM num_data ORDER BY val; SELECT '' AS to_char_21, to_char(val, '999999SG9999999999') FROM num_data ORDER BY val; SELECT '' AS to_char_22, to_char(val, 'FM9999999999999999.999999999999999') FROM num_data ORDER BY val; +SELECT '' AS to_char_23, to_char(val, '9.999EEEE') FROM num_data ORDER BY val; -- TO_NUMBER() -- ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/pool/execRemote.c | 44 ++++++++++++++++++++++++------ src/include/pgxc/execRemote.h | 1 + src/test/regress/expected/numeric_1.out | 29 ++++++++++++++++---- src/test/regress/sql/numeric.sql | 1 + 4 files changed, 60 insertions(+), 15 deletions(-) hooks/post-receive -- Postgres-XC |
From: Michael P. <mic...@us...> - 2011-03-28 16:41:26
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 75b80f6575e6c29dc07d2e8cd803a8c2cb309bde (commit) from 6654fe0c6fac62e0351b3a409d26861789e9906b (commit) - Log ----------------------------------------------------------------- commit 75b80f6575e6c29dc07d2e8cd803a8c2cb309bde Author: Michael P <mic...@us...> Date: Tue Mar 29 00:41:24 2011 +0900 Fix for VIEW and SEQUENCE Views were only created on local Coordinator but they need to be created on all Coordinators. DROP VIEW was made on all the nodes, but now it is made only on Coordinator. ALTER SEQUENCE/VIEW ... SET SCHEMA ... ALTER SEQUENCE/VIEW ... RENAME TO ... are also correctly fixed. There was an issue with sequence renaming: CREATE SEQUENCE foo; ALTER SEQUENCE foo RENAME TO foobar; CREATE SEQUENCE foo; -- ERROR Error was caused by sequence with former name which was not correctly removed on GTM. diff --git a/src/backend/access/transam/gtm.c b/src/backend/access/transam/gtm.c index a9bf1d6..e9f0229 100644 --- a/src/backend/access/transam/gtm.c +++ b/src/backend/access/transam/gtm.c @@ -422,7 +422,7 @@ RenameSequenceGTM(char *seqname, const char *newseqname) seqkey.gsk_keylen = strlen(seqname); seqkey.gsk_key = seqname; newseqkey.gsk_keylen = strlen(newseqname); - newseqkey.gsk_key = (char *)newseqname; + newseqkey.gsk_key = (char *) newseqname; return conn ? rename_sequence(conn, &seqkey, &newseqkey) : -1; } diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c index 09ae5c3..4496bcd 100644 --- a/src/backend/commands/schemacmds.c +++ b/src/backend/commands/schemacmds.c @@ -33,6 +33,7 @@ #ifdef PGXC #include "pgxc/pgxc.h" +#include "pgxc/planner.h" #endif static void AlterSchemaOwner_internal(HeapTuple tup, Relation rel, Oid newOwnerId); @@ -131,7 +132,7 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString) * Add a RemoteQuery node for a query at top level on a remote Coordinator */ if (is_top_level) - parsetree_list = AddRemoteQueryNode(parsetree_list, queryString); + parsetree_list = AddRemoteQueryNode(parsetree_list, queryString, EXEC_ON_ALL_NODES); #endif /* diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 8a921f5..aceee06 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -1448,7 +1448,7 @@ GetGlobalSeqName(Relation seqrel, const char *new_seqname, const char *new_schem /* Get all the necessary relation names */ dbname = get_database_name(seqrel->rd_node.dbNode); - + if (new_seqname) relname = (char *) new_seqname; else diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 18e9358..67a14c8 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -80,6 +80,7 @@ #ifdef PGXC #include "pgxc/pgxc.h" #include "access/gtm.h" +#include "commands/sequence.h" #endif /* @@ -7962,6 +7963,26 @@ AlterTableNamespace(RangeVar *relation, const char *newschema, heap_close(classRel, RowExclusiveLock); +#ifdef PGXC + /* Rename also sequence on GTM for a sequence */ + if (IS_PGXC_COORDINATOR && + !IsConnFromCoord() && + rel->rd_rel->relkind == RELKIND_SEQUENCE) + { + char *seqname = GetGlobalSeqName(rel, NULL, NULL); + char *newseqname = GetGlobalSeqName(rel, NULL, newschema); + + /* We also need to rename it on the GTM */ + if (RenameSequenceGTM(seqname, newseqname) < 0) + ereport(ERROR, + (errcode(ERRCODE_CONNECTION_FAILURE), + errmsg("GTM error, could not rename sequence"))); + + pfree(seqname); + pfree(newseqname); + } +#endif + /* close rel, but keep lock until commit */ relation_close(rel, NoLock); } diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 21b5cfd..9b48756 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -2633,30 +2633,4 @@ checkLocalFKConstraints(CreateStmtContext *cxt) } } } - -/* - * AddRemoteQueryNode - * - * Add a Remote Query node to launch on Datanodes. - * This can only be done for a query a Top Level to avoid - * duplicated queries on Datanodes. - */ -List * -AddRemoteQueryNode(List *stmts, const char *queryString) -{ - List *result = stmts; - - /* Only a remote Coordinator is allowed to send a query to backend nodes */ - if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) - { - RemoteQuery *step = makeNode(RemoteQuery); - step->combine_type = COMBINE_TYPE_SAME; - step->sql_statement = queryString; - /* This query is a DDL, Launch it on both Datanodes and Coordinators. */ - step->exec_type = EXEC_ON_ALL_NODES; - result = lappend(result, step); - } - - return result; -} #endif diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index 90031fa..45c453a 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -33,6 +33,7 @@ #include "parser/parse_agg.h" #include "parser/parse_coerce.h" #include "pgxc/execRemote.h" +#include "pgxc/pgxc.h" #include "pgxc/locator.h" #include "pgxc/planner.h" #include "tcop/pquery.h" @@ -3353,3 +3354,27 @@ GetHashExecNodes(RelationLocInfo *rel_loc_info, ExecNodes **exec_nodes, const Ex } +/* + * AddRemoteQueryNode + * + * Add a Remote Query node to launch on Datanodes. + * This can only be done for a query a Top Level to avoid + * duplicated queries on Datanodes. + */ +List * +AddRemoteQueryNode(List *stmts, const char *queryString, RemoteQueryExecType remoteExecType) +{ + List *result = stmts; + + /* Only a remote Coordinator is allowed to send a query to backend nodes */ + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) + { + RemoteQuery *step = makeNode(RemoteQuery); + step->combine_type = COMBINE_TYPE_SAME; + step->sql_statement = queryString; + step->exec_type = remoteExecType; + result = lappend(result, step); + } + + return result; +} diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index d06fdb2..284a52c 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -615,7 +615,7 @@ standard_ProcessUtility(Node *parsetree, * Add a RemoteQuery node for a query at top level on a remote Coordinator */ if (isTopLevel) - stmts = AddRemoteQueryNode(stmts, queryString); + stmts = AddRemoteQueryNode(stmts, queryString, EXEC_ON_ALL_NODES); #endif /* ... and do it */ @@ -773,14 +773,14 @@ standard_ProcessUtility(Node *parsetree, } #ifdef PGXC /* - * PGXCTODO - * We may need to check details of the object being dropped and + * We need to check details of the object being dropped and * run command on correct nodes */ - if (IS_PGXC_COORDINATOR) + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) { - /* Sequence exists only on Coordinators */ - if (stmt->removeType == OBJECT_SEQUENCE) + /* Sequence and views exists only on Coordinators */ + if (stmt->removeType == OBJECT_SEQUENCE || + stmt->removeType == OBJECT_VIEW) ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_COORDS); else ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); @@ -854,7 +854,8 @@ standard_ProcessUtility(Node *parsetree, RemoteQueryExecType remoteExecType = EXEC_ON_ALL_NODES; RenameStmt *stmt = (RenameStmt *) parsetree; - if (stmt->renameType == OBJECT_SEQUENCE) + if (stmt->renameType == OBJECT_SEQUENCE || + stmt->renameType == OBJECT_VIEW) remoteExecType = EXEC_ON_COORDS; else if (stmt->renameType == OBJECT_TABLE) { @@ -872,8 +873,23 @@ standard_ProcessUtility(Node *parsetree, case T_AlterObjectSchemaStmt: #ifdef PGXC - if (IS_PGXC_COORDINATOR) - ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_ALL_NODES); + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) + { + RemoteQueryExecType remoteExecType = EXEC_ON_ALL_NODES; + AlterObjectSchemaStmt *stmt = (AlterObjectSchemaStmt *) parsetree; + + if (stmt->objectType == OBJECT_SEQUENCE || + stmt->objectType == OBJECT_VIEW) + remoteExecType = EXEC_ON_COORDS; + else if (stmt->objectType == OBJECT_TABLE) + { + Oid relid = RangeVarGetRelid(stmt->relation, false); + + if (get_rel_relkind(relid) == RELKIND_SEQUENCE) + remoteExecType = EXEC_ON_COORDS; + } + ExecUtilityStmtOnNodes(queryString, NULL, false, remoteExecType); + } #endif ExecAlterObjectSchemaStmt((AlterObjectSchemaStmt *) parsetree); break; @@ -895,7 +911,23 @@ standard_ProcessUtility(Node *parsetree, * Add a RemoteQuery node for a query at top level on a remote Coordinator */ if (isTopLevel) - stmts = AddRemoteQueryNode(stmts, queryString); + { + RemoteQueryExecType remoteExecType = EXEC_ON_ALL_NODES; + AlterTableStmt *stmt = (AlterTableStmt *) parsetree; + + if (stmt->relkind == OBJECT_VIEW || + stmt->relkind == OBJECT_SEQUENCE) + remoteExecType = EXEC_ON_COORDS; + else if (stmt->relkind == OBJECT_TABLE) + { + Oid relid = RangeVarGetRelid(stmt->relation, false); + + if (get_rel_relkind(relid) == RELKIND_SEQUENCE) + remoteExecType = EXEC_ON_COORDS; + } + + stmts = AddRemoteQueryNode(stmts, queryString, remoteExecType); + } #endif /* ... and do it */ @@ -1057,6 +1089,10 @@ standard_ProcessUtility(Node *parsetree, case T_ViewStmt: /* CREATE VIEW */ DefineView((ViewStmt *) parsetree, queryString); +#ifdef PGXC + if (IS_PGXC_COORDINATOR) + ExecUtilityStmtOnNodes(queryString, NULL, false, EXEC_ON_COORDS); +#endif break; case T_CreateFunctionStmt: /* CREATE FUNCTION */ diff --git a/src/gtm/Makefile.global b/src/gtm/Makefile.global index bfc052f..684690b 100644 --- a/src/gtm/Makefile.global +++ b/src/gtm/Makefile.global @@ -29,7 +29,7 @@ enable_shared = yes # Compilers CPP = gcc -E -CPPFLAGS = -D_GNU_SOURCE +CPPFLAGS = -g -D_GNU_SOURCE override CPPFLAGS := -I$(top_srcdir)/include $(CPPFLAGS) diff --git a/src/gtm/main/gtm_seq.c b/src/gtm/main/gtm_seq.c index 8c15fe9..f6c4a21 100644 --- a/src/gtm/main/gtm_seq.c +++ b/src/gtm/main/gtm_seq.c @@ -636,6 +636,8 @@ GTM_SeqRename(GTM_SequenceKey seqkey, GTM_SequenceKey newseqkey) /* Release first the structure as it has been taken previously */ seq_release_seqinfo(seqinfo); + /* Close sequence properly, full name is here */ + seqkey->gsk_type = GTM_SEQ_FULL_NAME; /* Then close properly the old sequence */ GTM_SeqClose(seqkey); return errcode; diff --git a/src/include/parser/parse_utilcmd.h b/src/include/parser/parse_utilcmd.h index 256c583..3f9b8f9 100644 --- a/src/include/parser/parse_utilcmd.h +++ b/src/include/parser/parse_utilcmd.h @@ -27,7 +27,6 @@ extern void transformRuleStmt(RuleStmt *stmt, const char *queryString, extern List *transformCreateSchemaStmt(CreateSchemaStmt *stmt); #ifdef PGXC extern bool CheckLocalIndexColumn (char loctype, char *partcolname, char *indexcolname); -extern List *AddRemoteQueryNode(List *stmts, const char *queryString); #endif #endif /* PARSE_UTILCMD_H */ diff --git a/src/include/pgxc/planner.h b/src/include/pgxc/planner.h index 4e4cd62..b69f940 100644 --- a/src/include/pgxc/planner.h +++ b/src/include/pgxc/planner.h @@ -210,4 +210,6 @@ extern bool is_immutable_func(Oid funcid); extern bool IsJoinReducible(RemoteQuery *innernode, RemoteQuery *outernode, List *rtable_list, JoinPath *join_path, JoinReduceInfo *join_info); +extern List *AddRemoteQueryNode(List *stmts, const char *queryString, RemoteQueryExecType remoteExecType); + #endif /* PGXCPLANNER_H */ diff --git a/src/test/regress/expected/privileges_1.out b/src/test/regress/expected/privileges_1.out index 90043e4..94b9267 100644 --- a/src/test/regress/expected/privileges_1.out +++ b/src/test/regress/expected/privileges_1.out @@ -1226,29 +1226,16 @@ ERROR: function testfunc2(integer) does not exist DROP FUNCTION testfunc4(boolean); ERROR: function testfunc4(boolean) does not exist DROP VIEW atestv1; -ERROR: view "atestv1" does not exist DROP VIEW atestv2; -ERROR: view "atestv2" does not exist -- this should cascade to drop atestv4 DROP VIEW atestv3 CASCADE; NOTICE: drop cascades to view atestv4 -ERROR: view "atestv3" does not exist -- this should complain "does not exist" DROP VIEW atestv4; ERROR: view "atestv4" does not exist DROP TABLE atest1; -ERROR: cannot drop table atest1 because other objects depend on it -DETAIL: view atestv1 depends on table atest1 -HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP TABLE atest2; -ERROR: cannot drop table atest2 because other objects depend on it -DETAIL: view atestv2 depends on table atest2 -HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP TABLE atest3; -ERROR: cannot drop table atest3 because other objects depend on it -DETAIL: view atestv3 depends on table atest3 -view atestv4 depends on view atestv3 -HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP TABLE atest4; DROP TABLE atest5; DROP TABLE atest6; @@ -1268,43 +1255,13 @@ SELECT lo_unlink(oid) FROM pg_largeobject_metadata; DROP GROUP regressgroup1; DROP GROUP regressgroup2; -ERROR: role "regressgroup2" cannot be dropped because some objects depend on it -DETAIL: privileges for table atest3 -- these are needed to clean up permissions REVOKE USAGE ON LANGUAGE sql FROM regressuser1; DROP OWNED BY regressuser1; -ERROR: cannot drop desired object(s) because other objects depend on them -DETAIL: view atestv1 depends on table atest1 -view atestv2 depends on table atest2 -HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP USER regressuser1; -ERROR: role "regressuser1" cannot be dropped because some objects depend on it -DETAIL: owner of default privileges on new functions belonging to role regressuser1 -owner of table atest2 -owner of table atest1 DROP USER regressuser2; -ERROR: role "regressuser2" cannot be dropped because some objects depend on it -DETAIL: privileges for view atestv4 -privileges for view atestv2 -privileges for table atest2 -privileges for table atest1 DROP USER regressuser3; -ERROR: role "regressuser3" cannot be dropped because some objects depend on it -DETAIL: owner of view atestv3 -owner of view atestv2 -owner of view atestv1 -owner of table atest3 -privileges for table atest2 -privileges for table atest1 DROP USER regressuser4; -ERROR: role "regressuser4" cannot be dropped because some objects depend on it -DETAIL: owner of view atestv4 -privileges for view atestv3 -privileges for view atestv1 -privileges for table atest2 -privileges for table atest1 DROP USER regressuser5; -ERROR: role "regressuser5" cannot be dropped because some objects depend on it -DETAIL: privileges for table atest2 DROP USER regressuser6; ERROR: role "regressuser6" does not exist ----------------------------------------------------------------------- Summary of changes: src/backend/access/transam/gtm.c | 2 +- src/backend/commands/schemacmds.c | 3 +- src/backend/commands/sequence.c | 2 +- src/backend/commands/tablecmds.c | 21 ++++++++++ src/backend/parser/parse_utilcmd.c | 26 ------------- src/backend/pgxc/plan/planner.c | 25 ++++++++++++ src/backend/tcop/utility.c | 56 +++++++++++++++++++++++----- src/gtm/Makefile.global | 2 +- src/gtm/main/gtm_seq.c | 2 + src/include/parser/parse_utilcmd.h | 1 - src/include/pgxc/planner.h | 2 + src/test/regress/expected/privileges_1.out | 43 --------------------- 12 files changed, 101 insertions(+), 84 deletions(-) hooks/post-receive -- Postgres-XC |
From: Abbas B. <ga...@us...> - 2011-03-28 15:00:53
|
Project "Postgres-XC". The branch, merge_postgres_9_0_3 has been updated via 6654fe0c6fac62e0351b3a409d26861789e9906b (commit) from 4f1d506fd83393fbbe98797fa49e862b5b17f19e (commit) - Log ----------------------------------------------------------------- commit 6654fe0c6fac62e0351b3a409d26861789e9906b Author: Abbas <abb...@en...> Date: Mon Mar 28 19:49:56 2011 +0500 This patch fixes a test case in strings.sql SELECT CAST(f1 as text) AS "f2" FROM CHAR_TBL ORDER BY f1 was reporting ERROR: ORDER BY "f1" is ambiguous The problem was in the function reconstruct_step_query. The function was reconstructing the query to look like SELECT (f1)::text, f1 FROM CHAR_TBL ORDER BY f1 and when this query was being sent to the data node, it was complaining. The solution adopted in this patch is to add column alias (if any) while reconstructing the query. Some cosmetic changes were also required for the strings test to pass. diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index e4d13cb..90031fa 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -2257,6 +2257,9 @@ reconstruct_step_query(List *rtable, bool has_order_by, List *extra_sort, appendStringInfo(buf, ", "); appendStringInfoString(buf, exprstr); + + if (tle->resname != NULL) + appendStringInfo(buf, " AS %s", quote_identifier(tle->resname)); } /* diff --git a/src/test/regress/expected/strings.out b/src/test/regress/expected/strings.out index 140c677..4773327 100644 --- a/src/test/regress/expected/strings.out +++ b/src/test/regress/expected/strings.out @@ -996,7 +996,7 @@ SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false"; (1 row) -- --- test %/_ combination cases, cf bug #4821 +-- test %/_ combination cases, cf bugs #4821 and #5478 -- SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f; t | t | f diff --git a/src/test/regress/expected/strings.out b/src/test/regress/expected/strings_1.out similarity index 99% copy from src/test/regress/expected/strings.out copy to src/test/regress/expected/strings_1.out index 140c677..2bbdf50 100644 --- a/src/test/regress/expected/strings.out +++ b/src/test/regress/expected/strings_1.out @@ -996,7 +996,7 @@ SELECT 'Hawkeye' NOT ILIKE 'h%' AS "false"; (1 row) -- --- test %/_ combination cases, cf bug #4821 +-- test %/_ combination cases, cf bugs #4821 and #5478 -- SELECT 'foo' LIKE '_%' as t, 'f' LIKE '_%' as t, '' LIKE '_%' as f; t | t | f @@ -1128,12 +1128,12 @@ insert into toasttest values(decode(repeat('1234567890',10000),'escape')); -- If the starting position is zero or less, then return from the start of the string -- adjusting the length to be consistent with the "negative start" per SQL92. SELECT substr(f1, -1, 5) from toasttest; - substr --------- - 123 - 123 - 123 - 123 + substr +---------- + \x313233 + \x313233 + \x313233 + \x313233 (4 rows) -- If the length is less than zero, an ERROR is thrown. @@ -1142,23 +1142,23 @@ ERROR: negative substring length not allowed -- If no third argument (length) is provided, the length to the end of the -- string is assumed. SELECT substr(f1, 99995) from toasttest; - substr --------- - 567890 - 567890 - 567890 - 567890 + substr +---------------- + \x353637383930 + \x353637383930 + \x353637383930 + \x353637383930 (4 rows) -- If start plus length is > string length, the result is truncated to -- string length SELECT substr(f1, 99995, 10) from toasttest; - substr --------- - 567890 - 567890 - 567890 - 567890 + substr +---------------- + \x353637383930 + \x353637383930 + \x353637383930 + \x353637383930 (4 rows) DROP TABLE toasttest; ----------------------------------------------------------------------- Summary of changes: src/backend/pgxc/plan/planner.c | 3 ++ src/test/regress/expected/strings.out | 2 +- .../expected/{strings.out => strings_1.out} | 38 ++++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) copy src/test/regress/expected/{strings.out => strings_1.out} (99%) hooks/post-receive -- Postgres-XC |