﻿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
36689	Top-level __in lookup on JSONField fails on MySQL, Oracle	Jacob Walls	Clifford Gama	"This test for `test_jsonfield.TestQuerying` passes on SQLite, Postgres, and MariaDB.

{{{#!py
    def test_in(self):
        self.assertSequenceEqual(
            NullableJSONModel.objects.filter(value__in=[{}]),
            [self.objs[2]],
        )
}}}

Fails on MySQL and Oracle. Clifford [https://github.com/django/django/pull/19794#issuecomment-3447789894 suspects] the specialization in `KeyTransformIn` is missing in the top-level `In` lookup.

Failure on MySQL:
{{{#!py
======================================================================
FAIL: test_in (model_fields.test_jsonfield.TestQuerying.test_in)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/django/source/tests/model_fields/test_jsonfield.py"", line 379, in test_in
    self.assertSequenceEqual(
AssertionError: Sequences differ: <QuerySet []> != [<NullableJSONModel: NullableJSONModel object (3)>]

Second sequence contains 1 additional elements.
First extra element 0:
<NullableJSONModel: NullableJSONModel object (3)>

- <QuerySet []>
+ [<NullableJSONModel: NullableJSONModel object (3)>]

----------------------------------------------------------------------
(0.001) SELECT `model_fields_nullablejsonmodel`.`id`,
       `model_fields_nullablejsonmodel`.`value`,
       `model_fields_nullablejsonmodel`.`value_custom`
FROM `model_fields_nullablejsonmodel`
WHERE `model_fields_nullablejsonmodel`.`value` IN ('{}'); args=('{}',); alias=default

----------------------------------------------------------------------
}}}
Failure on Oracle:
{{{#!py
django.db.utils.DatabaseError: ORA-22848: cannot use NCLOB type as comparison key
Help: https://docs.oracle.com/error-help/db/ora-22848/

----------------------------------------------------------------------
(0.016) SELECT ""MODEL_FIELDS_NULLABLEJSONMODEL"".""ID"",
       ""MODEL_FIELDS_NULLABLEJSONMODEL"".""VALUE"",
       ""MODEL_FIELDS_NULLABLEJSONMODEL"".""VALUE_CUSTOM""
FROM ""MODEL_FIELDS_NULLABLEJSONMODEL""
WHERE ""MODEL_FIELDS_NULLABLEJSONMODEL"".""VALUE"" IN ({}); args=('{}',); alias=default

----------------------------------------------------------------------
}}}"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	JSON, In	Clifford Gama Sage Abdullah	Ready for checkin	1	0	0	0	0	0
