Closed clausnagel closed 2 years ago
Merging #51 (05fe403) into master (84a26b4) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #51 +/- ##
=========================================
Coverage 89.32% 89.32%
Complexity 271 271
=========================================
Files 25 25
Lines 899 899
Branches 46 46
=========================================
Hits 803 803
Misses 83 83
Partials 13 13
Impacted Files | Coverage Δ | |
---|---|---|
...ithub/vertical_blank/sqlformatter/core/Params.java | 70.37% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 84a26b4...05fe403. Read the comment docs.
@clausnagel Thank you very much!
Hi @vertical-blank, are you planning a new release soon that will contain this fix?
@clausnagel I've released 2.0.3 to Maven Central just now. https://repo1.maven.org/maven2/com/github/vertical-blank/sql-formatter/2.0.3/
Indexed placeholders are not inserted in the provided order.
Code to reproduce the issue:
Generated but wrong output is:
In a correct output,
a
must be assigned3
andc
must be assigned1
instead.The issue is that
IndexedParams
uses aPriorityQueue
that stores the placeholder values based on their natural ordering instead of the order of the provided list. This PR proposes to replacePriorityQueue
with anArrayDeque
to fix this issue.