Azure / Azure/data-api-builder

MySql queries require Limit to maintain ordering

Offen
#350 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @junsu0ms Auf GitHub ansehen
bug mysql
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.