Skip to content

Commit

Permalink
fix: EXPOSED-565 Subquery alias with id fails to use correct alias wi…
Browse files Browse the repository at this point in the history
…th eq

- Add test that uses CompositeID on right-hand side
  • Loading branch information
bog-walk committed Sep 26, 2024
1 parent 208ddce commit 213ac8f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,15 @@ class CompositeIdTableEntityTest : DatabaseTestsBase() {

val smallCity = Towns.alias("small_city")

val result = smallCity.selectAll().where {
val result1 = smallCity.selectAll().where {
smallCity[Towns.id].isNotNull() and (smallCity[Towns.id] eq townAId)
}.single()
assertNull(result[smallCity[Towns.population]])
assertNull(result1[smallCity[Towns.population]])

val result2 = smallCity.select(smallCity[Towns.name]).where {
smallCity[Towns.id] eq townAId.value
}.single()
assertEquals(townAValue[Towns.name], result2[smallCity[Towns.name]])
}
}

Expand Down

0 comments on commit 213ac8f

Please sign in to comment.