Azure / Azure/data-api-builder
MySql queries require Limit to maintain ordering
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
Certain MySql queries will not maintain the ordering unless you include a limit in the query.
`SELECT JSON_ARRAYAGG(JSON_OBJECT('id', id, 'title', title, 'publisher_id', publisher_id)) AS data
FROM (
SELECT id, title, publisher_id
FROM " + _integrationTableName + @"
ORDER BY id desc, publisher_id
LIMIT 100
) AS subq"`
As an example, the above query will not pass the test which verifies the sorted order of the columns without including a LIMIT. This work around of adding a LIMIT currently provides a solution to this problem, but we should investigate if this can be resolved in another way.
Contributor guide
Assessment
This issue has not been assessed yet.