Fix missing from entry

(cherry picked from commit a0e0759f73)
onder_10_1_comm
Sait Talha Nisanci 2021-11-04 13:40:16 +03:00
parent 4e7d5060f5
commit dd53a1ad1f
3 changed files with 4 additions and 2 deletions

View File

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

View File

@ -174,6 +174,8 @@ DeparseLocalShardQuery(Query *jobQuery, List *relationShardList, Oid
*/ */
Assert(!CheckInsertSelectQuery(jobQuery)); Assert(!CheckInsertSelectQuery(jobQuery));
AddInsertAliasIfNeeded(jobQuery);
/* /*
* For INSERT queries we cannot use pg_get_query_def. Mainly because we * For INSERT queries we cannot use pg_get_query_def. Mainly because we
* cannot run UpdateRelationToShardNames on an INSERT query. This is * 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 * TaskQueryString(Task *task);
extern char * TaskQueryStringAtIndex(Task *task, int index); extern char * TaskQueryStringAtIndex(Task *task, int index);
extern int GetTaskQueryType(Task *task); extern int GetTaskQueryType(Task *task);
extern void AddInsertAliasIfNeeded(Query *query);
#endif /* DEPARSE_SHARD_QUERY_H */ #endif /* DEPARSE_SHARD_QUERY_H */