ADS : 14-rc-42
Platform : Ubuntu 12.04 64 bit
MongoDB : 2.4.4
With reference to the attached tde.json dataset, when we run queries as follows:
select * from tde where stats between (89078 + 2) and (89089980918)
--1 doc returned
select * from tde where stats between (89080) and (89089980918)
--3 docs returned.
Could you please investigate this issue? Thanks
(NB : I am not sure but this could be related to issue 10334)
![]() |
7 KB
Emil, the query select * from tde where stats between (89078 + 2) and (89089980918) doesn't return the documents where stats is a "long" value. Please investigate and check if the fix for issue #10334 takes care of this problem. If not, let us know what the problem is and we'll decide which release the fix should be applied.
Yes, this issue is related to #10334. Whenever a field is compared with an arithmetic expression, the JDBC driver appends a typeof <field> == 'number' check to the javascript expression (used as value for the $where operator).
That's why your first scenario return only one document while the latter one returns 3 docs (the typeof <field> == 'number' check is not used in this case because after expanding the field BETWEEN val1 and val2 expression field >= val1 and field <= val2 , it turns out that the operand from the RHS of each comparison is not an arithmetic expression).
This problem is fixed by the change made for issue #10334.
Yes, this issue is related to #10334. Whenever a field is compared with an arithmetic expression, the JDBC driver appends a typeof <field> == 'number' check to the javascript expression (used as value for the $where operator).
That's why your first scenario return only one document while the latter one returns 3 docs (the typeof <field> == 'number' check is not used in this case because after expanding the field BETWEEN val1 and val2 expression field >= val1 and field <= val2 , it turns out that the operand from the RHS of each comparison is not an arithmetic expression).
This problem is fixed by the change made for issue #10334.
Verified on ADS 14.0.1. Forwarded test case to Jenny to be added to test suite.
Verified on ADS 14.0.1. Forwarded test case to Jenny to be added to test suite.
Issue #10347 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 14.0.0-2 (mongo-jdbc 1.3.8) |
No time estimate |
1 issue link |
relates to #10334
Issue #10334Deviant behavior of a mongoSQL query |
Emil, the query select * from tde where stats between (89078 + 2) and (89089980918) doesn't return the documents where stats is a "long" value. Please investigate and check if the fix for issue #10334 takes care of this problem. If not, let us know what the problem is and we'll decide which release the fix should be applied.