Closed cthumuluru closed 4 years ago
I can work on a fix if someone assert my findings.
Nice findings!
Feel free to submit a patch, I can review it :)
@jorgebay — Can you please review this PR and provide your feedback?
In Query.java
I think it would be nice to compare the column positions and throw RuntimeException
if the param order won't match. I didn't add it in this PR since the existing code was not doing it either. :)
Also, ResultSet suffers from similar ordering issues. I'll send those changes in a different PR.
Added changes to retain the order of column values in a Row.
With Simulacron, while mocking prepared statements with more than one parameters of different types, our tests are failing. I think it's a bug in the way the parameter metadata is stored and checked for a match.
Parameter types and values are two different maps (API doesn't enforce ordered maps) and the match fails. The bug is in the following code (
com.datastax.oss.simulacron.common.request.Query
) where the iterators won't yield elements in the matching order: `` Replacing Map with LinkedHashMap fixes the issue.