multi_router_planner: Remove NULL check which would've segfaulted earlier

pull/3861/head
Philip Dubé 2020-06-01 20:30:35 +00:00
parent 1b0776f98e
commit 25f86bca3f
1 changed files with 6 additions and 24 deletions

View File

@ -778,24 +778,7 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
} }
} }
/* if (commandType != CMD_INSERT && multiShardQuery)
* We have to allow modify queries with two range table entries, if it is pushdownable.
*/
if (commandType != CMD_INSERT)
{
/* We can not get restriction context via master_modify_multiple_shards path */
if (plannerRestrictionContext == NULL)
{
if (queryTableCount != 1)
{
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
"cannot run multi shard modify query with master_modify_multiple_shards when the query involves subquery or join",
"Execute the query without using master_modify_multiple_shards()",
NULL);
}
}
/* If it is a multi-shard modify query with multiple tables */
else if (multiShardQuery)
{ {
DeferredErrorMessage *errorMessage = MultiShardModifyQuerySupported( DeferredErrorMessage *errorMessage = MultiShardModifyQuerySupported(
originalQuery, plannerRestrictionContext); originalQuery, plannerRestrictionContext);
@ -805,7 +788,6 @@ ModifyQuerySupported(Query *queryTree, Query *originalQuery, bool multiShardQuer
return errorMessage; return errorMessage;
} }
} }
}
if (commandType == CMD_INSERT || commandType == CMD_UPDATE || if (commandType == CMD_INSERT || commandType == CMD_UPDATE ||
commandType == CMD_DELETE) commandType == CMD_DELETE)