New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL: Regression when using take
, orderBy
, and getMany
on a joined relation
#8346
Labels
Comments
stephenwade
changed the title
MySQL: Regression when using
MySQL: Regression when using Nov 9, 2021
take
and orderBy
on a joined relationtake
, orderBy
, and getMany
on a joined relation
@stephenwade Thanks for the report |
antonku
added a commit
to antonku/typeorm
that referenced
this issue
Nov 10, 2021
…operty and a limit (typeorm#8346)
7 tasks
pleerock
pushed a commit
that referenced
this issue
Nov 11, 2021
HeartPattern
pushed a commit
to HeartPattern/typeorm
that referenced
this issue
Nov 29, 2021
typeorm#8352) * Revert "fix: ordering by joined columns for PostgreSQL (typeorm#3736) (typeorm#8118)" This reverts commit 1649882. * test: add a test for leftJoinAndSelect with ordering by a relation property and a limit (typeorm#8346)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
!!!! This is a regression in the latest patch update. This worked correctly in 0.2.38 and stopped working in 0.2.39.
When I use
.take()
,.orderBy()
, and.getMany()
, if the.orderBy()
uses a joined relation, I get a database error about a duplicate column.If I remove
.take()
, order by a column on the main relation instead of the joined relation (customers instead of contacts in my example), or use.getRawMany()
instead of.getMany()
, the problem does not occur.Expected Behavior
These are the queries in the MySQL logs from version 0.2.38:
Actual Behavior
This is the query in the MySQL logs from version 0.2.39:
Steps to Reproduce
This is a minimal example. If I remove
.take()
, use a column from Customer instead of CustomerContact in.orderBy()
, or use.getRawMany()
instead of.getMany()
, the issue does not happen.I have the following entities:
Here is the code that gives an error:
My Environment
Relevant Database Driver(s)
I have only tested this in MySQL.
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: