Kaydet (Commit) f468662e authored tarafından Anssi Kääriäinen's avatar Anssi Kääriäinen

Fixed #21821 -- db_type argument for field_cast_sql

The db_type argument for connection.ops.field_cast_sql wasn't correctly
set after merge of custom lookups patch.
üst 2f65b8e1
...@@ -116,7 +116,7 @@ class BuiltinLookup(Lookup): ...@@ -116,7 +116,7 @@ class BuiltinLookup(Lookup):
def as_sql(self, qn, connection): def as_sql(self, qn, connection):
lhs_sql, params = self.process_lhs(qn, connection) lhs_sql, params = self.process_lhs(qn, connection)
field_internal_type = self.lhs.output_type.get_internal_type() field_internal_type = self.lhs.output_type.get_internal_type()
db_type = self.lhs.output_type db_type = self.lhs.output_type.db_type(connection=connection)
lhs_sql = connection.ops.field_cast_sql(db_type, field_internal_type) % lhs_sql lhs_sql = connection.ops.field_cast_sql(db_type, field_internal_type) % lhs_sql
lhs_sql = connection.ops.lookup_cast(self.lookup_name) % lhs_sql lhs_sql = connection.ops.lookup_cast(self.lookup_name) % lhs_sql
rhs_sql, rhs_params = self.process_rhs(qn, connection) rhs_sql, rhs_params = self.process_rhs(qn, connection)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment