﻿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
37576	model_fields.test_uuid.TestQuerying.test_icontains fails on MariaDB 11.4 and later	Mike Edmunds		"Django's `model_fields.test_uuid.TestQuerying.test_icontains` works on MariaDB 10.11, but fails on MariaDB 11.4, 11.8, 12.3, and 13.1.

To reproduce using django-docker-box:

{{{#!console
% docker compose build mariadb
% MARIADB_VERSION=11.4 docker compose run --rm mariadb model_fields.test_uuid.TestQuerying
...
FAIL: test_icontains (model_fields.test_uuid.TestQuerying.test_icontains)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/usr/local/lib/python3.13/unittest/case.py"", line 58, in testPartExecutor
    yield
  File ""/usr/local/lib/python3.13/unittest/case.py"", line 651, in run
    self._callTestMethod(testMethod)

  File ""/usr/local/lib/python3.13/unittest/case.py"", line 606, in _callTestMethod
    if method() is not None:
    ^^^^^^^^^^^^^^^
  File ""/django/source/tests/model_fields/test_uuid.py"", line 169, in test_icontains
    self.assertSequenceEqual(
    ^^^^^^^^^^^^^^^
  File ""/usr/local/lib/python3.13/unittest/case.py"", line 1095, in assertSequenceEqual
    self.fail(msg)
    ~~~~~~~~~^^^^^
  File ""/usr/local/lib/python3.13/unittest/case.py"", line 732, in fail
    raise self.failureException(msg)
    ^^^^^^^^^^^^^^^
AssertionError: Sequences differ: <QuerySet []> != [<NullableUUIDModel: NullableUUIDModel object (2)>]

Second sequence contains 1 additional elements.
First extra element 0:
<NullableUUIDModel: NullableUUIDModel object (2)>

- <QuerySet []>
+ [<NullableUUIDModel: NullableUUIDModel object (2)>]
}}}

Verify it worked in the older version (you must stop the mariadb-db container to change versions as described in django-docker-box's readme):

{{{#!console
% docker compose down mariadb-db
% MARIADB_VERSION=10.11 docker compose run --rm mariadb model_fields.test_uuid.TestQuerying
...
Found 11 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
..........s
----------------------------------------------------------------------
Ran 11 tests in 0.010s

OK (skipped=1)
}}}

Note that `test_contains` in the same suite passes with all supported MariaDB versions. (django-docker-box forces [https://github.com/django/django-docker-box/blob/337f6280045e58c534ce6e7cb6bc33956ce3f44e/settings.py#L24-L25 CHARSET to ""utf8mb4""] , but removing that doesn't change the results.)

AI (Gemini 4 Hydrogen) hypothesizes this is because MariaDB changed `utf8mb4` default collation from `utf8mb4_general_ci` in 10.11 to `utf8mb4_uca1400_ai_ci` in 11.4 (and presumably something related to native UUID-to-string coercion for the LIKE operator, though it's a bit vague when pressed on that point). I haven't verified or investigated further.

(If you get an error about mysqldump and ssl, add `--parallel=1`—see [https://github.com/django/django-docker-box/issues/80 django-docker-box#80].)
"	Uncategorized	new	Database layer (models, ORM)	dev	Low		tests, mariadb, collation, uuid		Unreviewed	0	0	0	0	0	0
