diff options
| author | Simon Charette <charette.s@gmail.com> | 2026-02-01 16:53:54 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-03-19 12:24:17 -0400 |
| commit | f05fac88c4699c6d04a8f1ac3328cf6c7bd39228 (patch) | |
| tree | 2399222aaed0ad6d9e466e914d178f08cd6e8337 /tests/queries | |
| parent | 4b2b4bf0ac2707dc9c4d51cabfa72168eaea95fe (diff) | |
Fixed #36795 -- Enforced quoting of all database object names.
This ensures all database identifiers are quoted independently of their orign
and most importantly that user provided aliases through annotate() and alias()
which paves the way for dropping the allow list of characters such aliases can
contain.
This will require adjustments to raw SQL interfaces such as RawSQL that might
make reference to ORM managed annotations as these will now be quoted.
The `SQLCompiler.quote_name_unless_alias` method is kept for now as an alias
for the newly introduced `.quote_name` method but will be duly deprecated in
a follow up commit.
Diffstat (limited to 'tests/queries')
| -rw-r--r-- | tests/queries/tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py index af657b2580..d58eccaa12 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -195,7 +195,8 @@ class Queries1Tests(TestCase): # It is possible to reuse U for the second subquery, no need to use W. self.assertNotIn("w0", str(qs4.query).lower()) # So, 'U0."id"' is referenced in SELECT and WHERE twice. - self.assertEqual(str(qs4.query).lower().count("u0."), 4) + id_col = "%s." % connection.ops.quote_name("u0").lower() + self.assertEqual(str(qs4.query).lower().count(id_col), 4) def test_ticket1050(self): self.assertSequenceEqual( |
