Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/qiaoyuang/SQLiter into qiao…
Browse files Browse the repository at this point in the history
…yuang-main
  • Loading branch information
kpgalligan committed Nov 5, 2023
2 parents 4deea8d + 05e8ea5 commit 8968474
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,18 @@ class NativeCursor(override val statement: NativeStatement) : Cursor {
override val columnNames: Map<String, Int> by lazy {
val map = HashMap<String, Int>(this.columnCount)
for (i in 0 until columnCount) {
map.put(columnName(i), i)
val key = columnName(i)
if (map.containsKey(key)) {
var index = 1
val basicKey = "$key&JOIN"
var finalKey = basicKey + index
while (map.containsKey(finalKey)) {
finalKey = basicKey + ++index
}
map[finalKey] = i
} else {
map[key] = i
}
}
map
}
Expand Down

0 comments on commit 8968474

Please sign in to comment.