WIP_dilip_kumar_idea.patch
application/octet-stream
Filename: WIP_dilip_kumar_idea.patch
Type: application/octet-stream
Part: 0
Message:
Re: new heapcheck contrib module
Patch
Format: unified
| File | + | − |
|---|---|---|
| contrib/pg_amcheck/t/004_verify_heapam.pl | 9 | 1 |
diff --git a/contrib/pg_amcheck/t/004_verify_heapam.pl b/contrib/pg_amcheck/t/004_verify_heapam.pl
index a96b763886..0e19d4c7ab 100644
--- a/contrib/pg_amcheck/t/004_verify_heapam.pl
+++ b/contrib/pg_amcheck/t/004_verify_heapam.pl
@@ -215,7 +215,7 @@ $node->safe_psql(
my $rel = $node->safe_psql('postgres', qq(SELECT pg_relation_filepath('public.test')));
my $relpath = "$pgdata/$rel";
-use constant ROWCOUNT => 12;
+use constant ROWCOUNT => 13;
$node->safe_psql('postgres', qq(
INSERT INTO public.test (a, b, c)
VALUES (
@@ -250,10 +250,12 @@ $node->stop;
# Some #define constants from access/htup_details.h for use while corrupting.
use constant HEAP_HASNULL => 0x0001;
+use constant HEAP_XMAX_LOCK_ONLY => 0x0080;
use constant HEAP_XMIN_COMMITTED => 0x0100;
use constant HEAP_XMIN_INVALID => 0x0200;
use constant HEAP_XMAX_INVALID => 0x0800;
use constant HEAP_NATTS_MASK => 0x07FF;
+use constant HEAP_KEYS_UPDATED => 0x2000;
# Corrupt the tuples, one type of corruption per tuple. Some types of
# corruption cause verify_heapam to skip to the next tuple without
@@ -350,6 +352,12 @@ for (my $tupidx = 0; $tupidx < ROWCOUNT; $tupidx++)
$tup->{c6} = 41;
$tup->{c7} = 41;
}
+ elsif ($tupidx == 12)
+ {
+ # Set both HEAP_XMAX_LOCK_ONLY and HEAP_KEYS_UPDATED
+ $tup->{t_infomask} |= HEAP_XMAX_LOCK_ONLY;
+ $tup->{t_infomask2} |= HEAP_KEYS_UPDATED;
+ }
write_tuple($file, $offset, $tup);
}
close($file);