You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query =='SELECT COUNT(*) FROM `meal` meal_ INNER JOIN `food` meal_foods_ ON meal_.`mid`=meal_foods_.`fk_meal_id` INNER JOIN `meal` meal_foods_alternative_meal_ ON meal_foods_.`fk_alt_meal`=meal_foods_alternative_meal_.`mid` WHERE (meal_foods_alternative_meal_.`current_blood_glucose` IN (?))'
}
but queries by entity identifier.
Looks like the bug is here. Join alias is really needed if entity id is not a part of first relation (or maybe in some other cases).
Environment Information
Operation System: Ubuntu 20.04
JDK Version: 11.0.13+8-Ubuntu-0ubuntu1.20.04
Example Application
No response
Version
3.2.2
The text was updated successfully, but these errors were encountered:
Expected Behavior
Correct SQL query should be built for select query with multiple joins with entity identity constriant.
Actual Behaviour
SQL query with incorrect where clause is built. Query uses root table alias instead of join alias as property prefix.
Steps To Reproduce
Add the following test to
data-processor
module:This test is basically is the same as
micronaut-data/data-processor/src/test/groovy/io/micronaut/data/processor/sql/BuildQuerySpec.groovy
Lines 253 to 273 in 60246c7
but queries by entity identifier.
Looks like the bug is here. Join alias is really needed if entity id is not a part of first relation (or maybe in some other cases).
Environment Information
Ubuntu 20.04
11.0.13+8-Ubuntu-0ubuntu1.20.04
Example Application
No response
Version
3.2.2
The text was updated successfully, but these errors were encountered: