diff options
| author | Michael P | 2011-08-08 06:54:49 +0000 |
|---|---|---|
| committer | Michael P | 2011-08-08 06:56:50 +0000 |
| commit | 52fde6ac488b392203d642bc1b54d124ec4843ed (patch) | |
| tree | a10d841ff80a3330bd87a9c6be5fabf7a3632607 /src/backend | |
| parent | f1a32c6227136d722aead50b8d4a85fceba7523f (diff) | |
Clean up compilation warnings
90% of compilation warnings are cleaned with this commit.
There are still warnings remaining due to the strong dependance
between GTM and PGXC main code.
Diffstat (limited to 'src/backend')
| -rw-r--r-- | src/backend/access/common/heaptuple.c | 4 | ||||
| -rw-r--r-- | src/backend/access/hash/hashfunc.c | 2 | ||||
| -rw-r--r-- | src/backend/access/transam/gtm.c | 2 | ||||
| -rw-r--r-- | src/backend/commands/copy.c | 188 | ||||
| -rw-r--r-- | src/backend/commands/dbcommands.c | 4 | ||||
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 3 | ||||
| -rw-r--r-- | src/backend/nodes/readfuncs.c | 16 | ||||
| -rw-r--r-- | src/backend/optimizer/plan/planner.c | 2 | ||||
| -rw-r--r-- | src/backend/optimizer/util/pathnode.c | 2 | ||||
| -rw-r--r-- | src/backend/parser/analyze.c | 3 | ||||
| -rw-r--r-- | src/backend/parser/gram.y | 4 | ||||
| -rw-r--r-- | src/backend/pgxc/barrier/barrier.c | 4 | ||||
| -rw-r--r-- | src/backend/pgxc/plan/planner.c | 32 | ||||
| -rw-r--r-- | src/backend/pgxc/pool/execRemote.c | 3 | ||||
| -rw-r--r-- | src/backend/pgxc/pool/pgxcnode.c | 2 | ||||
| -rw-r--r-- | src/backend/pgxc/pool/poolmgr.c | 18 | ||||
| -rw-r--r-- | src/backend/rewrite/rewriteHandler.c | 5 | ||||
| -rw-r--r-- | src/backend/tcop/postgres.c | 2 | ||||
| -rw-r--r-- | src/backend/utils/adt/ruleutils.c | 4 | ||||
| -rw-r--r-- | src/backend/utils/error/elog.c | 1 | ||||
| -rw-r--r-- | src/backend/utils/mmgr/mcxt.c | 6 | ||||
| -rw-r--r-- | src/backend/utils/sort/tuplesort.c | 2 |
22 files changed, 49 insertions, 260 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index cb1f8f89fd..5caae51be1 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -1137,6 +1137,7 @@ slot_deform_datarow(TupleTableSlot *slot) StringInfo buffer; uint16 n16; uint32 n32; + MemoryContext oldcontext; if (slot->tts_tupleDescriptor == NULL || slot->tts_dataRow == NULL) return; @@ -1162,7 +1163,7 @@ slot_deform_datarow(TupleTableSlot *slot) * Ensure info about input functions is available as long as slot lives * as well as deformed values */ - MemoryContext oldcontext = MemoryContextSwitchTo(slot->tts_mcxt); + oldcontext = MemoryContextSwitchTo(slot->tts_mcxt); if (slot->tts_attinmeta == NULL) slot->tts_attinmeta = TupleDescGetAttInMetadata(slot->tts_tupleDescriptor); @@ -1170,7 +1171,6 @@ slot_deform_datarow(TupleTableSlot *slot) buffer = makeStringInfo(); for (i = 0; i < attnum; i++) { - Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[i]; int len; /* get size */ diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index e00696eb66..3c30fa2110 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -542,7 +542,7 @@ compute_hash(Oid type, Datum value, int *pErr) *pErr = 0; - if (value == NULL) + if (!value) { *pErr = 1; return 0; diff --git a/src/backend/access/transam/gtm.c b/src/backend/access/transam/gtm.c index f05e38de86..77cfdc6388 100644 --- a/src/backend/access/transam/gtm.c +++ b/src/backend/access/transam/gtm.c @@ -440,7 +440,7 @@ SetValGTM(char *seqname, GTM_Sequence nextval, bool iscalled) * GTM_SEQ_DB_NAME, DB name part of sequence key */ int -DropSequenceGTM(const char *name, GTM_SequenceKeyType type) +DropSequenceGTM(char *name, GTM_SequenceKeyType type) { GTM_SequenceKeyData seqkey; CheckConnection(); diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index bfaf6e2860..36fc32d437 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -339,12 +339,6 @@ static bool CopyGetInt16(CopyState cstate, int16 *val); #ifdef PGXC static ExecNodes *build_copy_statement(CopyState cstate, List *attnamelist, TupleDesc tupDesc, bool is_from, List *force_quote, List *force_notnull); -/* - * A kluge here making this static to avoid having to move the - * CopyState definition to a header file making it harder to merge - * with the vanilla PostgreSQL code - */ -static CopyState insertstate; #endif /* @@ -2521,10 +2515,10 @@ BeginCopyFrom(Relation rel, tmp |= (1 << 16); tmp = htonl(tmp); - appendBinaryStringInfo(&cstate->line_buf, &tmp, 4); + appendBinaryStringInfo(&cstate->line_buf, (char *) &tmp, 4); tmp = 0; tmp = htonl(tmp); - appendBinaryStringInfo(&cstate->line_buf, &tmp, 4); + appendBinaryStringInfo(&cstate->line_buf, (char *) &tmp, 4); if (DataNodeCopyInBinaryForAll(cstate->line_buf.data, 19, cstate->connections)) ereport(ERROR, @@ -2748,7 +2742,7 @@ NextCopyFrom(CopyState cstate, ExprContext *econtext, enlargeStringInfo(&cstate->line_buf, sizeof(uint16)); /* Receive field count directly from datanodes */ fld_count = htons(fld_count); - appendBinaryStringInfo(&cstate->line_buf, &fld_count, sizeof(uint16)); + appendBinaryStringInfo(&cstate->line_buf, (char *) &fld_count, sizeof(uint16)); } #endif @@ -2781,7 +2775,7 @@ NextCopyFrom(CopyState cstate, ExprContext *econtext, enlargeStringInfo(&cstate->line_buf, sizeof(uint16)); /* Receive field count directly from datanodes */ fld_count = htons(fld_count); - appendBinaryStringInfo(&cstate->line_buf, &fld_count, sizeof(uint16)); + appendBinaryStringInfo(&cstate->line_buf, (char *) &fld_count, sizeof(uint16)); } #endif @@ -2807,7 +2801,7 @@ NextCopyFrom(CopyState cstate, ExprContext *econtext, enlargeStringInfo(&cstate->line_buf, sizeof(uint16)); fld_count = htons(fld_count); - appendBinaryStringInfo(&cstate->line_buf, &fld_count, sizeof(uint16)); + appendBinaryStringInfo(&cstate->line_buf, (char *) &fld_count, sizeof(uint16)); } #endif @@ -3792,7 +3786,7 @@ CopyReadBinaryAttribute(CopyState cstate, /* Get the field size from Datanode */ enlargeStringInfo(&cstate->line_buf, sizeof(int32)); nSize = htonl(fld_size); - appendBinaryStringInfo(&cstate->line_buf, &nSize, sizeof(int32)); + appendBinaryStringInfo(&cstate->line_buf, (char *) &nSize, sizeof(int32)); } #endif @@ -4379,174 +4373,4 @@ build_copy_statement(CopyState cstate, List *attnamelist, } return exec_nodes; } - -/* - * Use COPY for handling INSERT SELECT - * It may be a bit better to use binary mode here, but - * we have not implemented binary support for COPY yet. - * - * We borrow some code from CopyTo and DoCopy here. - * We do not refactor them so that it is later easier to remerge - * with vanilla PostgreSQL - */ -void -DoInsertSelectCopy(EState *estate, TupleTableSlot *slot) -{ - ExecNodes *exec_nodes; - HeapTuple tuple; - Datum *values; - bool *nulls; - Datum dist_col_value; - Oid dist_col_type; - MemoryContext oldcontext; - CopyState cstate; - - - Assert(IS_PGXC_COORDINATOR); - - /* See if we need to initialize COPY (first tuple) */ - if (estate->es_processed == 0) - { - ListCell *lc; - List *attnamelist = NIL; - ResultRelInfo *resultRelInfo = estate->es_result_relation_info; - Form_pg_attribute *attr; - - oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); - exec_nodes = makeNode(ExecNodes); - - /* - * We use the cstate struct here, though we do not need everything - * We will just use the properties we are interested in here. - */ - insertstate = (CopyStateData *) palloc0(sizeof(CopyStateData)); - cstate = insertstate; - - cstate->rowcontext = AllocSetContextCreate(CurrentMemoryContext, - "COPY TO", - ALLOCSET_DEFAULT_MINSIZE, - ALLOCSET_DEFAULT_INITSIZE, - ALLOCSET_DEFAULT_MAXSIZE); - - cstate->rel = resultRelInfo->ri_RelationDesc; - cstate->tupDesc = RelationGetDescr(cstate->rel); - - foreach(lc, estate->es_plannedstmt->planTree->targetlist) - { - TargetEntry *target = (TargetEntry *) lfirst(lc); - attnamelist = lappend(attnamelist, makeString(target->resname)); - } - cstate->attnumlist = CopyGetAttnums(cstate->tupDesc, cstate->rel, attnamelist); - - /* We use fe_msgbuf as a per-row buffer regardless of copy_dest */ - cstate->fe_msgbuf = makeStringInfo(); - attr = cstate->tupDesc->attrs; - - if (cstate->idx_dist_by_col >= 0) - dist_col_type = attr[cstate->idx_dist_by_col]->atttypid; - else - dist_col_type = UNKNOWNOID; - - /* Get info about the columns we need to process. */ - cstate->out_functions = (FmgrInfo *) palloc(cstate->tupDesc->natts * sizeof(FmgrInfo)); - foreach(lc, cstate->attnumlist) - { - int attnum = lfirst_int(lc); - Oid out_func_oid; - bool isvarlena; - - if (cstate->binary) - getTypeBinaryOutputInfo(attr[attnum - 1]->atttypid, - &out_func_oid, - &isvarlena); - else - getTypeOutputInfo(attr[attnum - 1]->atttypid, - &out_func_oid, - &isvarlena); - fmgr_info(out_func_oid, &cstate->out_functions[attnum - 1]); - } - - /* Set defaults for omitted options */ - if (!cstate->delim) - cstate->delim = cstate->csv_mode ? "," : "\t"; - - if (!cstate->null_print) - cstate->null_print = cstate->csv_mode ? "" : "\\N"; - cstate->null_print_len = strlen(cstate->null_print); - cstate->null_print_client = cstate->null_print; /* default */ - - if (cstate->csv_mode) - { - if (!cstate->quote) - cstate->quote = "\""; - if (!cstate->escape) - cstate->escape = cstate->quote; - } - - exec_nodes = build_copy_statement(cstate, attnamelist, - cstate->tupDesc, true, NULL, NULL); - - cstate->connections = DataNodeCopyBegin(cstate->query_buf.data, - exec_nodes->nodelist, - GetActiveSnapshot(), - true); - - if (!cstate->connections) - ereport(ERROR, - (errcode(ERRCODE_CONNECTION_EXCEPTION), - errmsg("Failed to initialize data nodes for COPY"))); - - cstate->copy_dest = COPY_BUFFER; - - MemoryContextSwitchTo(oldcontext); - } - cstate = insertstate; - - values = (Datum *) palloc(cstate->tupDesc->natts * sizeof(Datum)); - nulls = (bool *) palloc(cstate->tupDesc->natts * sizeof(bool)); - - /* Process Tuple */ - /* We need to format the line for sending to data nodes */ - tuple = ExecMaterializeSlot(slot); - - /* Deconstruct the tuple ... faster than repeated heap_getattr */ - heap_deform_tuple(tuple, cstate->tupDesc, values, nulls); - - /* Format the input tuple for sending */ - CopyOneRowTo(cstate, 0, values, nulls); - - /* Get dist column, if any */ - if (cstate->idx_dist_by_col >= 0 && !nulls[cstate->idx_dist_by_col]) - dist_col_value = values[cstate->idx_dist_by_col]; - else - dist_col_type = UNKNOWNOID; - - /* Send item to the appropriate data node(s) (buffer) */ - if (DataNodeCopyIn(cstate->fe_msgbuf->data, - cstate->fe_msgbuf->len, - GetRelationNodes(cstate->rel_loc, dist_col_value, dist_col_type, RELATION_ACCESS_INSERT), - cstate->connections)) - ereport(ERROR, - (errcode(ERRCODE_CONNECTION_EXCEPTION), - errmsg("Copy failed on a data node"))); - - resetStringInfo(cstate->fe_msgbuf); - estate->es_processed++; -} - -/* - * - */ -void -EndInsertSelectCopy(void) -{ - Assert(IS_PGXC_COORDINATOR); - - DataNodeCopyFinish( - insertstate->connections, - primary_data_node, - COMBINE_TYPE_NONE); - pfree(insertstate->connections); - MemoryContextDelete(insertstate->rowcontext); -} #endif diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 63f2fbb31d..8f6ee8ac68 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -887,8 +887,8 @@ dropdb(const char *dbname, bool missing_ok) #ifdef PGXC /* Drop sequences on gtm that are on the database dropped. */ - if(IS_PGXC_COORDINATOR && !IsConnFromCoord()) - if(DropSequenceGTM(dbname, GTM_SEQ_DB_NAME)) + if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) + if (DropSequenceGTM((char *)dbname, GTM_SEQ_DB_NAME)) elog(ERROR, "Deletion of sequences on database %s not completed", dbname); #endif } diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 64ea9f5f68..3b26d4a68e 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -1003,7 +1003,8 @@ _copyRemoteQuery(RemoteQuery *from) COPY_STRING_FIELD(statement); COPY_STRING_FIELD(cursor); COPY_SCALAR_FIELD(num_params); - COPY_POINTER_FIELD(param_types, sizeof(from->param_types[0]) * from->num_params); + COPY_POINTER_FIELD(param_types, + sizeof(from->param_types[0]) * from->num_params); COPY_SCALAR_FIELD(exec_type); COPY_SCALAR_FIELD(paramval_data); COPY_SCALAR_FIELD(paramval_len); diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index d6338e3ea9..a3aee7c900 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -1290,22 +1290,6 @@ _readRangeTblEntry(void) READ_DONE(); } -#ifdef PGXC -/* - * _readDistributeBy - */ -static DistributeBy * -_readDistributeBy(void) -{ - READ_LOCALS(DistributeBy); - - READ_ENUM_FIELD(disttype, DistributionType); - READ_STRING_FIELD(colname); - - READ_DONE(); -} -#endif - /* * parseNodeString diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 326cc9cc70..4002b4f38b 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -267,6 +267,8 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams) case CMD_DELETE: top_plan = create_remotedelete_plan(root, top_plan); break; + default: + break; } #endif diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 4e7b456704..9efb8542dc 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -1445,7 +1445,7 @@ create_remotequery_path(PlannerInfo *root, RelOptInfo *rel) * execute query against remote query multiple times. * Subject for future optimization */ - pathnode = create_material_path(rel, pathnode); + pathnode = (Path *) create_material_path(rel, pathnode); return pathnode; } diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 1483187f55..f212ee1c09 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -42,6 +42,7 @@ #include "parser/parsetree.h" #include "rewrite/rewriteManip.h" #ifdef PGXC +#include "miscadmin.h" #include "pgxc/pgxc.h" #include "access/gtm.h" #include "pgxc/planner.h" @@ -2382,7 +2383,7 @@ transformExecDirectStmt(ParseState *pstate, ExecDirectStmt *stmt) step->exec_nodes = (ExecNodes *) palloc(sizeof(ExecNodes)); step->exec_nodes->primarynodelist = NIL; step->exec_nodes->nodelist = NIL; - step->exec_nodes->en_expr = NIL; + step->exec_nodes->en_expr = NULL; step->force_autocommit = false; step->combine_type = COMBINE_TYPE_SAME; step->read_only = true; diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 25dd548585..1cbb5e9314 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -8157,12 +8157,12 @@ CleanConnStmt: CLEAN CONNECTION TO COORDINATOR coord_list CleanConnDbName CleanC CleanConnDbName: FOR DATABASE database_name { $$ = $3; } | FOR database_name { $$ = $2; } - | /* EMPTY */ { $$ = NIL; } + | /* EMPTY */ { $$ = NULL; } ; CleanConnUserName: TO USER RoleId { $$ = $3; } | TO RoleId { $$ = $2; } - | /* EMPTY */ { $$ = NIL; } + | /* EMPTY */ { $$ = NULL; } ; /* PGXC_END */ diff --git a/src/backend/pgxc/barrier/barrier.c b/src/backend/pgxc/barrier/barrier.c index 9512cbc379..fac8f518da 100644 --- a/src/backend/pgxc/barrier/barrier.c +++ b/src/backend/pgxc/barrier/barrier.c @@ -31,10 +31,6 @@ static PGXCNodeAllHandles *PrepareBarrier(const char *id); static void ExecuteBarrier(const char *id); static void EndBarrier(PGXCNodeAllHandles *handles, const char *id); -extern void ProcessCreateBarrierPrepare(const char *id); -extern void ProcessCreateBarrierEnd(const char *id); -extern void ProcessCreateBarrierExecute(const char *id); - /* * Prepare ourselves for an incoming BARRIER. We must disable all new 2PC * commits and let the ongoing commits to finish. We then remember the diff --git a/src/backend/pgxc/plan/planner.c b/src/backend/pgxc/plan/planner.c index e3499134db..83e08be10f 100644 --- a/src/backend/pgxc/plan/planner.c +++ b/src/backend/pgxc/plan/planner.c @@ -707,7 +707,6 @@ examine_conditions_walker(Node *expr_node, XCWalkerContext *context) /* Find referenced portal and figure out what was the last fetch node */ Portal portal; QueryDesc *queryDesc; - PlanState *state; CurrentOfExpr *cexpr = (CurrentOfExpr *) expr_node; char *cursor_name = cexpr->cursor_name; char *node_cursor; @@ -1046,13 +1045,13 @@ examine_conditions_walker(Node *expr_node, XCWalkerContext *context) if (IsA(arg1, RelabelType)) { - rt = arg1; + rt = (RelabelType *) arg1; arg1 = rt->arg; } if (IsA(arg2, RelabelType)) { - rt = arg2; + rt = (RelabelType *)arg2; arg2 = rt->arg; } @@ -1789,7 +1788,7 @@ get_plan_nodes_walker(Node *query_node, XCWalkerContext *context) context->query_step->exec_nodes->nodelist = list_copy(rel_loc_info->nodeList); context->query_step->exec_nodes->en_expr = NULL; - context->query_step->exec_nodes->en_relid = NULL; + context->query_step->exec_nodes->en_relid = InvalidOid; context->query_step->exec_nodes->accesstype = context->accessType; } } @@ -2938,29 +2937,6 @@ pgxc_planner(Query *query, int cursorOptions, ParamListInfo boundParams) /* - * Free Query_Step struct - */ -static void -free_query_step(RemoteQuery *query_step) -{ - if (query_step == NULL) - return; - - pfree(query_step->sql_statement); - if (query_step->cursor) - pfree(query_step->cursor); - if (query_step->exec_nodes) - { - if (query_step->exec_nodes->nodelist) - list_free(query_step->exec_nodes->nodelist); - if (query_step->exec_nodes->primarynodelist) - list_free(query_step->exec_nodes->primarynodelist); - } - pfree(query_step); -} - - -/* * See if we can reduce the passed in RemoteQuery nodes to a single step. * * We need to check when we can further collapse already collapsed nodes. @@ -3230,7 +3206,7 @@ AddRemoteQueryNode(List *stmts, const char *queryString, RemoteQueryExecType rem { RemoteQuery *step = makeNode(RemoteQuery); step->combine_type = COMBINE_TYPE_SAME; - step->sql_statement = queryString; + step->sql_statement = (char *) queryString; step->exec_type = remoteExecType; step->is_temp = is_temp; result = lappend(result, step); diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 121245d696..e9d2d17232 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -1370,19 +1370,16 @@ is_data_node_ready(PGXCNodeHandle * conn) break; case 'Z': /* ReadyForQuery */ - { /* * Return result depends on previous connection state. * If it was PORTAL_SUSPENDED coordinator want to send down * another EXECUTE to fetch more rows, otherwise it is done * with the connection */ - int result = suspended ? RESPONSE_SUSPENDED : RESPONSE_COMPLETE; conn->transaction_status = msg[0]; conn->state = DN_CONNECTION_STATE_IDLE; conn->combiner = NULL; return true; - } } } /* never happen, but keep compiler quiet */ diff --git a/src/backend/pgxc/pool/pgxcnode.c b/src/backend/pgxc/pool/pgxcnode.c index 4e71cc5172..ad86b2582a 100644 --- a/src/backend/pgxc/pool/pgxcnode.c +++ b/src/backend/pgxc/pool/pgxcnode.c @@ -31,6 +31,7 @@ #include "commands/prepare.h" #include "gtm/gtm_c.h" #include "pgxc/pgxcnode.h" +#include "pgxc/execRemote.h" #include "pgxc/locator.h" #include "pgxc/pgxc.h" #include "pgxc/poolmgr.h" @@ -1074,7 +1075,6 @@ int pgxc_node_send_bind(PGXCNodeHandle * handle, const char *portal, const char *statement, int paramlen, char *params) { - uint16 n16; int pnameLen; int stmtLen; int paramCodeLen; diff --git a/src/backend/pgxc/pool/poolmgr.c b/src/backend/pgxc/pool/poolmgr.c index c0d8d56aab..f31e445354 100644 --- a/src/backend/pgxc/pool/poolmgr.c +++ b/src/backend/pgxc/pool/poolmgr.c @@ -47,6 +47,7 @@ #include "pgxc/pgxc.h" #include "pgxc/poolutils.h" #include "../interfaces/libpq/libpq-fe.h" +#include "../interfaces/libpq/libpq-int.h" #include "postmaster/postmaster.h" /* For UnixSocketDir */ #include <stdlib.h> #include <string.h> @@ -133,9 +134,6 @@ static int *abort_pids(int *count, static void pooler_die(SIGNAL_ARGS); static void pooler_quickdie(SIGNAL_ARGS); -/* Check status of connection */ -extern int pqReadReady(PGconn *conn); - /* * Flags set by interrupt handlers for later service in the main loop. */ @@ -552,7 +550,7 @@ PoolManagerConnect(PoolHandle *handle, const char *database, const char *user_na int PoolManagerSetCommand(PoolCommandType command_type, const char *set_command) { - int n32; + int n32, res; char msgtype = 's'; Assert(Handle); @@ -591,7 +589,9 @@ PoolManagerSetCommand(PoolCommandType command_type, const char *set_command) pool_flush(&Handle->port); /* Get result */ - pool_recvres(&Handle->port); + res = pool_recvres(&Handle->port); + + return res; } /* @@ -614,6 +614,8 @@ agent_init(PoolAgent *agent, const char *database, const char *user_name) /* create if not found */ if (agent->pool == NULL) agent->pool = create_database_pool(database, user_name); + + return; } @@ -1974,7 +1976,7 @@ acquire_connection(DatabasePool *dbPool, int node, char client_conn_type) retry: /* Make sure connection is ok */ - poll_result = pqReadReady(slot->conn); + poll_result = pqReadReady((PGconn *)slot->conn); if (poll_result == 0) break; /* ok, no data */ @@ -2173,7 +2175,7 @@ grow_pool(DatabasePool * dbPool, int index, char client_conn_type) break; } - slot->xc_cancelConn = PQgetCancel(slot->conn); + slot->xc_cancelConn = (NODE_CANCEL *) PQgetCancel((PGconn *)slot->conn); /* Insert at the end of the pool */ nodePool->slot[(nodePool->freeSize)++] = slot; @@ -2193,7 +2195,7 @@ grow_pool(DatabasePool * dbPool, int index, char client_conn_type) static void destroy_slot(PGXCNodePoolSlot *slot) { - PQfreeCancel(slot->xc_cancelConn); + PQfreeCancel((PGcancel *)slot->xc_cancelConn); PGXCNodeClose(slot->conn); pfree(slot); } diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c index 0b922a6927..f08fbbcd54 100644 --- a/src/backend/rewrite/rewriteHandler.c +++ b/src/backend/rewrite/rewriteHandler.c @@ -31,6 +31,7 @@ #ifdef PGXC #include "pgxc/pgxc.h" #include "pgxc/poolmgr.h" +#include "optimizer/planner.h" #endif @@ -2477,7 +2478,7 @@ GetRelPartColPos(const Query *query, const char *partColName) static void ProcessHashValue(List **valuesList, const List *subList, const int node) { - valuesList[node - 1] = lappend(valuesList[node - 1], subList); + valuesList[node - 1] = lappend(valuesList[node - 1], (List *) subList); } /* @@ -2502,7 +2503,7 @@ static void DestroyValuesList(List **valuesList[]) { pfree(*valuesList); - *valuesList = NIL; + *valuesList = NULL; } /* diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index fc57a2450b..1efe280baf 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4353,7 +4353,7 @@ PostgresMain(int argc, char *argv[], const char *username) char *id; command = pq_getmsgbyte(&input_message); - id = pq_getmsgstring(&input_message); + id = (char *) pq_getmsgstring(&input_message); pq_getmsgend(&input_message); switch (command) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 76ef9d0b69..bc41c14c31 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -2185,7 +2185,7 @@ deparse_context_for_remotequery(Alias *aliasname, Oid relid) dpns->planstate = NULL; dpns->ancestors = NIL; dpns->outer_plan = dpns->inner_plan = NULL; - dpns->outer_planstate = dpns->inner_planstate = NIL; + dpns->outer_planstate = dpns->inner_planstate = NULL; dpns->remotequery = true; /* Return a one-deep namespace stack */ @@ -2689,7 +2689,7 @@ get_query_def_from_valuesList(Query *query, StringInfo buf) dpns.planstate = NULL; dpns.ancestors = NIL; dpns.outer_plan = dpns.inner_plan = NULL; - dpns.outer_planstate = dpns.inner_planstate = NIL; + dpns.outer_planstate = dpns.inner_planstate = NULL; dpns.remotequery = false; /* diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index cefde432bc..5e0fee7a01 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -79,6 +79,7 @@ #include "utils/ps_status.h" #ifdef PGXC #include "pgxc/pgxc.h" +#include "pgxc/execRemote.h" #endif diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c index 8ebf918a89..887241be0a 100644 --- a/src/backend/utils/mmgr/mcxt.c +++ b/src/backend/utils/mmgr/mcxt.c @@ -739,6 +739,10 @@ void *current_memcontext() return((void *)CurrentMemoryContext); } -Gen_Alloc genAlloc_class = {MemoryContextAlloc, MemoryContextAllocZero, repalloc, pfree, current_memcontext}; +Gen_Alloc genAlloc_class = {(void *)MemoryContextAlloc, + (void *)MemoryContextAllocZero, + (void *)repalloc, + (void *)pfree, + (void *)current_memcontext}; #endif diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index b795fa65de..5c9f37dda1 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -3105,7 +3105,7 @@ getlen_datanode(Tuplesortstate *state, int tapenum, bool eofOK) if (pgxc_node_receive(1, &conn, NULL)) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), - errmsg(conn->error))); + errmsg("%s", conn->error))); break; case RESPONSE_COMPLETE: /* EOF encountered, close the tape and report EOF */ |
