diff --git a/src/common/backend/utils/cache/knl_localpartdefcache.cpp b/src/common/backend/utils/cache/knl_localpartdefcache.cpp index fe56b8db800a700e2fd247c689fe9442d9e299da..1915020412d1928b100079ed2c311ae9820f242e 100644 --- a/src/common/backend/utils/cache/knl_localpartdefcache.cpp +++ b/src/common/backend/utils/cache/knl_localpartdefcache.cpp @@ -77,6 +77,9 @@ Partition LocalPartDefCache::SearchPartitionFromGlobalCopy(Oid part_oid) if (unlikely(!IsPrimaryRecoveryFinished())) { return NULL; } + if (unlikely(u_sess->attr.attr_common.IsInplaceUpgrade)) { + return NULL; + } uint32 hash_value = oid_hash((void *)&(part_oid), sizeof(Oid)); ResourceOwnerEnlargeGlobalBaseEntry(LOCAL_SYSDB_RESOWNER); GlobalPartitionEntry *global = (GlobalPartitionEntry *)m_global_partdefcache->SearchReadOnly(part_oid, hash_value); diff --git a/src/common/backend/utils/cache/knl_localsystupcache.cpp b/src/common/backend/utils/cache/knl_localsystupcache.cpp index 3755cbe8dacf578d709f0e41ac5988c5c235862a..9309b5233d5782919cbb6f30636f74ffc084967b 100644 --- a/src/common/backend/utils/cache/knl_localsystupcache.cpp +++ b/src/common/backend/utils/cache/knl_localsystupcache.cpp @@ -434,7 +434,8 @@ LocalCatCTup *LocalSysTupCache::SearchTupleFromGlobal(Datum *arguments, uint32 h bool bypass_gsc = HistoricSnapshotActive() || m_global_systupcache->enable_rls || !g_instance.global_sysdbcache.hot_standby || - unlikely(!IsPrimaryRecoveryFinished()); + unlikely(!IsPrimaryRecoveryFinished()) || + (unlikely(u_sess->attr.attr_common.IsInplaceUpgrade)); if (invalid_entries.ExistTuple(hash_value) || bypass_gsc) { global_ct = m_global_systupcache->SearchTupleFromFile(hash_value, arguments, true); } else { @@ -586,7 +587,8 @@ LocalCatCList *LocalSysTupCache::SearchListFromGlobal(int nkeys, Datum *argument bool bypass_gsc = HistoricSnapshotActive() || m_global_systupcache->enable_rls || !g_instance.global_sysdbcache.hot_standby || - unlikely(!IsPrimaryRecoveryFinished()); + unlikely(!IsPrimaryRecoveryFinished()) || + unlikely(u_sess->attr.attr_common.IsInplaceUpgrade); GlobalCatCList *global_cl; if (invalid_entries.ExistList() || bypass_gsc) { global_cl = m_global_systupcache->SearchListFromFile(hash_value, nkeys, arguments, true); @@ -704,7 +706,8 @@ LocalCatCTup *LocalSysTupCache::SearchTupleFromGlobalForProcAllArgs( bool bypass_gsc = HistoricSnapshotActive() || m_global_systupcache->enable_rls || !g_instance.global_sysdbcache.hot_standby || - unlikely(!IsPrimaryRecoveryFinished()); + unlikely(!IsPrimaryRecoveryFinished()) || + unlikely(u_sess->attr.attr_common.IsInplaceUpgrade); if (invalid_entries.ExistTuple(hash_value) || bypass_gsc) { global_ct = m_global_systupcache->SearchTupleFromFileWithArgModes(hash_value, arguments, argModes, true); } else { diff --git a/src/common/backend/utils/cache/knl_localtabdefcache.cpp b/src/common/backend/utils/cache/knl_localtabdefcache.cpp index 63f696492be6f08d1b6ae47283385f3d614af389..6748917ab517c884bb0d6785ff7ce092ed7ab31b 100644 --- a/src/common/backend/utils/cache/knl_localtabdefcache.cpp +++ b/src/common/backend/utils/cache/knl_localtabdefcache.cpp @@ -119,6 +119,9 @@ Relation LocalTabDefCache::SearchRelationFromGlobalCopy(Oid rel_oid) if (unlikely(!IsPrimaryRecoveryFinished())) { return NULL; } + if (unlikely(u_sess->attr.attr_common.IsInplaceUpgrade)) { + return NULL; + } uint32 hash_value = oid_hash((void *)&(rel_oid), sizeof(Oid)); Index hash_index = HASH_INDEX(hash_value, (uint32)m_nbuckets); ResourceOwner owner = LOCAL_SYSDB_RESOWNER; diff --git a/src/gausskernel/optimizer/commands/sequence/sequence.cpp b/src/gausskernel/optimizer/commands/sequence/sequence.cpp index aa2a7ea67966909005aa65d20c1fec0e0b657180..3255a854ccb6d50a1862b132d02b3df0b3a69ff6 100644 --- a/src/gausskernel/optimizer/commands/sequence/sequence.cpp +++ b/src/gausskernel/optimizer/commands/sequence/sequence.cpp @@ -1389,7 +1389,15 @@ bool shouldReturnNumeric() break; } - return get_nextval_rettype() == NUMERICOID; + HeapTuple ftup = SearchSysCache1(PROCOID, ObjectIdGetDatum(NEXTVALFUNCOID)); + if (!HeapTupleIsValid(ftup)) { + ereport(ERROR, (errmsg("cache lookup failed for function %u", NEXTVALFUNCOID))); + } + Form_pg_proc pform = (Form_pg_proc)GETSTRUCT(ftup); + bool ret = pform->prorettype == NUMERICOID; + ReleaseSysCache(ftup); + + return ret; } Datum nextval_oid(PG_FUNCTION_ARGS)