提交 eca68bbc 编写于 作者: A Asim R P

Strengthen the pattern to find auxiliary tables by name

The privious pattern used by the test was not strong enough.  It could
accidentally matched names of partitioned tables.  Name of a partition
being added is generated by suffixing a random number, if no name is
specified by the user.  E.g. "sales_1_prt_r1171829080_2_prt_usa".  At
least one time, the test failed CI due to this weakness.

The new pattern is strong enough to match only the auxiliary table
names that end with "_<oid>".

Reviewed by Heikki and Georgios.
上级 2e8aba70
......@@ -37,7 +37,7 @@ begin
for rec in select gp_segment_id, replace(relname, testrelid::oid::text, '<oid>'), age(relfrozenxid)
from pg_class
where relkind in ('r','t','o','b','M') and relstorage not in ('x','f','v')
and (relname like '%' || testrelid::oid || '%' or oid = testrelid::oid )
and (relname like '%\_' || testrelid::oid or oid = testrelid::oid )
and not relfrozenxid = 0
loop
return next rec;
......@@ -46,7 +46,7 @@ begin
for rec in select gp_segment_id, replace(relname, testrelid::oid::text, '<oid>'), age(relfrozenxid)
from gp_dist_random('pg_class')
where relkind in ('r','t','o','b','M') and relstorage not in ('x','f','v')
and (relname like '%' || testrelid::oid || '%' or oid = testrelid::oid )
and (relname like '%\_' || testrelid::oid or oid = testrelid::oid )
and not relfrozenxid = 0
loop
return next rec;
......
......@@ -43,7 +43,7 @@ begin
for rec in select gp_segment_id, replace(relname, testrelid::oid::text, '<oid>'), age(relfrozenxid)
from pg_class
where relkind in ('r','t','o','b','M') and relstorage not in ('x','f','v')
and (relname like '%' || testrelid::oid || '%' or oid = testrelid::oid )
and (relname like '%\_' || testrelid::oid or oid = testrelid::oid )
and not relfrozenxid = 0
loop
return next rec;
......@@ -52,7 +52,7 @@ begin
for rec in select gp_segment_id, replace(relname, testrelid::oid::text, '<oid>'), age(relfrozenxid)
from gp_dist_random('pg_class')
where relkind in ('r','t','o','b','M') and relstorage not in ('x','f','v')
and (relname like '%' || testrelid::oid || '%' or oid = testrelid::oid )
and (relname like '%\_' || testrelid::oid or oid = testrelid::oid )
and not relfrozenxid = 0
loop
return next rec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册