diff --git a/src/common/backend/parser/parse_utilcmd.cpp b/src/common/backend/parser/parse_utilcmd.cpp index fd47ffa338df4abc4e30468760789cc117c25e25..233d72172dd98c594c64c871451ebc1d49f71f13 100644 --- a/src/common/backend/parser/parse_utilcmd.cpp +++ b/src/common/backend/parser/parse_utilcmd.cpp @@ -881,10 +881,11 @@ Oid *namespaceid, bool isFirstNode) */ #ifdef ENABLE_MOT if ((!IsA(stmt, CreateForeignTableStmt) || IsSpecifiedFDW(((CreateForeignTableStmt*)stmt)->servername, MOT_FDW)) && - !stmt->distributeby && !stmt->inhRelations && cxt.fallback_dist_col) { + !stmt->distributeby && !stmt->inhRelations && cxt.fallback_dist_col) #else - if (!IsA(stmt, CreateForeignTableStmt) && !stmt->distributeby && !stmt->inhRelations && cxt.fallback_dist_col) { + if (!IsA(stmt, CreateForeignTableStmt) && !stmt->distributeby && !stmt->inhRelations && cxt.fallback_dist_col) #endif + { stmt->distributeby = makeNode(DistributeBy); stmt->distributeby->disttype = DISTTYPE_HASH; stmt->distributeby->colname = cxt.fallback_dist_col; @@ -1258,10 +1259,11 @@ static void transformColumnDefinition(CreateStmtContext* cxt, ColumnDef* column, column->typname->names = NIL; column->typname->typeOid = NUMERICOID; large = true; + } #ifdef ENABLE_MULTIPLE_NODES - } else if ((is_enc_type(typname) && IS_MAIN_COORDINATOR) || + else if ((is_enc_type(typname) && IS_MAIN_COORDINATOR) || #else - } else if (is_enc_type(typname) || + else if (is_enc_type(typname) || #endif (!u_sess->attr.attr_common.enable_beta_features && strcmp(typname, "int16") == 0)) { ereport(ERROR, @@ -1322,10 +1324,11 @@ static void transformColumnDefinition(CreateStmtContext* cxt, ColumnDef* column, TransformColumnDefinitionConstraints(cxt, column, preCheck, false); if (column->clientLogicColumnRef != NULL) { #ifdef ENABLE_MULTIPLE_NODES - if (IS_MAIN_COORDINATOR && !u_sess->attr.attr_common.enable_full_encryption) { + if (IS_MAIN_COORDINATOR && !u_sess->attr.attr_common.enable_full_encryption) #else - if (!u_sess->attr.attr_common.enable_full_encryption && t_thrd.role != SW_SENDER) { + if (!u_sess->attr.attr_common.enable_full_encryption && t_thrd.role != SW_SENDER) #endif + { ereport(ERROR, (errcode(ERRCODE_OPERATE_NOT_SUPPORTED), errmsg("Un-support to define encrypted column when client encryption is disabled."))); @@ -5159,10 +5162,11 @@ List* transformAlterTableStmt(Oid relid, AlterTableStmt* stmt, const char* query relationId = RelationGetRelid(rel); #ifdef ENABLE_MOT - if (isMOTFromTblOid(relationId) || CAN_BUILD_INFORMATIONAL_CONSTRAINT_BY_RELID(relationId)) { + if (isMOTFromTblOid(relationId) || CAN_BUILD_INFORMATIONAL_CONSTRAINT_BY_RELID(relationId)) #else - if (CAN_BUILD_INFORMATIONAL_CONSTRAINT_BY_RELID(relationId)) { + if (CAN_BUILD_INFORMATIONAL_CONSTRAINT_BY_RELID(relationId)) #endif + { setInternalFlagIndexStmt(cxt.alist); } } diff --git a/src/common/backend/utils/cache/partcache.cpp b/src/common/backend/utils/cache/partcache.cpp index 650e0f043c405e26bac1ce9eb38e4756fbd65944..0def7ec6d4783e6379c948597bb3ad83c1216144 100644 --- a/src/common/backend/utils/cache/partcache.cpp +++ b/src/common/backend/utils/cache/partcache.cpp @@ -1676,6 +1676,7 @@ void PartitionReloadIndexInfo(Partition part) offset = PushInvalMsgProcList(part->pd_id); while (true) { + Assert(part->pd_smgr == NULL); Assert(part->pd_isvalid == false); PartitionReloadIndexInfoExtended(part); @@ -1687,6 +1688,7 @@ void PartitionReloadIndexInfo(Partition part) * will enroll this relation in ordinary relcache invalidation processing, */ if (t_thrd.inval_msg_cxt.in_progress_list[offset].invalidated) { + PartitionCloseSmgr(part); part->pd_isvalid = false; ResetInvalMsgProcListInval(offset); continue; diff --git a/src/common/backend/utils/cache/relcache.cpp b/src/common/backend/utils/cache/relcache.cpp index 0909332a2fecb23dac1d8bb6bbe2ca7654cbf069..b84a4897cd463f2e708413ed35f36589a77520cd 100755 --- a/src/common/backend/utils/cache/relcache.cpp +++ b/src/common/backend/utils/cache/relcache.cpp @@ -3485,6 +3485,7 @@ void RelationReloadIndexInfo(Relation relation) offset = PushInvalMsgProcList(RelationGetRelid(relation)); while (true) { + Assert(relation->rd_smgr == NULL); Assert(relation->rd_isvalid == false); RelationReloadIndexInfoExtended(relation); @@ -3496,6 +3497,7 @@ void RelationReloadIndexInfo(Relation relation) * will enroll this relation in ordinary relcache invalidation processing, */ if (t_thrd.inval_msg_cxt.in_progress_list[offset].invalidated) { + RelationCloseSmgr(relation); relation->rd_isvalid = false; ResetInvalMsgProcListInval(offset); continue; diff --git a/src/common/interfaces/libpq/Makefile b/src/common/interfaces/libpq/Makefile index 967d6fe4e1cdb9ddbaa2350182468920bd29a591..c77b348d367fd92d084173bd24783bed9cc3d013 100644 --- a/src/common/interfaces/libpq/Makefile +++ b/src/common/interfaces/libpq/Makefile @@ -65,7 +65,7 @@ override CFLAGS := $(filter-out -fPIE, $(CFLAGS)) -fPIC -fstack-protector-all OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \ fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o \ libpq-events.o \ - $(top_builddir)/src/gausskernel/storage/dss/fio_dss.o $(top_builddir)/src/gausskernel/storage/file/fio_device.o + fio_dss.o fio_device.o # libpgport C files we always use OBJS += chklocale.o inet_net_ntop.o noblock.o pgstrcasecmp.o thread.o cipher.o path.o pgsleep.o # libpgport C files that are needed if identified by configure @@ -222,6 +222,12 @@ encnames.cpp wchar.cpp: % : $(backend_src)/utils/mb/% gs_strerror.cpp gs_env_r.cpp gs_syscall_lock.cpp gs_readdir.cpp: % : $(backend_src)/../port/% rm -f $@ && $(LN_S) $< . +fio_dss.cpp: $(top_builddir)/src/gausskernel/storage/dss/fio_dss.cpp + rm -f $@ && $(LN_S) $< . + +fio_device.cpp: $(top_builddir)/src/gausskernel/storage/file/fio_device.cpp + rm -f $@ && $(LN_S) $< . + distprep: libpq-dist.rc libpq.rc libpq-dist.rc: libpq.rc.in @@ -273,7 +279,8 @@ clean distclean: clean-lib rm -f pgsleep.cpp rm -f md5.cpp sha2.cpp ip.cpp rm -f encnames.cpp wchar.cpp - rm -f gs_strerror gs_env_r.cpp gs_syscall_lock.cpp gs_readdir.cpp + rm -f gs_strerror.cpp gs_env_r.cpp gs_syscall_lock.cpp gs_readdir.cpp + rm -f fio_dss.cpp fio_device.cpp $(foreach DIR,$(SUBDIRS),make -C $(DIR) clean; ) maintainer-clean: distclean maintainer-clean-lib $(MAKE) -C test $@ diff --git a/src/common/port/Makefile b/src/common/port/Makefile index c3d78c261e1a140ec24a1940cf1b811f43b33c0c..ca9cef2a2a9e12e2c42563f3ec5c0c1dc985823b 100644 --- a/src/common/port/Makefile +++ b/src/common/port/Makefile @@ -51,7 +51,7 @@ OBJS = $(LIBOBJS) chklocale.o dirmod.o erand48.o exec.o fls.o inet_net_ntop.o \ gs_readdir.o gs_strerror.o gs_syscall_lock.o \ gs_system.o \ cipher.o tool_common.o \ - $(top_builddir)/src/gausskernel/storage/file/fio_device.o $(top_builddir)/src/gausskernel/storage/dss/fio_dss.o + fio_device.o fio_dss.o ifeq "${host_cpu}" "aarch64" OBJS += pg_crc32c_choose.o @@ -72,7 +72,7 @@ endif OBJS_TOOL = fls.o strlcat.o strlcpy.o getpeereid.o chklocale.o dirmod.o erand48.o exec.o inet_net_ntop.o \ noblock.o path.o pg_bitutils.o pgcheckdir.o pgmkdirp.o pgsleep.o pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o flock.o pgstrcasestr.o \ gs_thread.o gs_env_r.o gs_getopt_r.o gs_readdir.o gs_strerror.o gs_syscall_lock.o gs_system.o cipher.o \ - $(top_builddir)/src/gausskernel/storage/file/fio_device.o $(top_builddir)/src/gausskernel/storage/dss/fio_dss.o tool_common.o + fio_device.o fio_dss.o tool_common.o all: libpgport.a libpgport_srv.a libpgport_tool.so @@ -108,6 +108,12 @@ crc32_arm_parallel.o: crc32_arm_parallel.S crc32_arm_parallel_srv.o: crc32_arm_parallel.S $(CC) $(CPPFLAGS) $(CFLAGS) -march=armv8-a+crc+crypto -o $@ -c $^ +fio_dss.cpp: $(top_builddir)/src/gausskernel/storage/dss/fio_dss.cpp + rm -f $@ && $(LN_S) $< . + +fio_device.cpp: $(top_builddir)/src/gausskernel/storage/file/fio_device.cpp + rm -f $@ && $(LN_S) $< . + # pg_crc32c_sse42.o and its _srv.o version need CFLAGS_SSE42 CFLAGS_SSE42=-msse4.2 pg_crc32c_sse42.o: CFLAGS+=$(CFLAGS_SSE42) @@ -173,4 +179,5 @@ pg_config_paths.h: $(top_builddir)/src/Makefile.global echo "#define MANDIR \"$(mandir)\"" >>$@ clean distclean maintainer-clean: - rm -f libpgport.a libpgport_srv.a $(OBJS) $(OBJS_SRV) pg_config_paths.h libpgport_tool.so libpgport_tool.so.$(VERSION) *.depend + rm -f libpgport.a libpgport_srv.a $(OBJS) $(OBJS_SRV) $(OBJS_TOOL) pg_config_paths.h libpgport_tool.so libpgport_tool.so.$(VERSION) *.depend + rm -f fio_dss.cpp fio_device.cpp diff --git a/src/gausskernel/optimizer/commands/tablecmds.cpp b/src/gausskernel/optimizer/commands/tablecmds.cpp index 08f512efd4a9eb8f22b1a765bfe3d12f0d375e2d..48d1ae92a0f3282cebe41a87d2db85df6f245658 100755 --- a/src/gausskernel/optimizer/commands/tablecmds.cpp +++ b/src/gausskernel/optimizer/commands/tablecmds.cpp @@ -3120,10 +3120,11 @@ ObjectAddress DefineRelation(CreateStmt* stmt, char relkind, Oid ownerId, Object #ifdef ENABLE_MOT (relkind == RELKIND_FOREIGN_TABLE && (stmt->distributeby != NULL || (IsA(stmt, CreateForeignTableStmt) && - isMOTTableFromSrvName(((CreateForeignTableStmt*)stmt)->servername)))))) { + isMOTTableFromSrvName(((CreateForeignTableStmt*)stmt)->servername)))))) #else - (relkind == RELKIND_FOREIGN_TABLE && stmt->distributeby != NULL))) { + (relkind == RELKIND_FOREIGN_TABLE && stmt->distributeby != NULL))) #endif + { char* logic_cluster_name = NULL; PGXCSubCluster* subcluster = stmt->subcluster; bool isinstallationgroup = (dfsTablespace || relkind == RELKIND_FOREIGN_TABLE diff --git a/src/gausskernel/optimizer/commands/vacuum.cpp b/src/gausskernel/optimizer/commands/vacuum.cpp index 092751eaa6625f3ff8a1c5edb50dfc2456a291d5..fd0bf6802ec39f01371da92648005201bd48d11e 100644 --- a/src/gausskernel/optimizer/commands/vacuum.cpp +++ b/src/gausskernel/optimizer/commands/vacuum.cpp @@ -2671,10 +2671,11 @@ static bool vacuum_rel(Oid relid, VacuumStmt* vacstmt, bool do_toast) ereport(messageLevel, (errmsg("skipping \"%s\" --- foreign table does not support vacuum", RelationGetRelationName(onerel)))); } - } else if ((vacstmt->options & VACOPT_FULL) && (vacstmt->flags & VACFLG_SIMPLE_HEAP)) { + } else if ((vacstmt->options & VACOPT_FULL) && (vacstmt->flags & VACFLG_SIMPLE_HEAP)) #else - if ((vacstmt->options & VACOPT_FULL) && (vacstmt->flags & VACFLG_SIMPLE_HEAP)) { + if ((vacstmt->options & VACOPT_FULL) && (vacstmt->flags & VACFLG_SIMPLE_HEAP)) #endif + { bool is_hdfs_rel = RelationIsPAXFormat(onerel); if (is_hdfs_rel) { ereport(LOG, (errmsg("vacuum full for DFS table: %s", onerel->rd_rel->relname.data))); diff --git a/src/gausskernel/runtime/executor/execMain.cpp b/src/gausskernel/runtime/executor/execMain.cpp index 3f8e652e5f307841770fc1f7602e25e375b9de1a..449fe0b3dc0b9a69519b35bdaf441b74d6905d56 100755 --- a/src/gausskernel/runtime/executor/execMain.cpp +++ b/src/gausskernel/runtime/executor/execMain.cpp @@ -386,11 +386,12 @@ void standard_ExecutorStart(QueryDesc *queryDesc, int eflags) } #ifdef ENABLE_MULTIPLE_NODES /* statement always start from CN or dn connected by client directly. */ - if (IS_PGXC_COORDINATOR || IsConnFromApp()) { + if (IS_PGXC_COORDINATOR || IsConnFromApp()) #else /* statement always start in non-stream thread */ - if (!StreamThreadAmI()) { + if (!StreamThreadAmI()) #endif + { SetCurrentStmtTimestamp(); } /* else stmtSystemTimestamp synchronize from CN */ @@ -1298,10 +1299,11 @@ void InitPlan(QueryDesc *queryDesc, int eflags) * are shipping plan to. */ #ifdef ENABLE_MULTIPLE_NODES - if (plannedstmt->resultRelations && (!IS_PGXC_DATANODE || NeedExecute(plan))) { + if (plannedstmt->resultRelations && (!IS_PGXC_DATANODE || NeedExecute(plan))) #else - if (plannedstmt->resultRelations && (!StreamThreadAmI() || NeedExecute(plan))) { + if (plannedstmt->resultRelations && (!StreamThreadAmI() || NeedExecute(plan))) #endif + { List *resultRelations = plannedstmt->resultRelations; int numResultRelations = 0; ResultRelInfo *resultRelInfos = NULL; @@ -1560,10 +1562,11 @@ void InitPlan(QueryDesc *queryDesc, int eflags) * processing tuples. */ #ifdef ENABLE_MULTIPLE_NODES - if (!IS_PGXC_COORDINATOR && plannedstmt->initPlan != NIL) { + if (!IS_PGXC_COORDINATOR && plannedstmt->initPlan != NIL) #else - if (!StreamTopConsumerAmI() && plannedstmt->initPlan != NIL) { + if (!StreamTopConsumerAmI() && plannedstmt->initPlan != NIL) #endif + { plan->initPlan = plannedstmt->initPlan; estate->es_subplan_ids = plannedstmt->subplan_ids; } @@ -1602,10 +1605,11 @@ void InitPlan(QueryDesc *queryDesc, int eflags) } #ifdef ENABLE_MULTIPLE_NODES - if (StreamTopConsumerAmI() || StreamThreadAmI()) { + if (StreamTopConsumerAmI() || StreamThreadAmI()) #else - if (StreamThreadAmI()) { + if (StreamThreadAmI()) #endif + { junk_filter_needed = false; } diff --git a/src/gausskernel/runtime/executor/nodeModifyTable.cpp b/src/gausskernel/runtime/executor/nodeModifyTable.cpp index cb19d99894c8bf9139bce5bdb6efa1bc0ba039f7..84ff93c19da4333b809af86544e7b81745328c79 100644 --- a/src/gausskernel/runtime/executor/nodeModifyTable.cpp +++ b/src/gausskernel/runtime/executor/nodeModifyTable.cpp @@ -1517,6 +1517,8 @@ TupleTableSlot* ExecInsertT(ModifyTableState* state, TupleTableSlot* slot, Tuple partRel, subPartitionId, subpartitionno, &subPartRel, &subPart, RowExclusiveLock); if (!res) { partitionClose(result_relation_desc, part, RowExclusiveLock); + /* release Partition lock, "part" cannot be manually released */ + UnlockPartition(RelationGetRelid(result_relation_desc), part->pd_id, RowExclusiveLock, PARTITION_LOCK); return NULL; } diff --git a/src/gausskernel/storage/ipc/procarray.cpp b/src/gausskernel/storage/ipc/procarray.cpp index 88b552d7aaf09552fa6ed915f338f4e08964f467..292f08bb1e6802c8213836cefec541d8755205a1 100755 --- a/src/gausskernel/storage/ipc/procarray.cpp +++ b/src/gausskernel/storage/ipc/procarray.cpp @@ -2254,10 +2254,11 @@ RETRY_GET: */ #ifndef ENABLE_MULTIPLE_NODES - if (!snapshot->takenDuringRecovery || forHSFeedBack) { + if (!snapshot->takenDuringRecovery || forHSFeedBack) #else - if (!snapshot->takenDuringRecovery) { + if (!snapshot->takenDuringRecovery) #endif + { int* pgprocnos = arrayP->pgprocnos; int numProcs; diff --git a/src/test/regress/input/relation_cache_inval_msg.source b/src/test/regress/input/relation_cache_inval_msg.source index 21569fe6fe6c530312d79e51abf9ad1600e97848..fb9a7ad98b630826644d2f2ea5d6d6eb4720892f 100644 --- a/src/test/regress/input/relation_cache_inval_msg.source +++ b/src/test/regress/input/relation_cache_inval_msg.source @@ -5,6 +5,7 @@ -- 原问题,在不开启global system cache的时候,很容易复现。 -- 当前用例在不开启的情况下,手动测试过,没问题。 -- 把用例加到门禁中,在开启global system cache的情况下测试,作为一个看护。 +show enable_global_syscache; drop table if exists t_rcim1; create table t_rcim1 (id int, dt timestamp) @@ -35,6 +36,7 @@ partition p2 values less than (100) \! sh @abs_srcdir@/script/relation_cache_inval_msg.sh start "@abs_bindir@/gsql" @portstring@ "@abs_srcdir@/tmp_check/relation_cache_inval_msg.log" -- expected 0 +-- 检查表t_rcim1的分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid='t_rcim1'::regclass and boundaries[1] in (select boundaries[1] from pg_partition @@ -42,13 +44,15 @@ select xmin, oid, relname, boundaries, parentid from pg_partition group by parentid, boundaries[1] having count(1) > 1) order by 4,3; +-- 检查表spt_rcim1的分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid='spt_rcim1'::regclass and boundaries[1] in (select boundaries[1] from pg_partition - where parentid='t_rcim1'::regclass + where parentid='spt_rcim1'::regclass group by parentid, boundaries[1] having count(1) > 1) order by 4,3; +-- 检查表spt_rcim1的 子 分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid in (select oid from pg_partition where parentid='spt_rcim1'::regclass) and boundaries[1] in (select boundaries[1] from pg_partition @@ -61,9 +65,14 @@ do $$ declare cnt int; begin - select max(cnt) into cnt from (select count(1) as cnt from pg_partition - where parentid in (select oid from pg_partition where parentid in ('spt_rcim1'::regclass, 't_rcim1'::regclass)) - group by parentid, boundaries[1] ); + -- 如果存在[子]分区存在重复范围的,则不DROP TABLE,保留环境 + select max(cnt1) into cnt + from (select count(1) as cnt1 from pg_partition + where parentid in (select 't_rcim1'::regclass + union select 'spt_rcim1'::regclass + union select oid from pg_partition where parentid='spt_rcim1'::regclass) + and parttype <> 'r' + group by parentid, boundaries[1] ); if cnt = 1 then raise notice 'drop table'; execute ('drop table t_rcim1;'); diff --git a/src/test/regress/output/relation_cache_inval_msg.source b/src/test/regress/output/relation_cache_inval_msg.source index e95e960c1a415c0903301a659e282906f5bf0be9..24258d3030faffa0bc113e1d040386eeefc35ce1 100644 --- a/src/test/regress/output/relation_cache_inval_msg.source +++ b/src/test/regress/output/relation_cache_inval_msg.source @@ -4,6 +4,12 @@ -- 原问题,在不开启global system cache的时候,很容易复现。 -- 当前用例在不开启的情况下,手动测试过,没问题。 -- 把用例加到门禁中,在开启global system cache的情况下测试,作为一个看护。 +show enable_global_syscache; + enable_global_syscache +------------------------ + on +(1 row) + drop table if exists t_rcim1; NOTICE: table "t_rcim1" does not exist, skipping create table t_rcim1 (id int, dt timestamp) @@ -32,6 +38,7 @@ partition p2 values less than (100) \! rm -f @abs_srcdir@/tmp_check/relation_cache_inval_msg.log \! sh @abs_srcdir@/script/relation_cache_inval_msg.sh start "@abs_bindir@/gsql" @portstring@ "@abs_srcdir@/tmp_check/relation_cache_inval_msg.log" -- expected 0 +-- 检查表t_rcim1的分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid='t_rcim1'::regclass and boundaries[1] in (select boundaries[1] from pg_partition @@ -42,16 +49,18 @@ select xmin, oid, relname, boundaries, parentid from pg_partition ------+-----+---------+------------+---------- (0 rows) +-- 检查表spt_rcim1的分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid='spt_rcim1'::regclass and boundaries[1] in (select boundaries[1] from pg_partition - where parentid='t_rcim1'::regclass + where parentid='spt_rcim1'::regclass group by parentid, boundaries[1] having count(1) > 1) order by 4,3; xmin | oid | relname | boundaries | parentid ------+-----+---------+------------+---------- (0 rows) +-- 检查表spt_rcim1的 子 分区的范围是否存在重复 select xmin, oid, relname, boundaries, parentid from pg_partition where parentid in (select oid from pg_partition where parentid='spt_rcim1'::regclass) and boundaries[1] in (select boundaries[1] from pg_partition @@ -67,9 +76,14 @@ do $$ declare cnt int; begin - select max(cnt) into cnt from (select count(1) as cnt from pg_partition - where parentid in (select oid from pg_partition where parentid in ('spt_rcim1'::regclass, 't_rcim1'::regclass)) - group by parentid, boundaries[1] ); + -- 如果存在[子]分区存在重复范围的,则不DROP TABLE,保留环境 + select max(cnt1) into cnt + from (select count(1) as cnt1 from pg_partition + where parentid in (select 't_rcim1'::regclass + union select 'spt_rcim1'::regclass + union select oid from pg_partition where parentid='spt_rcim1'::regclass) + and parttype <> 'r' + group by parentid, boundaries[1] ); if cnt = 1 then raise notice 'drop table'; execute ('drop table t_rcim1;'); diff --git a/src/test/regress/script/relation_cache_inval_msg.sh b/src/test/regress/script/relation_cache_inval_msg.sh index 6f6702807dbd7647df54f0edd6f2ad99f6748c76..5b872b9b7e7c463fe658facd92d4d5f116a80edf 100644 --- a/src/test/regress/script/relation_cache_inval_msg.sh +++ b/src/test/regress/script/relation_cache_inval_msg.sh @@ -9,14 +9,16 @@ temp=$5 file=$(realpath $0) if [ "$type" = "start" ] ; then - for ((i=1; i<=10; i++)) - do - sh $file t_rcim1 $execfile $port $log & - done for ((i=1; i<=5; i++)) do - sh $file spt_rcim1_add $execfile $port $log $i & + sh $file t_rcim1 $execfile $port $log & + sh $file t_rcim1 $execfile $port $log & + sh $file vacuum $execfile $port $log t_rcim1 & + sh $file spt_rcim1_insert $execfile $port $log & + sh $file spt_rcim1_add $execfile $port $log $i & + sh $file spt_rcim1_drop $execfile $port $log $i & + sh $file vacuum $execfile $port $log spt_rcim1 & done wait elif [ "$type" = "t_rcim1" ] ; then @@ -31,14 +33,26 @@ elif [ "$type" = "spt_rcim1_add" ] ; then $execfile -p $port -d regression -c "alter table spt_rcim1 modify partition p1 add subpartition sp1${i}_${temp} values less than('$i');" >> $log 2>&1 done +elif [ "$type" = "spt_rcim1_drop" ] ; then + for ((i=1; i<=10; i++)) + do + $execfile -p $port -d regression -c "alter table spt_rcim1 drop subpartition sp1${i}_${temp} update global index;" >> $log 2>&1 + done + elif [ "$type" = "spt_rcim1_insert" ] ; then for ((i=1; i<=10; i++)) do for ((j=1; j<=3; j++)) do - $execfile -p $port -d regression -c "insert into spt_rcim1 values ($i$j, '$i');" >> $log 2>&1 + $execfile -p $port -d regression -c "insert into spt_rcim1 values ($i + $j, '$i', '$i$j');" >> $log 2>&1 done done + +elif [ "$type" = "vacuum" ] ; then + for ((i=1; i<=10; i++)) + do + $execfile -p $port -d regression -c "vacuum analyze $temp;" >> $log 2>&1 + done fi