              sql = field_name
          else:
              format_str = ''.join([f for f in format[:i]] + [f for f in format_def[i:]])
              sql = "CAST(DATE_FORMAT(%s, '%s') AS DATETIME)" % (field_name, format_str)
          return sql, params
  
      def time_trunc_sql(self, lookup_type, field_name):
          fields = {
              'hour': '%%H:00:00',
              'minute': '%%H:%%i:00',
 
</s> remove         return sql, []
 </s> add         return sql </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname) </s> remove         return sql, inner_params + params
 </s> add         return sql, inner_params </s> remove         sql = 'TRUNC(%s)' % field_name
        return sql, []
 </s> add         return 'TRUNC(%s)' % field_name </s> remove             field_name = "CONVERT_TZ(%s, 'UTC', %%s)" % field_name
            params = [tzname]
        else:
            params = []
        return field_name, params
 </s> add             field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
        return sql
              sql = field_name
          else:
              format_str = ''.join([f for f in format[:i]] + [f for f in format_def[i:]])
              sql = "CAST(DATE_FORMAT(%s, '%s') AS DATETIME)" % (field_name, format_str)
        return sql
  
      def time_trunc_sql(self, lookup_type, field_name):
          fields = {
              'hour': '%%H:00:00',
              'minute': '%%H:%%i:00',
keep keep keep keep replace keep keep keep keep keep
 Fixed #27802 -- Unified return value of db backend datetime SQL methods. 
django/db/backends/mysql/operations.py