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,32 +778,14 @@ 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 */ DeferredErrorMessage *errorMessage = MultiShardModifyQuerySupported(
if (plannerRestrictionContext == NULL) originalQuery, plannerRestrictionContext);
{
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(
originalQuery, plannerRestrictionContext);
if (errorMessage != NULL) if (errorMessage != NULL)
{ {
return errorMessage; return errorMessage;
}
} }
} }