From 57196f78658790a65a7e36e4d096a0347f24823f Mon Sep 17 00:00:00 2001 From: yjhjstz Date: Thu, 26 Dec 2024 14:00:43 +0800 Subject: [PATCH] Fix flake test bfv_meta_track --- src/test/regress/expected/bfv_meta_track.out | 18 +++++++++++------- src/test/regress/sql/bfv_meta_track.sql | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/test/regress/expected/bfv_meta_track.out b/src/test/regress/expected/bfv_meta_track.out index df4e58d8a45..e52daaffae8 100644 --- a/src/test/regress/expected/bfv_meta_track.out +++ b/src/test/regress/expected/bfv_meta_track.out @@ -4,9 +4,9 @@ -- 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'; +select count(*) from pg_stat_last_operation p join + pg_namespace on pg_namespace.oid = p.objid + where pg_namespace.nspname = 'bfv_meta_track' and p.stasubtype = 'SCHEMA'; count ------- 1 @@ -17,14 +17,16 @@ 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; +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 and a.stasubtype = 'POLICY'; 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; +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 and a.stasubtype = 'POLICY'; count ------- 0 @@ -34,14 +36,16 @@ select count(*) from pg_stat_last_operation a join pg_policy b on b.oid = a.obji -- 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'; +select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid +where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION'; 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'; +select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid +where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION'; count ------- 0 diff --git a/src/test/regress/sql/bfv_meta_track.sql b/src/test/regress/sql/bfv_meta_track.sql index 83f08c26b1e..225500a5eb6 100644 --- a/src/test/regress/sql/bfv_meta_track.sql +++ b/src/test/regress/sql/bfv_meta_track.sql @@ -5,24 +5,28 @@ 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'; +select count(*) from pg_stat_last_operation p join + pg_namespace on pg_namespace.oid = p.objid + where pg_namespace.nspname = 'bfv_meta_track' and p.stasubtype = 'SCHEMA'; -- 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; +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 and a.stasubtype = 'POLICY'; 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; +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 and a.stasubtype = 'POLICY'; --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'; +select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid +where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION'; drop publication pub1; -select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid where b.pubname = 'pub1'; +select count(*) from pg_stat_last_operation a join pg_publication b on b.oid = a.objid +where b.pubname = 'pub1' and a.stasubtype = 'PUBLICATION'; drop schema bfv_meta_track cascade; -- test drop schema