Fix compile time warnings

pull/896/head
Onder Kalaci 2016-10-19 18:03:27 +03:00
parent 829ed1ef5d
commit 6658048b36
1 changed files with 9 additions and 6 deletions

View File

@ -411,13 +411,14 @@ RouterModifyTaskForShardInterval(Query *originalQuery, ShardInterval *shardInter
static RangeTblEntry * static RangeTblEntry *
ExtractSelectRangeTableEntry(Query *query) ExtractSelectRangeTableEntry(Query *query)
{ {
Assert(InsertSelectQuery(query)); List *fromList = NULL;
List *fromList = query->jointree->fromlist;
RangeTblRef *reference = NULL; RangeTblRef *reference = NULL;
RangeTblEntry *subqueryRte = NULL; RangeTblEntry *subqueryRte = NULL;
Assert(InsertSelectQuery(query));
/* since we already aseerted InsertSelectQuery() it is safe to access both lists */ /* since we already aseerted InsertSelectQuery() it is safe to access both lists */
fromList = query->jointree->fromlist;
reference = linitial(fromList); reference = linitial(fromList);
subqueryRte = rt_fetch(reference->rtindex, query->rtable); subqueryRte = rt_fetch(reference->rtindex, query->rtable);
@ -433,11 +434,13 @@ ExtractSelectRangeTableEntry(Query *query)
static RangeTblEntry * static RangeTblEntry *
ExtractInsertRangeTableEntry(Query *query) ExtractInsertRangeTableEntry(Query *query)
{ {
AssertArg(InsertSelectQuery(query));
int resultRelation = query->resultRelation; int resultRelation = query->resultRelation;
List *rangeTableList = query->rtable; List *rangeTableList = query->rtable;
RangeTblEntry *insertRTE = rt_fetch(resultRelation, rangeTableList); RangeTblEntry *insertRTE = NULL;
AssertArg(InsertSelectQuery(query));
insertRTE = rt_fetch(resultRelation, rangeTableList);
return insertRTE; return insertRTE;
} }