forked from apache/cloudberry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Some commands forgot to mark meta track.
Issue apache#504 It will make unstable cases failed as: ERROR: duplicate key value violates unique constraint "pg_statlastop_classid_objid_staactionname_index" Call MetaTrackDropObject in functions: RemoveSchemaById RemovePublicationById RemovePolicyById Authored-by: Zhang Mingli avamingli@gmail.com
- Loading branch information
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
-- | ||
--CBDB GITHUB ISSUE: | ||
--https://github.com/cloudberrydb/cloudberrydb/issues/504 | ||
-- | ||
create schema bfv_meta_track; | ||
set search_path to bfv_meta_track; | ||
select count(*) from pg_stat_last_operation join | ||
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid | ||
where pg_namespace.nspname = 'bfv_meta_track'; | ||
count | ||
------- | ||
1 | ||
(1 row) | ||
|
||
-- test drop popicy | ||
create table t1(a int); | ||
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. | ||
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. | ||
create policy p1 on t1 using (a % 2 = 0); | ||
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid; | ||
count | ||
------- | ||
1 | ||
(1 row) | ||
|
||
drop policy p1 on t1; | ||
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid; | ||
count | ||
------- | ||
0 | ||
(1 row) | ||
|
||
--test drop publication | ||
-- start_ignore | ||
create publication pub1; | ||
-- end_ignore | ||
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1'; | ||
count | ||
------- | ||
1 | ||
(1 row) | ||
|
||
drop publication pub1; | ||
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1'; | ||
count | ||
------- | ||
0 | ||
(1 row) | ||
|
||
drop schema bfv_meta_track cascade; | ||
NOTICE: drop cascades to table t1 | ||
-- test drop schema | ||
select count(*) from pg_stat_last_operation join | ||
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid | ||
where pg_namespace.nspname = 'bfv_meta_track'; | ||
count | ||
------- | ||
0 | ||
(1 row) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,4 +327,6 @@ test: motion_socket | |
# subtransaction overflow test | ||
test: subtrx_overflow | ||
|
||
test: bfv_meta_track | ||
|
||
# end of tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- | ||
--CBDB GITHUB ISSUE: | ||
--https://github.com/cloudberrydb/cloudberrydb/issues/504 | ||
-- | ||
|
||
create schema bfv_meta_track; | ||
set search_path to bfv_meta_track; | ||
select count(*) from pg_stat_last_operation join | ||
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid | ||
where pg_namespace.nspname = 'bfv_meta_track'; | ||
|
||
-- test drop popicy | ||
create table t1(a int); | ||
create policy p1 on t1 using (a % 2 = 0); | ||
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid; | ||
drop policy p1 on t1; | ||
select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.objid where b.polname = 'p1' and b.polrelid ='t1'::regclass::oid; | ||
|
||
--test drop publication | ||
-- start_ignore | ||
create publication pub1; | ||
-- end_ignore | ||
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1'; | ||
drop publication pub1; | ||
select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1'; | ||
|
||
drop schema bfv_meta_track cascade; | ||
-- test drop schema | ||
select count(*) from pg_stat_last_operation join | ||
pg_namespace on pg_namespace.oid = pg_stat_last_operation.objid | ||
where pg_namespace.nspname = 'bfv_meta_track'; |