mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
Fix cross-version upgrade tests for commits 0497318e4 et al.
Dumps taken from unpatched versions (pre-v14) will not have the AS
keyword that ruleutils.c now prints, causing a harmless diff in dump
output. Adjust the cross-version upgrade's old dump to make it match.
While I'm here, move the stanza that I hastily put in a non-optimal
place in commit f8ab6c622. It's worth fixing because it messed up
the logical structure of adjust_database_contents, making it
un-obvious where to put future additions.
Per buildfarm.
This commit is contained in:
@@ -98,25 +98,6 @@ sub adjust_database_contents
|
|||||||
'drop extension if exists test_ext7');
|
'drop extension if exists test_ext7');
|
||||||
}
|
}
|
||||||
|
|
||||||
# We can no longer upgrade bpchar indexes that claim deduplication ability
|
|
||||||
# (amcheck will complain about them), so drop them if source is pre-v14.
|
|
||||||
if ($old_version < 14)
|
|
||||||
{
|
|
||||||
if ($dbnames{"regression"})
|
|
||||||
{
|
|
||||||
_add_st($result, 'regression',
|
|
||||||
'drop index if exists public.hslot_hubname',
|
|
||||||
'drop index if exists public.hslot_name',
|
|
||||||
'drop index if exists public.hub_name',
|
|
||||||
'drop index if exists public.iface_name',
|
|
||||||
'drop index if exists public.phone_name',
|
|
||||||
'drop index if exists public.pline_name',
|
|
||||||
'drop index if exists public.pslot_name',
|
|
||||||
'drop index if exists public.room_rno',
|
|
||||||
'drop index if exists public.wslot_name');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# stuff not supported from release 14
|
# stuff not supported from release 14
|
||||||
if ($old_version < 14)
|
if ($old_version < 14)
|
||||||
{
|
{
|
||||||
@@ -150,6 +131,22 @@ sub adjust_database_contents
|
|||||||
_add_st($result, 'contrib_regression_seg',
|
_add_st($result, 'contrib_regression_seg',
|
||||||
"delete from test_seg where s = '4.6 .. ~7.0'");
|
"delete from test_seg where s = '4.6 .. ~7.0'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# We can no longer upgrade bpchar indexes that claim deduplication
|
||||||
|
# ability (amcheck will complain about them)
|
||||||
|
if ($dbnames{'regression'})
|
||||||
|
{
|
||||||
|
_add_st($result, 'regression',
|
||||||
|
'drop index if exists public.hslot_hubname',
|
||||||
|
'drop index if exists public.hslot_name',
|
||||||
|
'drop index if exists public.hub_name',
|
||||||
|
'drop index if exists public.iface_name',
|
||||||
|
'drop index if exists public.phone_name',
|
||||||
|
'drop index if exists public.pline_name',
|
||||||
|
'drop index if exists public.pslot_name',
|
||||||
|
'drop index if exists public.room_rno',
|
||||||
|
'drop index if exists public.wslot_name');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# user table OIDs are gone from release 12 on
|
# user table OIDs are gone from release 12 on
|
||||||
@@ -293,6 +290,17 @@ sub adjust_old_dumpfile
|
|||||||
{$1;}mxg;
|
{$1;}mxg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($old_version < 14)
|
||||||
|
{
|
||||||
|
# Fix up some rule definitions that ruleutils now prints with AS.
|
||||||
|
$dump =~ s {DO INSTEAD UPDATE public\.rules_log trgt SET tag}
|
||||||
|
{DO INSTEAD UPDATE public.rules_log AS trgt SET tag};
|
||||||
|
$dump =~ s {UPDATE public\.int4_tbl trgt_1 SET}
|
||||||
|
{UPDATE public.int4_tbl AS trgt_1 SET};
|
||||||
|
$dump =~ s {DELETE FROM public\.int4_tbl trgt_1}
|
||||||
|
{DELETE FROM public.int4_tbl AS trgt_1};
|
||||||
|
}
|
||||||
|
|
||||||
# Change trigger definitions to say ... EXECUTE FUNCTION ...
|
# Change trigger definitions to say ... EXECUTE FUNCTION ...
|
||||||
if ($old_version < 12)
|
if ($old_version < 12)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user