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

Commitfe6c3fd

Browse files
committed
reformatting completed, all tests pass
1 parentfbb1ae9 commitfe6c3fd

File tree

5 files changed

+44
-32
lines changed

5 files changed

+44
-32
lines changed

‎src/backend/utils/adt/tsvector_op.c

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -590,29 +590,30 @@ tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
590590
* check weight info or/and fill data by needed positions
591591
*/
592592
staticbool
593-
checkclass_str(CHKVAL*chkval,WordEntry*entry,QueryOperand*val,ExecPhraseData*data)
593+
checkclass_str(CHKVAL*chkval,WordEntry*entry,QueryOperand*val,
594+
ExecPhraseData*data)
594595
{
595596
boolres= false;
596597

597-
if (entry->haspos&& (val->weight||data))
598+
if (entry->haspos&& (val->weight||data))
598599
{
599600
WordEntryPosVector*posvec;
600601

601602
posvec= (WordEntryPosVector*)
602603
(chkval->values+SHORTALIGN(entry->pos+entry->len));
603604

604-
if (val->weight&&data)
605+
if (val->weight&&data)
605606
{
606-
WordEntryPos*ptr=posvec->pos;
607-
WordEntryPos*dptr;
607+
WordEntryPos*ptr=posvec->pos;
608+
WordEntryPos*dptr;
608609

609610
/*
610611
* Filter position information by weights
611612
*/
612613
dptr=data->pos=palloc(sizeof(WordEntryPos)*posvec->npos);
613614
data->allocated= true;
614615

615-
while(ptr-posvec->pos<posvec->npos)
616+
while (ptr-posvec->pos<posvec->npos)
616617
{
617618
if (val->weight& (1 <<WEP_GETWEIGHT(*ptr)))
618619
{
@@ -625,14 +626,14 @@ checkclass_str(CHKVAL *chkval, WordEntry *entry, QueryOperand *val, ExecPhraseDa
625626

626627
data->npos=dptr-data->pos;
627628

628-
if (data->npos>0)
629+
if (data->npos>0)
629630
res= true;
630631
}
631-
elseif (val->weight)
632+
elseif (val->weight)
632633
{
633-
WordEntryPos*ptr=posvec->pos;
634+
WordEntryPos*ptr=posvec->pos;
634635

635-
while(ptr-posvec->pos<posvec->npos)
636+
while (ptr-posvec->pos<posvec->npos)
636637
{
637638
if (val->weight& (1 <<WEP_GETWEIGHT(*ptr)))
638639
{
@@ -739,7 +740,7 @@ checkcondition_str(void *checkval, QueryOperand *val, ExecPhraseData *data)
739740

740741
while ((res== false||data)&&StopMiddle<chkval->arre&&
741742
tsCompareString(chkval->operand+val->distance,val->length,
742-
chkval->values+StopMiddle->pos,StopMiddle->len,
743+
chkval->values+StopMiddle->pos,StopMiddle->len,
743744
true)==0)
744745
{
745746
if (data)
@@ -766,7 +767,7 @@ checkcondition_str(void *checkval, QueryOperand *val, ExecPhraseData *data)
766767
}
767768

768769
memcpy(allpos+npos,data->pos,sizeof(WordEntryPos)*data->npos);
769-
npos+=data->npos;
770+
npos+=data->npos;
770771
}
771772
}
772773
else
@@ -817,17 +818,19 @@ TS_phrase_execute(QueryItem *curitem, void *checkval, bool calcnot, ExecPhraseDa
817818
if (data)
818819
data->npos=0;
819820

820-
if (TS_phrase_execute(curitem+curitem->qoperator.left,checkval,calcnot,&Ldata,chkcond)== false)
821+
if (TS_phrase_execute(curitem+curitem->qoperator.left,
822+
checkval,calcnot,&Ldata,chkcond)== false)
821823
return false;
822824

823-
if (TS_phrase_execute(curitem+1,checkval,calcnot,&Rdata,chkcond)== false)
825+
if (TS_phrase_execute(curitem+1,
826+
checkval,calcnot,&Rdata,chkcond)== false)
824827
return false;
825828

826829
/*
827830
* if at least one of operand has not a position information then
828831
* fallback to AND operation.
829832
*/
830-
if (Ldata.npos==0||Rdata.npos==0)
833+
if (Ldata.npos==0||Rdata.npos==0)
831834
return true;
832835

833836
/*
@@ -841,7 +844,8 @@ TS_phrase_execute(QueryItem *curitem, void *checkval, bool calcnot, ExecPhraseDa
841844
* OP_PHRASE is a modificated OP_AND, so number of resulting
842845
* positions could not be greater than any of operands
843846
*/
844-
data->pos=palloc(sizeof(WordEntryPos)*Min(Ldata.npos,Rdata.npos));
847+
data->pos=palloc(sizeof(WordEntryPos)*
848+
Min(Ldata.npos,Rdata.npos));
845849
else
846850
data->pos=Rdata.pos;
847851

@@ -858,9 +862,9 @@ TS_phrase_execute(QueryItem *curitem, void *checkval, bool calcnot, ExecPhraseDa
858862
* ExecPhraseData->data could point to the tsvector's WordEntryPosVector
859863
*/
860864

861-
while(Rpos-Rdata.pos<Rdata.npos)
865+
while(Rpos-Rdata.pos<Rdata.npos)
862866
{
863-
while(Lpos-Ldata.pos<Ldata.npos)
867+
while(Lpos-Ldata.pos<Ldata.npos)
864868
{
865869
if (WEP_GETPOS(*Lpos) <=WEP_GETPOS(*Rpos))
866870
{
@@ -927,7 +931,8 @@ TS_phrase_execute(QueryItem *curitem, void *checkval, bool calcnot, ExecPhraseDa
927931
*/
928932
bool
929933
TS_execute(QueryItem*curitem,void*checkval,boolcalcnot,
930-
bool (*chkcond) (void*checkval,QueryOperand*val,ExecPhraseData*data))
934+
bool (*chkcond) (void*checkval,QueryOperand*val,
935+
ExecPhraseData*data))
931936
{
932937
/* since this function recurses, it could be driven to stack overflow */
933938
check_stack_depth();

‎src/backend/utils/adt/tsvector_parser.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,14 @@ do { \
8989
} \
9090
} while (0)
9191

92-
#defineISOPERATOR(x)( pg_mblen(x)==1 && ( *(x)=='!' || *(x)=='&' || *(x)=='|' || *(x)=='?' || *(x)=='(' || *(x)==')' ) )
92+
#defineISOPERATOR(x) \
93+
( pg_mblen(x) == 1 && ( *(x) == '!' ||\
94+
*(x) == '&' ||\
95+
*(x) == '|' ||\
96+
*(x) == '?' ||\
97+
*(x) == '(' ||\
98+
*(x) == ')'\
99+
) )
93100

94101
/* Fills gettoken_tsvector's output parameters, and returns true */
95102
#defineRETURN_TOKEN \

‎src/include/catalog/pg_operator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ DESCR("AND-concatenate");
16721672
DATA(insertOID=3681 ("||"PGNSPPGUIDbff36153615361500tsquery_or-- ));
16731673
DESCR("OR-concatenate");
16741674
/* ?? operation calls tsquery_phrase, but function is polymorphic. So, point OID of tsquery_phrase */
1675-
DATA(insertOID=5005 ("??"PGNSPPGUIDbff361536153615005003--));
1675+
DATA(insertOID=5005 ("??"PGNSPPGUIDbff361536153615005003--));
16761676
DESCR("phrase-concatenate");
16771677
DATA(insertOID=3682 ("!!"PGNSPPGUIDlff03615361500tsquery_not-- ));
16781678
DESCR("NOT tsquery");

‎src/include/catalog/pg_proc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4616,11 +4616,11 @@ DESCR("less-equal-greater");
46164616

46174617
DATA(insert OID = 3669 ( tsquery_andPGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ _null_ tsquery_and _null_ _null_ _null_ ));
46184618
DATA(insert OID = 3670 ( tsquery_orPGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ _null_ tsquery_or _null_ _null_ _null_ ));
4619-
DATA(insert OID = 5003 ( tsquery_phrasePGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ _null_ tsquery_phrase _null_ _null_ _null_ ));
4620-
DATA(insert OID = 5004 ( tsquery_phrasePGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 3615 "3615 3615 25" _null_ _null_ _null_ _null_ _null_ tsquery_phrase_distance _null_ _null_ _null_ ));
4619+
DATA(insert OID = 5003 ( tsquery_phrasePGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 3615" _null_ _null_ _null_ _null_ _null_ tsquery_phrase _null_ _null_ _null_ ));
4620+
DATA(insert OID = 5004 ( tsquery_phrasePGNSP PGUID 12 1 0 0 0 f f f f t f i 3 0 3615 "3615 3615 25" _null_ _null_ _null_ _null_ _null_ tsquery_phrase_distance _null_ _null_ _null_ ));
46214621
DESCR("phrase-concatenate with distance");
46224622
DATA(insert OID = 3671 ( tsquery_notPGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 3615 "3615" _null_ _null_ _null_ _null_ _null_ tsquery_not _null_ _null_ _null_ ));
4623-
DATA(insert OID = 5002 ( setweightPGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 18" _null_ _null_ _null_ _null_ _null_ tsquery_setweight _null_ _null_ _null_ ));
4623+
DATA(insert OID = 5002 ( setweightPGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 3615 "3615 18" _null_ _null_ _null_ _null_ _null_ tsquery_setweight _null_ _null_ _null_ ));
46244624
DESCR("add weight class");
46254625

46264626
DATA(insert OID = 3691 ( tsq_mcontainsPGNSP PGUID 12 1 0 0 0 f f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ _null_ tsq_mcontains _null_ _null_ _null_ ));

‎src/include/tsearch/ts_public.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ typedef struct
3434
*/
3535
typedefstruct
3636
{
37-
uint32selected:1,
38-
in:1,
39-
replace:1,
40-
repeated:1,
41-
skip:1,
42-
unused:3,
43-
type:8,
44-
len:16;
37+
uint32selected:1,
38+
in:1,
39+
replace:1,
40+
repeated:1,
41+
skip:1,
42+
unused:3,
43+
type:8,
44+
len:16;
4545
WordEntryPospos;
4646
char*word;
4747
QueryOperand*item;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp