Fix missing from entry

(cherry picked from commit a0e0759f73)
10_2_onder_locks
Sait Talha Nisanci 2021-11-04 13:40:16 +03:00
parent 143a3f2b28
commit a71e0b5c84
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);
@ -159,7 +158,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

@ -174,6 +174,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 */