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
limit
with subQuery: false
return wrong result
#9605
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂 |
@husnulhamidiah Were you able to figure out the issue ? I'm also observing similar issue so looking for root cause and approach to handle it |
@husnulhamidiah @chetanmenge , did any of you figure out the issue? |
sorry, but i have the same issue using Limit with subQuery : false; can any one figured it out who to solve similar issue? |
@chetanmenge @eldadgiladi @Afinetri No solution and workaround for this, the only option is using bare SQL with knex or bookshelf. |
Has there been any progress whatsoever? This is a big deal. |
Same problem. The issue is actual for now |
Hello, can anyone please convert OP's SSCCE into a failing test case?
Thanks!! |
@papb FYI: In my case the issue takes place, when I include models with @ HasMany relations. include: [
{
model: Offer,
as: "offers",
required: false,
separate: true
},
{
model: DealFund,
as: "fund",
include: [
{
model: DealFundCharge,
as: "charges",
required: false,
separate: true
}
]
}
] Alex |
Did anyone found any solution to this? |
1 similar comment
Did anyone found any solution to this? |
any solution? I need add "subQuery:false" to avoid the error "RangeError [ERR_INVALID_OPT_VALUE]: The value "2147483648" is invalid for option "size"". While if I add "subQury:false", the "limit" results is not correct. I have 6 rows, while it only queried 1 row. |
There is like 9 versions of this issue isn't there? |
Facing the same issue |
same issue - I need to set |
Same issue here, but when I use |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
is there any update on this? |
I don't think it's possible to make I think it's better to look into why you need to disable |
well the reason I disable the subquery is that I get an error(Unknown column 'user.first_name' in 'order clause) when I don't disable it. Basically I want to order by associate model's property but it does not allow me to do it unless I disable subquery. And it returns missing data when I disable |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
Did anyone find the solution separate: true solve the Limited data problem and give all the Data applied limit But in that case top level where clause fail This kind of syntax failed and give error unknown column stones.material.name If I apply like query on each nested modals individually then also a problem because in that case like query not apply with Or operator and return zero result If anyone have a solution to this problem plz |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
I'll close this issue as I've now documented that Issues related to |
Facing same issue, if i delete subQuery: false, i got error Unknown column '$someIncludeTable.someColumn$' in 'where clause' |
What are you doing?
Let's say I have
Transaction
model which have many-to-many relation withGood
model. And also belongs toUser
model. Here's my model and relation definition.I already seed my database with data so user with id
30e1c140-d4d0-4edb-980a-3d7b9a47a958
has 7 transaction. I want to get transaction for that user with all goods in it. Here's my code.What do you expect to happen?
It will output array with 7 transcations data (all records in database).
What is actually happening?
It returns array with only 3 data. Here's generated SQL
But when I remove
subQuery: false
option it will return 7 data. Here's generated sql withoutsubQuery: false
option.Dialect: mysql
Database version: 5.7.18
Sequelize version: 4.38.0
Tested with latest release: Yes
Note : Your issue may be ignored OR closed by maintainers if it's not tested against latest version OR does not follow issue template.
The text was updated successfully, but these errors were encountered: