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

Commited807fd

Browse files
committed
pageinspect: Try to fix some bugs in previous commit.
Commit08bf6e5 seems not to haveused the correct *GetDatum and PG_GETARG_* macros for the SQL typesin some cases, and some of the SQL types seem to have been poorlychosen, too. Try to fix it. I'm not sure if this is the reasonwhy the buildfarm is currently unhappy with this code, but itseems like a good place to start.Buildfarm unhappiness reported by Tom Lane.
1 parentfd6cd69 commited807fd

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

‎contrib/pageinspect/hashfuncs.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ PG_FUNCTION_INFO_V1(hash_metapage_info);
3232
*/
3333
typedefstructHashPageStat
3434
{
35-
uint16live_items;
36-
uint16dead_items;
37-
uint16page_size;
38-
uint16free_size;
35+
intlive_items;
36+
intdead_items;
37+
intpage_size;
38+
intfree_size;
3939

4040
/* opaque data */
4141
BlockNumberhasho_prevblkno;
@@ -256,15 +256,15 @@ hash_page_stats(PG_FUNCTION_ARGS)
256256
MemSet(nulls,0,sizeof(nulls));
257257

258258
j=0;
259-
values[j++]=UInt16GetDatum(stat.live_items);
260-
values[j++]=UInt16GetDatum(stat.dead_items);
261-
values[j++]=UInt16GetDatum(stat.page_size);
262-
values[j++]=UInt16GetDatum(stat.free_size);
263-
values[j++]=UInt32GetDatum(stat.hasho_prevblkno);
264-
values[j++]=UInt32GetDatum(stat.hasho_nextblkno);
265-
values[j++]=UInt32GetDatum(stat.hasho_bucket);
266-
values[j++]=UInt16GetDatum(stat.hasho_flag);
267-
values[j++]=UInt16GetDatum(stat.hasho_page_id);
259+
values[j++]=Int32GetDatum(stat.live_items);
260+
values[j++]=Int32GetDatum(stat.dead_items);
261+
values[j++]=Int32GetDatum(stat.page_size);
262+
values[j++]=Int32GetDatum(stat.free_size);
263+
values[j++]=Int64GetDatum((int64)stat.hasho_prevblkno);
264+
values[j++]=Int64GetDatum((int64)stat.hasho_nextblkno);
265+
values[j++]=Int64GetDatum((int64)stat.hasho_bucket);
266+
values[j++]=Int32GetDatum((int32)stat.hasho_flag);
267+
values[j++]=Int32GetDatum((int32)stat.hasho_page_id);
268268

269269
tuple=heap_form_tuple(tupleDesc,values,nulls);
270270

@@ -388,7 +388,7 @@ Datum
388388
hash_bitmap_info(PG_FUNCTION_ARGS)
389389
{
390390
OidindexRelid=PG_GETARG_OID(0);
391-
uint32ovflblkno=PG_GETARG_UINT32(1);
391+
BlockNumberovflblkno=(BlockNumber)PG_GETARG_INT64(1);
392392
HashMetaPagemetap;
393393
Bufferbuf,
394394
metabuf;

‎contrib/pageinspect/pageinspect--1.5--1.6.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ LANGUAGE C STRICT PARALLEL SAFE;
1919
-- hash_page_stats()
2020
--
2121
CREATEFUNCTIONhash_page_stats(IN pagebytea,
22-
OUT live_itemssmallint,
23-
OUT dead_itemssmallint,
24-
OUT page_sizesmallint,
25-
OUT free_sizesmallint,
22+
OUT live_itemsint4,
23+
OUT dead_itemsint4,
24+
OUT page_sizeint4,
25+
OUT free_sizeint4,
2626
OUT hasho_prevblkno int8,
2727
OUT hasho_nextblkno int8,
2828
OUT hasho_bucket int8,
29-
OUT hasho_flagsmallint,
29+
OUT hasho_flagint4,
3030
OUT hasho_page_id int4)
3131
AS'MODULE_PATHNAME','hash_page_stats'
3232
LANGUAGE C STRICT PARALLEL SAFE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp