Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita338d65

Browse files
committed
Fix pageinspect's heap_page_item to return infomasks as 32 bit values
HeapTupleHeader's t_infomask and t_infomask2 are defined as 16-bitunsigned integers, so when the 16th bit was set, heap_page_item wasreturning them as negative values, which was ugly.The change to pageinspect--unpackaged--1.0.sql allows a module upgradedfrom 9.0 to be cleanly updated from the previous definition.
1 parent79ad8fc commita338d65

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

‎contrib/pageinspect/heapfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ heap_page_items(PG_FUNCTION_ARGS)
170170
values[5]=UInt32GetDatum(HeapTupleHeaderGetXmax(tuphdr));
171171
values[6]=UInt32GetDatum(HeapTupleHeaderGetRawCommandId(tuphdr));/* shared with xvac */
172172
values[7]=PointerGetDatum(&tuphdr->t_ctid);
173-
values[8]=UInt16GetDatum(tuphdr->t_infomask2);
174-
values[9]=UInt16GetDatum(tuphdr->t_infomask);
173+
values[8]=UInt32GetDatum(tuphdr->t_infomask2);
174+
values[9]=UInt32GetDatum(tuphdr->t_infomask);
175175
values[10]=UInt8GetDatum(tuphdr->t_hoff);
176176

177177
/*

‎contrib/pageinspect/pageinspect--unpackaged--1.0.sql

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
/* contrib/pageinspect/pageinspect--unpackaged--1.0.sql*/
22

3+
DROPFUNCTION heap_page_items(bytea);
4+
CREATEFUNCTIONheap_page_items(IN pagebytea,
5+
OUT lpsmallint,
6+
OUT lp_offsmallint,
7+
OUT lp_flagssmallint,
8+
OUT lp_lensmallint,
9+
OUT t_xmin xid,
10+
OUT t_xmax xid,
11+
OUT t_field3 int4,
12+
OUT t_ctid tid,
13+
OUT t_infomask2integer,
14+
OUT t_infomaskinteger,
15+
OUT t_hoffsmallint,
16+
OUT t_bitstext,
17+
OUT t_oidoid)
18+
RETURNS SETOF record
19+
AS'MODULE_PATHNAME','heap_page_items'
20+
LANGUAGE C STRICT;
21+
322
ALTER EXTENSION pageinspect ADD function get_raw_page(text,integer);
423
ALTER EXTENSION pageinspect ADD function get_raw_page(text,text,integer);
524
ALTER EXTENSION pageinspect ADD function page_header(bytea);
6-
ALTER EXTENSION pageinspect ADD function heap_page_items(bytea);
725
ALTER EXTENSION pageinspect ADD function bt_metap(text);
826
ALTER EXTENSION pageinspect ADD function bt_page_stats(text,integer);
927
ALTER EXTENSION pageinspect ADD function bt_page_items(text,integer);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp