forked from huawei/openGauss-server
fix problem that smp may not create global temp table
This commit is contained in:
parent
da72ef3c68
commit
e3fcb688dc
|
|
@ -703,6 +703,16 @@ static bool table_contain_unsupport_feature(Oid relid, Query* query)
|
|||
u_sess->opt_cxt.not_shipping_info->need_log = false;
|
||||
}
|
||||
|
||||
/* global temp table could not ship */
|
||||
if (rel->rd_rel->relpersistence == RELPERSISTENCE_GLOBAL_TEMP) {
|
||||
sprintf_rc = sprintf_s(u_sess->opt_cxt.not_shipping_info->not_shipping_reason,
|
||||
NOTPLANSHIPPING_LENGTH,
|
||||
"global template table not support stream operator.");
|
||||
securec_check_ss_c(sprintf_rc, "\0", "\0");
|
||||
relation_close(rel, NoLock);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Currently dml with trigger can not get stream plan. */
|
||||
if (rel->rd_rel->relhastriggers && NULL != rel->trigdesc &&
|
||||
((query->commandType == CMD_INSERT && pgxc_has_trigger_for_event(TRIGGER_TYPE_INSERT, rel->trigdesc)) ||
|
||||
|
|
|
|||
|
|
@ -212,15 +212,6 @@ RelOptInfo* build_simple_rel(PlannerInfo* root, int relid, RelOptKind reloptkind
|
|||
rel->varratio = NIL;
|
||||
#ifdef STREAMPLAN
|
||||
if (rel->rtekind == RTE_RELATION) {
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
if (IS_STREAM_PLAN && get_rel_persistence(rte->relid) == RELPERSISTENCE_GLOBAL_TEMP) {
|
||||
errno_t sprintf_rc = sprintf_s(u_sess->opt_cxt.not_shipping_info->not_shipping_reason,
|
||||
NOTPLANSHIPPING_LENGTH,
|
||||
"global template table not support stream operator.");
|
||||
securec_check_ss_c(sprintf_rc, "\0", "\0");
|
||||
mark_stream_unsupport();
|
||||
}
|
||||
#endif
|
||||
rel->locator_type = GetLocatorType(rte->relid);
|
||||
rel->distribute_keys = build_baserel_distributekey(rte, relid);
|
||||
rel->rangelistOid = (IsLocatorDistributedBySlice(rel->locator_type)) ? rte->relid : InvalidOid;
|
||||
|
|
|
|||
Loading…
Reference in New Issue