Problems referencing associated query conditions that are not primary key fields #17129
Open
4 tasks
Labels
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: bug
Problems referencing associated query conditions that are not primary key fields | BUG!
Bug Description
What do you expect to happen?
The query result is as follows: {count: 4, rows: Array(4)}
What is actually happening?
The roleId=1 data in the role table exists and is associated with the account in the association table
Or the where: {} condition does not find data, and count is error.
Query result:
{count: 4, rows: Array(0)}
I can't find the data, but the statistics are correct.
Here is the full SQL statement:
Data cannot be queried if the following conditions occur:
The pk of the account table is equal to the userId of the associated table. Why is this?
This condition exists even if constraints are cancelled with constraints: false
Is this a BUG?
Or is it my way of writing?
thank you!
Environment
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: