Fix missing from entry

(cherry picked from commit a0e0759f73)
pull/5479/head
Sait Talha Nisanci 2021-11-04 13:40:16 +03:00 committed by Talha Nisanci
parent 53fbe96399
commit 52631ea0fc
3 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,6 @@
#include "utils/syscache.h"
static void AddInsertAliasIfNeeded(Query *query);
static void UpdateTaskQueryString(Query *query, Task *task);
static RelationShard * FindRelationShard(Oid inputRelationId, List *relationShardList);
static void ConvertRteToSubqueryWithEmptyResult(RangeTblEntry *rte);
@ -145,7 +144,7 @@ RebuildQueryStrings(Job *workerJob)
* deparsing issues (e.g. RETURNING might reference the original table name,
* which has been replaced by a shard name).
*/
static void
void
AddInsertAliasIfNeeded(Query *query)
{
Assert(query->commandType == CMD_INSERT);

View File

@ -178,6 +178,8 @@ DeparseLocalShardQuery(Query *jobQuery, List *relationShardList, Oid
*/
Assert(!CheckInsertSelectQuery(jobQuery));
AddInsertAliasIfNeeded(jobQuery);
/*
* For INSERT queries we cannot use pg_get_query_def. Mainly because we
* cannot run UpdateRelationToShardNames on an INSERT query. This is

View File

@ -29,6 +29,7 @@ extern void SetTaskQueryStringList(Task *task, List *queryStringList);
extern char * TaskQueryString(Task *task);
extern char * TaskQueryStringAtIndex(Task *task, int index);
extern int GetTaskQueryType(Task *task);
extern void AddInsertAliasIfNeeded(Query *query);
#endif /* DEPARSE_SHARD_QUERY_H */