#34936: db_default with decimal.Decimal() crashes on SQLite.
-------------------------------------+-------------------------------------
               Reporter:  Mariusz    |          Owner:  nobody
  Felisiak                           |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |
               Severity:  Release    |       Keywords:
  blocker                            |
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 `db_default` with `decimal.Decimal()` crashes on SQLite. For example,
 adding the following field
 {{{#!python
 models.DecimalField(null=True, max_digits=5, decimal_places=2,
 db_default=Decimal("3.33")
 }}}
 generates:
 {{{#!sql
 ALTER TABLE "test_adfldd_pony" ADD COLUMN "height" decimal DEFAULT
 CAST('3.33' AS NUMERIC) NULL;
 }}}
 and crashes with:
 {{{
 django.db.utils.OperationalError: near "(": syntax error
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34936>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018b7fd39542-7d6c8f4c-ac5b-434c-b08a-a01bb218fcf7-000000%40eu-central-1.amazonses.com.

Reply via email to