﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35053	Limiting QuerySets is not database platform agnostic	irfanhakim	nobody	"Sample query with the intention of getting only the first 3 objects according to the attribute it was ordered by:

{{{
pending_objects = PostSchedule.objects.filter(subject__post_id__isnull=True).order_by(""subject__published"")[:3]
}}}

This query works as expected when using PostgreSQL as the backend database with Django. When using MariaDB (`11.1.3-MariaDB`) however, said query will receive an error:

{{{
django.db.utils.NotSupportedError: (1235, ""This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'"")
}}}

I don't have a MySQL database to test whether this applies to MySQL as well, but it's possible that this too applies for it.

Django's documentations on [https://docs.djangoproject.com/en/4.2/topics/db/queries/#limiting-querysets Limiting QuerySets] and [https://docs.djangoproject.com/en/4.2/ref/databases/#mariadb-notes MariaDB notes] does not seem to indicate that the **Limiting QuerySets** feature should not be database platform agnostic.

I would also appreciate any pointers on how to still achieve a similar enough outcome of limiting a QuerySet to a specified number when using MariaDB (or other supported databases that is not PostgreSQL)."	Bug	closed	Database layer (models, ORM)	4.2	Normal	duplicate	queryset, database, documentation		Unreviewed	0	0	0	0	0	0
