New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query using the LN() function does not terminate #518
Comments
Very interesting! I wonder what causes this :) |
…d of potential NaN values, and fix merge join on NaN values (fixes #518)
Fixed in 230785f. The issue was that LN(-1) or LN(0) produced a NaN value, which resulted in an infinite loop in the quick sort step of the merge join. The reason for that is that we had a loop in the form of: while(i < j) {
while (data[i] < data[pivot]) {
i++;
}
while (data[pivot] < data[j]) {
j--;
}
if (i < j) {
swap(data[i], data[j]);
}
} However, since NaN always compares false with any other value, this loop became infinite as the conditions to trigger either I fixed this case by filtering out NaN values prior to the sort, similar to how NULL values were handled, and also changed the LN, LOG2, LOG10 and SQRT operators to return in a NULL if given invalid input, rather than potentially producing NaN or infinite. |
Consider the following statements:
Unexpectedly, the
SELECT
does not terminate.I found this bug based on the latest master commit (9795d18).
The text was updated successfully, but these errors were encountered: