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

Commit954f6da

Browse files
author
Alexander Korotkov
committed
Fix valgrind compaints.
1 parent0777fb6 commit954f6da

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎jsquery_extract.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,18 @@ recursiveExtract(JsQueryItem *jsq, bool not, bool indirect, PathItem *path)
250250

251251
if (jsq->type==jqiGreater||jsq->type==jqiGreaterOrEqual)
252252
{
253+
result->bounds.leftBound= (JsQueryItem*)palloc(sizeof(JsQueryItem));
253254
result->bounds.leftInclusive= (jsq->type==jqiGreaterOrEqual);
254255
result->bounds.rightBound=NULL;
255-
result->bounds.leftBound=(JsQueryItem*)palloc(sizeof(JsQueryItem));
256+
result->bounds.rightInclusive=false;
256257
jsqGetArg(jsq,result->bounds.leftBound);
257258
}
258259
else
259260
{
261+
result->bounds.rightBound= (JsQueryItem*)palloc(sizeof(JsQueryItem));
260262
result->bounds.rightInclusive= (jsq->type==jqiLessOrEqual);
261263
result->bounds.leftBound=NULL;
262-
result->bounds.rightBound=(JsQueryItem*)palloc(sizeof(JsQueryItem));
264+
result->bounds.leftInclusive=false;
263265
jsqGetArg(jsq,result->bounds.rightBound);
264266
}
265267
returnresult;
@@ -699,12 +701,13 @@ makeEntries(ExtractedNode *node, MakeEntryHandler handler, Pointer extra)
699701
for (i=0;i<node->args.count;i++)
700702
{
701703
child=node->args.items[i];
702-
if (!child)continue;
703-
if (child->sClass>node->sClass&& !child->forceIndex)
704-
{
705-
Assert(node->type!=eOr);
704+
if (!child)
705+
continue;
706+
/* Skip non-selective AND children */
707+
if (child->sClass>node->sClass&&
708+
node->type==eAnd&&
709+
!child->forceIndex)
706710
continue;
707-
}
708711
child=makeEntries(child,handler,extra);
709712
if (child)
710713
{
@@ -771,15 +774,15 @@ setSelectivityClass(ExtractedNode *node, CheckEntryHandler checkHandler,
771774
if (!child)
772775
continue;
773776

777+
setSelectivityClass(child,checkHandler,extra);
778+
774779
if (!isLogicalNodeType(child->type))
775780
{
776781
if (child->hint==jsqNoIndex||
777782
!checkHandler(child,extra))
778783
continue;
779784
}
780785

781-
setSelectivityClass(child,checkHandler,extra);
782-
783786
if (child->forceIndex)
784787
node->forceIndex= true;
785788

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp