#30593: Add support for check constraints on MariaDB 10.2+.
-------------------------------------+-------------------------------------
     Reporter:  Mariusz Felisiak     |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  MariaDB,             |             Triage Stage:  Accepted
  constraint, check                  |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"ffff17d4b0117cce59f65c9f56fa164694eafd23" ffff17d4]:
 {{{
 #!CommitTicketReference repository=""
 revision="ffff17d4b0117cce59f65c9f56fa164694eafd23"
 Fixed #34553 -- Fixed improper % escaping of literal in constraints.

 Proper escaping of % in string literals used when defining constaints
 was attempted (a8b3f96f6) by overriding quote_value of Postgres and
 Oracle schema editor. The same approach was used when adding support for
 constraints to the MySQL/MariaDB backend (1fc2c70).

 Later on it was discovered that this approach was not appropriate and
 that a preferable one was to pass params=None when executing the
 constraint creation DDL to avoid any form of interpolation in the first
 place (42e8cf47).

 When the second patch was applied the corrective of the first were not
 removed which caused % literals to be unnecessary doubled. This flew
 under the radar because the existings test were crafted in a way that
 consecutive %% didn't catch regressions.

 This commit introduces an extra test for __exact lookups which
 highlights more adequately % doubling problems but also adjust a
 previous __endswith test to cover % doubling problems (%\% -> %%\%%).

 Thanks Thomas Kolar for the report.

 Refs #32369, #30408, #30593.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30593#comment:5>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018806ae55db-0c256423-f7dc-44de-93e1-2cea96a5b19f-000000%40eu-central-1.amazonses.com.

Reply via email to