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

Commit873b106

Browse files
committed
Add support PostgreSQL 11devel
1 parent0f8c311 commit873b106

File tree

9 files changed

+221
-195
lines changed

9 files changed

+221
-195
lines changed

‎src/rum.h‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,13 @@ typedef struct RumState
391391
OidsupportCollation[INDEX_MAX_KEYS];
392392
}RumState;
393393

394+
/* Accessor for the i'th attribute of tupdesc. */
395+
#ifPG_VERSION_NUM>100000
396+
#defineRumTupleDescAttr(tupdesc,i) (TupleDescAttr(tupdesc, i))
397+
#else
398+
#defineRumTupleDescAttr(tupdesc,i) ((tupdesc)->attrs[(i)])
399+
#endif
400+
394401
/* rumutil.c */
395402
externbytea*rumoptions(Datumreloptions,boolvalidate);
396403
externDatumrumhandler(PG_FUNCTION_ARGS);
@@ -662,7 +669,7 @@ typedef struct RumScanEntryData
662669
* For a partial-match or full-scan query, we accumulate all TIDs and
663670
* and additional information here
664671
*/
665-
Tuplesortstate*matchSortstate;
672+
RumTuplesortstate*matchSortstate;
666673
RumScanItemcollectRumItem;
667674

668675
/* for full-scan query with order-by */
@@ -722,7 +729,7 @@ typedef struct RumScanOpaqueData
722729
uint32allocentries;/* allocated length of entries[] and
723730
sortedEntries[] */
724731

725-
Tuplesortstate*sortstate;
732+
RumTuplesortstate*sortstate;
726733
intnorderbys;/* Number of columns in ordering.
727734
Will be assigned to sortstate->nKeys */
728735

‎src/rum_arr_utils.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
#defineDIST_FROM_SML(sml) \
7373
( (sml == 0.0) ? get_float8_infinity() : ((float8) 1) / ((float8) (sml)) )
7474

75+
#ifPG_VERSION_NUM <=100000
76+
#defineHASHSTANDARD_PROC HASHPROC
77+
#endif
78+
7579

7680
typedefstructAnyArrayTypeInfo
7781
{
@@ -583,15 +587,15 @@ getAMProc(Oid amOid, Oid typid)
583587

584588
procOid=get_opfamily_proc(get_opclass_family(opclassOid),
585589
typid,typid,
586-
(amOid==BTREE_AM_OID) ?BTORDER_PROC :HASHPROC);
590+
(amOid==BTREE_AM_OID) ?BTORDER_PROC :HASHSTANDARD_PROC);
587591

588592
if (!OidIsValid(procOid))
589593
{
590594
typid=get_opclass_input_type(opclassOid);
591595

592596
procOid=get_opfamily_proc(get_opclass_family(opclassOid),
593597
typid,typid,
594-
(amOid==BTREE_AM_OID) ?BTORDER_PROC :HASHPROC);
598+
(amOid==BTREE_AM_OID) ?BTORDER_PROC :HASHSTANDARD_PROC);
595599
}
596600

597601
returnprocOid;

‎src/rumbulk.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ rumInitBA(BuildAccumulator *accum)
123123
staticDatum
124124
getDatumCopy(BuildAccumulator*accum,OffsetNumberattnum,Datumvalue)
125125
{
126-
Form_pg_attributeatt=accum->rumstate->origTupdesc->attrs[attnum-1];
126+
Form_pg_attributeatt=RumTupleDescAttr(accum->rumstate->origTupdesc,attnum-1);
127127
Datumres;
128128

129129
if (att->attbyval)

‎src/rumget.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ collectMatchBitmap(RumBtreeData * btree, RumBtreeStack * stack,
313313

314314
/* Locate tupdesc entry for key column (for attbyval/attlen data) */
315315
attnum=scanEntry->attnumOrig;
316-
attr=rumstate->origTupdesc->attrs[attnum-1];
316+
attr=RumTupleDescAttr(rumstate->origTupdesc,attnum-1);
317317

318318
for (;;)
319319
{

‎src/ruminsert.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,13 @@ rumHeapTupleBulkInsert(RumBuildState * buildstate, OffsetNumber attnum,
516516
{
517517
/* Check existance of additional information attribute in index */
518518
if (!attr)
519+
{
520+
Form_pg_attributeattr=RumTupleDescAttr(
521+
buildstate->rumstate.origTupdesc,attnum-1);
522+
519523
elog(ERROR,"additional information attribute \"%s\" is not found in index",
520-
NameStr(buildstate->rumstate.origTupdesc->attrs[attnum-1]->attname));
524+
NameStr(attr->attname));
525+
}
521526

522527
addInfo[i]=datumCopy(addInfo[i],attr->attbyval,attr->attlen);
523528
}
@@ -775,8 +780,13 @@ rumHeapTupleInsert(RumState * rumstate, OffsetNumber attnum,
775780

776781
/* Check existance of additional information attribute in index */
777782
if (!addInfoIsNull[i]&& !rumstate->addAttrs[attnum-1])
783+
{
784+
Form_pg_attributeattr=RumTupleDescAttr(rumstate->origTupdesc,
785+
attnum-1);
786+
778787
elog(ERROR,"additional information attribute \"%s\" is not found in index",
779-
NameStr(rumstate->origTupdesc->attrs[attnum-1]->attname));
788+
NameStr(attr->attname));
789+
}
780790

781791
insert_item.iptr=*item;
782792
insert_item.addInfo=addInfo[i];

‎src/rumscan.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ rumFillScanKey(RumScanOpaque so, OffsetNumber attnum,
182182
/* ...add key to order by index key value */
183183
key->useCurKey)
184184
{
185+
Form_pg_attributeattr=RumTupleDescAttr(rumstate->origTupdesc,
186+
attnum-1);
187+
185188
if (nQueryValues!=1)
186189
elog(ERROR,"extractQuery should return only one value for ordering");
187-
if (rumstate->origTupdesc->attrs[key->attnum-1]->attbyval== false)
190+
if (attr->attbyval== false)
188191
elog(ERROR,"doesn't support order by over pass-by-reference column");
189192

190193
if (key->attnum==rumstate->attrnAttachColumn)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp