Changes between Initial Version and Version 1 of Ticket #33602


Ignore:
Timestamp:
Mar 26, 2022, 10:47:35 AM (2 years ago)
Author:
Tim Graham
Comment:

This might be a bug in mysql-connector-python and/or mysql.connector.django which aren't part of Django itself.

What does "the format ... is not right" mean? What's the error?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33602

    • Property Component contrib.adminDatabase layer (models, ORM)
    • Property Resolutionneedsinfo
    • Property Status newclosed
    • Property Type UncategorizedBug
  • Ticket #33602 – Description

    initial v1  
    11\site-packages\django\db\backends\mysql\operations.py  line 58
    2  
     2 {{{
    33def date_trunc_sql(self, lookup_type, field_name, tzname=None):
    44        field_name = self._convert_field_to_tz(field_name, tzname)
     
    88        }  # Use double percents to escape.
    99
    10 
    11 the problem is here. 
     10}}}
     11the problem is here.
     12{{{
    1213   'year': '%%Y-01-01',
    1314            'month': '%%Y-%%m-01',
     15}}}
    1416
     17this will generate the SQL.   
    1518
    16 this will generate the sql.   
     19{{{
    1720SELECT DISTINCT CAST(DATE_FORMAT([table name], '%%Y-01-01') AS DATE) AS `datefield
     21}}}
    1822
     23the format `''%%Y-01-01''`  is not right for mysql.
    1924
    20 the format ''%%Y-01-01''  is not right for mysql.
    21 
Back to Top