rql icon indicating copy to clipboard operation
rql copied to clipboard

rql_test failes statistically

Open itsofirblink opened this issue 3 years ago • 3 comments

When running rql_test sometimes the split function gets stuck and gets to a point of out of memory. After a lot of debugging i found out that the way the equalExp function implemented is wrong.

The check

if s1[i][0] == '(' && s2[j][0] == '(' {
    found = equalExp(s1[i][1:len(s1[i])-1], s2[j][1:len(s2[j])-1])
}

is wrong because if we get ( at the start we are removing the end of the string, not the next ) found which is the problem there is a corruption of data (a = b AND c = d) OR (a = c AND (c = d OR d = f)) will be a = b AND c = d) OR (a = c AND (c = d OR d = f)

The problem starts here and get to the split function which is not validating the given data and not breaking out of the while loop after it failes at the start with finding )

itsofirblink avatar Jun 21 '21 07:06 itsofirblink

Thanks for reporting this @itsofirblink. Please feel free to send a patch and tag me there. Thanks 🙏

a8m avatar Jun 21 '21 07:06 a8m

@a8m should i open a PR? or send it here :)

itsofirblink avatar Jun 30 '21 07:06 itsofirblink

Please open a PR 😃

a8m avatar Jun 30 '21 07:06 a8m