summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2025-02-15 17:48:53 +0100
committerGitHub <noreply@github.com>2025-02-15 17:48:53 +0100
commitc80c81163e0d31aefc82eafef2b4807cde6ab0b5 (patch)
tree2ad63e7f5c890a28164af56257f8c724bdfdb554 /django/db/models/sql/compiler.py
parent8b1e324ca4aa1ae0721f6f5dcfba8325a751ef3c (diff)
[5.2.x] Refs #36181 -- Removed the obsolete SubqueryConstraint machinery.
Adding proper support for subquery right-hand-sides to TupleIn made it obsolete. Backport of d386405e04dac50656af50d100a14efdf8c58e8f from main Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 04372c509e..0b6cfbfc37 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -22,7 +22,6 @@ from django.db.models.sql.constants import (
SINGLE,
)
from django.db.models.sql.query import Query, get_order_dir
-from django.db.models.sql.where import AND
from django.db.transaction import TransactionManagementError
from django.utils.functional import cached_property
from django.utils.hashable import make_hashable
@@ -1661,19 +1660,6 @@ class SQLCompiler:
return list(result)
return result
- def as_subquery_condition(self, alias, columns, compiler):
- qn = compiler.quote_name_unless_alias
- qn2 = self.connection.ops.quote_name
- query = self.query.clone()
-
- for index, select_col in enumerate(query.select):
- lhs_sql, lhs_params = self.compile(select_col)
- rhs = "%s.%s" % (qn(alias), qn2(columns[index]))
- query.where.add(RawSQL("%s = %s" % (lhs_sql, rhs), lhs_params), AND)
-
- sql, params = query.as_sql(compiler, self.connection)
- return "EXISTS %s" % sql, params
-
def explain_query(self):
result = list(self.execute_sql())
# Some backends return 1 item tuples with strings, and others return