|
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: xxoffset = 20S
|
72 | 71 | # xx t_hoff: xoffset = 22C
|
73 | 72 | # xx t_bits: xoffset = 23C
|
74 |
| -# xx xx xx xx xx xx xx xx 'a': xxxxxxxxoffset = 24q |
| 73 | +# xx xx xx xx xx xx xx xx 'a': xxxxxxxxoffset = 24LL |
75 | 74 | # xx xx xx xx xx xx xx xx 'b': xxxxxxxxoffset = 32CCCCCCCC
|
76 | 75 | # xx xx xx xx xx xx xx xx 'c': xxxxxxxxoffset = 40CCllLL
|
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 constantHEAPTUPLE_PACK_CODE=>'LLLSSSSSCCqCCCCCCCCCCllLL'; |
| 83 | +use constantHEAPTUPLE_PACK_CODE=>'LLLSSSSSCCLLCCCCCCCCCCllLL'; |
85 | 84 | use constantHEAPTUPLE_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 ($ane'12345678' ||$bne'abcdefg') |
| 282 | +if ($a_1 != 0xDEADF9F9 ||$a_2 != 0xDEADF9F9 ||$bne'abcdefg') |
281 | 283 | {
|
282 | 284 | close($file);# ignore errors on close; we're exiting anyway
|
283 | 285 | $node->clean_node;
|
284 |
| -planskip_all=>qq(Page layout differs from our expectations: expected (12345678, "abcdefg"), got ($a, "$b")); |
| 286 | +planskip_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 |
|
|