RelationIdLoader
is not consistently respecting maxAliasLength
#11227
Labels
RelationIdLoader
is not consistently respecting maxAliasLength
#11227
Issue description
RelationIdLoader
is usingDriverUtils.buildAlias
in some places but not in others. Notably this causesrelationLoadStrategy: 'query'
to fail while'join'
works forOneToOne
relations that generate very long aliases.Expected Behavior
RelationIdLoader
should consistently useDriverUtils.buildAlias
when generating column aliases that fit themaxAliasLength
prop of driver.Actual Behavior
loadForManyToOneAndOneToOneOwner
ignoresmaxAliasLength
for thehasAllJoinColumnsInEntity
case. This causes id mismatches later inloadManyToManyRelationIdsAndGroup
which usesDriverUtils.buildAlias
.Steps to reproduce
Applies to PostgreSQL, MySQL and possibly other drivers
Schema
Test Case
My Environment
Additional Context
This is a follow up to #9379 / #9380 which didn't consider this specific case.
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
The text was updated successfully, but these errors were encountered: