Skip to content

Commit 062e3d8

Browse files
author
Arseny Kositsyn
committed
[PGPRO-12159] Fixed the build on version 18 of PostgreSQL.
Tags: rum
1 parent 3f1e6cf commit 062e3d8

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

expected/security_1.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ CONTEXT: SQL statement "CREATE FUNCTION rum_anyarray_similar(anyarray,anyarray)
1818
RETURNS bool
1919
AS '$libdir/rum'
2020
LANGUAGE C STRICT STABLE"
21-
extension script file "rum--1.3.sql", near line 1530
21+
extension script file "rum--1.4.sql", near line 1530
2222
DROP FUNCTION rum_anyarray_similar(anyarray,anyarray);

rum_init.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LANGUAGE C;
66
/*
77
* RUM access method
88
*/
9+
910
CREATE ACCESS METHOD rum TYPE INDEX HANDLER rumhandler;
1011

1112
/*
@@ -411,7 +412,7 @@ AS
411412
/*
412413
* RUM version 1.1
413414
*/
414-
415+
415416
CREATE FUNCTION rum_btree_consistent(internal,smallint,internal,int,internal,internal,internal,internal)
416417
RETURNS bool
417418
AS 'MODULE_PATHNAME'

src/rum_debug_funcs.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ do { \
102102
#define RumWriteResBlckNumToValues(piState, counter) \
103103
do { \
104104
(piState)->values[(counter)] = \
105-
UInt32GetDatum(PostingItemGetBlockNumber(&((piState)->curPitem))); \
105+
UInt32GetDatum(RumPostingItemGetBlockNumber(&((piState)->curPitem))); \
106106
} while(0)
107107

108108
#define RumWriteResAddInfoToValues(piState, counter) \
@@ -129,7 +129,7 @@ do { \
129129
do { \
130130
memcpy(&((piState)->curPitem), \
131131
RumDataPageGetItem((piState)->page, \
132-
(piState)->srfFctx->call_cntr), sizeof(PostingItem)); \
132+
(piState)->srfFctx->call_cntr), sizeof(RumPostingItem)); \
133133
} while(0)
134134

135135
#define RumPrepareResultTuple(piState) \
@@ -142,7 +142,7 @@ do { \
142142
} while(0)
143143

144144
#define RumPrepareCurPitemToPostingList(piState) \
145-
memset(&((piState)->curPitem), 0, sizeof(PostingItem))
145+
memset(&((piState)->curPitem), 0, sizeof(RumPostingItem))
146146

147147
/*
148148
* This is necessary in order for the prepare_scan()
@@ -201,7 +201,7 @@ typedef struct RumPageItemsStateData
201201
* On the {leaf, data} page, this is the number of
202202
* RumItem structures that are in the compressed posting list.
203203
*
204-
* On the {data} page, this is the number of PostingItem structures.
204+
* On the {data} page, this is the number of RumPostingItem structures.
205205
*
206206
* On the {leaf} page, this is the number of IndexTuple, each of
207207
* which contains a compressed posting list. In this case, the size
@@ -218,7 +218,7 @@ typedef struct RumPageItemsStateData
218218
* It is used where posting lists are scanned.
219219
* Sometimes only the RumItem it contains is used.
220220
*/
221-
PostingItem curPitem;
221+
RumPostingItem curPitem;
222222

223223
/* Current IndexTuple on the page */
224224
IndexTuple curItup;
@@ -601,17 +601,13 @@ get_positions_to_text_datum(Datum addInfo)
601601
static Oid
602602
get_cur_tuple_key_oid(RumPageItemsState piState)
603603
{
604-
Oid result;
605604
TupleDesc origTupleDesc;
606605
OffsetNumber attnum;
607-
FormData_pg_attribute *attrs;
608606

609607
attnum = piState->curKeyAttnum;
610608
origTupleDesc = piState->rumState->origTupdesc;
611-
attrs = origTupleDesc->attrs;
612-
result = (attrs[attnum - 1]).atttypid;
613609

614-
return result;
610+
return TupleDescAttr(origTupleDesc, attnum - 1)->atttypid;
615611
}
616612

617613
/*
@@ -638,8 +634,8 @@ get_entry_index_tuple_values(RumPageItemsState piState)
638634
if (piState->pageType == LEAF_ENTRY_PAGE &&
639635
RumGetAddInfoAttr(piState))
640636
{
641-
(piState)->curKeyAddInfoOid = RumGetAddInfoAttr(piState)->atttypid;
642-
(piState)->curKeyAddInfoByval = RumGetAddInfoAttr(piState)->attbyval;
637+
piState->curKeyAddInfoOid = RumGetAddInfoAttr(piState)->atttypid;
638+
piState->curKeyAddInfoByval = RumGetAddInfoAttr(piState)->attbyval;
643639
}
644640
}
645641

@@ -687,7 +683,7 @@ find_page_in_posting_tree(BlockNumber targetPageNum,
687683
{
688684
Page curPage;
689685
RumPageOpaque curOpaq;
690-
PostingItem curPitem;
686+
RumPostingItem curPitem;
691687
BlockNumber nextPageNum;
692688

693689
/* Page loop */
@@ -713,21 +709,21 @@ find_page_in_posting_tree(BlockNumber targetPageNum,
713709
}
714710

715711
/*
716-
* Reading the first PostingItem from the current page. This is
712+
* Reading the first RumPostingItem from the current page. This is
717713
* necessary to remember the link down.
718714
*/
719715
memcpy(&curPitem,
720-
RumDataPageGetItem(curPage, 1), sizeof(PostingItem));
721-
nextPageNum = PostingItemGetBlockNumber(&curPitem);
716+
RumDataPageGetItem(curPage, 1), sizeof(RumPostingItem));
717+
nextPageNum = RumPostingItemGetBlockNumber(&curPitem);
722718

723719
/* The loop that scans the page */
724720
for (int i = 1; i <= curOpaq->maxoff; i++)
725721
{
726-
/* Reading the PostingItem from the current page */
722+
/* Reading the RumPostingItem from the current page */
727723
memcpy(&curPitem,
728-
RumDataPageGetItem(curPage, i), sizeof(PostingItem));
724+
RumDataPageGetItem(curPage, i), sizeof(RumPostingItem));
729725

730-
if (targetPageNum == PostingItemGetBlockNumber(&curPitem))
726+
if (targetPageNum == RumPostingItemGetBlockNumber(&curPitem))
731727
{
732728
pfree(curPage);
733729
return true;

0 commit comments

Comments
 (0)