mirror of https://github.com/citusdata/citus.git
parent
4e7d5060f5
commit
dd53a1ad1f
|
@ -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);
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
Loading…
Reference in New Issue