Skip to content

Commit

Permalink
Fix leak on index scan IN optimization (#984)
Browse files Browse the repository at this point in the history
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
  • Loading branch information
jeffreylovitz and swilly22 committed Feb 25, 2020
1 parent 8f82d2a commit f44a8c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/execution_plan/optimizations/utilize_indices.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ static void _transformInToOrSequence(FT_FilterNode **filter) {
FT_FilterNode *filter_tree = *filter;

AR_ExpNode *inOp = filter_tree->exp.exp;
AR_ExpNode *lhs = AR_EXP_Clone(inOp->op.children[0]);
SIValue list = inOp->op.children[1]->operand.constant;
uint listLen = SIArray_Length(list);

Expand All @@ -28,6 +27,7 @@ static void _transformInToOrSequence(FT_FilterNode **filter) {
val = SIArray_Get(list, 0); // Retrieve the first array element.
SIValue_Persist(&val); // Ensure the value doesn't go out of scope.
constant = AR_EXP_NewConstOperandNode(val);
AR_ExpNode *lhs = AR_EXP_Clone(inOp->op.children[0]);
root = FilterTree_CreatePredicateFilter(OP_EQUAL, lhs, constant);

for(uint i = 1; i < listLen; i ++) {
Expand Down

0 comments on commit f44a8c4

Please sign in to comment.