|
57 | 57 | # L = "Unsigned 32-bit Long", |
58 | 58 | # S = "Unsigned 16-bit Short", |
59 | 59 | # C = "Unsigned 8-bit Octet", |
60 | | -# q = "signed 64-bit quadword" |
61 | 60 | # |
62 | 61 | # Each tuple in our table has a layout as follows: |
63 | 62 | # |
|
71 | 70 | # xx xx t_infomask: xx offset = 20 S |
72 | 71 | # xx t_hoff: x offset = 22 C |
73 | 72 | # xx t_bits: x offset = 23 C |
74 | | -# xx xx xx xx xx xx xx xx 'a': xxxxxxxx offset = 24 q |
| 73 | +# xx xx xx xx xx xx xx xx 'a': xxxxxxxx offset = 24 LL |
75 | 74 | # xx xx xx xx xx xx xx xx 'b': xxxxxxxx offset = 32 CCCCCCCC |
76 | 75 | # xx xx xx xx xx xx xx xx 'c': xxxxxxxx offset = 40 CCllLL |
77 | 76 | # xx xx xx xx xx xx xx xx : xxxxxxxx ...continued |
|
81 | 80 | # it is convenient enough to do it this way. We define packing code |
82 | 81 | # constants here, where they can be compared easily against the layout. |
83 | 82 |
|
84 | | -use constant HEAPTUPLE_PACK_CODE => 'LLLSSSSSCCqCCCCCCCCCCllLL'; |
| 83 | +use constant HEAPTUPLE_PACK_CODE => 'LLLSSSSSCCLLCCCCCCCCCCllLL'; |
85 | 84 | use constant HEAPTUPLE_PACK_LENGTH => 58; # Total size |
86 | 85 |
|
87 | 86 | # Read a tuple of our table from a heap page. |
@@ -112,7 +111,8 @@ sub read_tuple |
112 | 111 | t_infomask => shift, |
113 | 112 | t_hoff => shift, |
114 | 113 | t_bits => shift, |
115 | | - a => shift, |
| 114 | + a_1 => shift, |
| 115 | + a_2 => shift, |
116 | 116 | b_header => shift, |
117 | 117 | b_body1 => shift, |
118 | 118 | b_body2 => shift, |
@@ -156,7 +156,8 @@ sub write_tuple |
156 | 156 | $tup->{t_infomask}, |
157 | 157 | $tup->{t_hoff}, |
158 | 158 | $tup->{t_bits}, |
159 | | - $tup->{a}, |
| 159 | + $tup->{a_1}, |
| 160 | + $tup->{a_2}, |
160 | 161 | $tup->{b_header}, |
161 | 162 | $tup->{b_body1}, |
162 | 163 | $tup->{b_body2}, |
@@ -227,7 +228,7 @@ sub write_tuple |
227 | 228 | $node->safe_psql('postgres', qq( |
228 | 229 | INSERT INTO public.test (a, b, c) |
229 | 230 | VALUES ( |
230 | | - 12345678, |
| 231 | + x'DEADF9F9DEADF9F9'::bigint, |
231 | 232 | 'abcdefg', |
232 | 233 | repeat('w', 10000) |
233 | 234 | ); |
@@ -275,13 +276,15 @@ sub write_tuple |
275 | 276 | my $tup = read_tuple($file, $offset); |
276 | 277 |
|
277 | 278 | # Sanity-check that the data appears on the page where we expect. |
278 | | - my $a = $tup->{a}; |
| 279 | + my $a_1 = $tup->{a_1}; |
| 280 | + my $a_2 = $tup->{a_2}; |
279 | 281 | my $b = $tup->{b}; |
280 | | - if ($a ne '12345678' || $b ne 'abcdefg') |
| 282 | + if ($a_1 != 0xDEADF9F9 || $a_2 != 0xDEADF9F9 || $b ne 'abcdefg') |
281 | 283 | { |
282 | 284 | close($file); # ignore errors on close; we're exiting anyway |
283 | 285 | $node->clean_node; |
284 | | - plan skip_all => qq(Page layout differs from our expectations: expected (12345678, "abcdefg"), got ($a, "$b")); |
| 286 | + plan skip_all => sprintf("Page layout differs from our expectations: expected (%x, %x, \"%s\"), got (%x, %x, \"%s\")", |
| 287 | + 0xDEADF9F9, 0xDEADF9F9, "abcdefg", $a_1, $a_2, $b); |
285 | 288 | exit; |
286 | 289 | } |
287 | 290 |
|
|
0 commit comments