#28875: SQL: Creation of Index fails with '/' in app_label
-------------------------------------+-------------------------------------
     Reporter:  Jens L.              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Jens L.:

Old description:

> Django 2's creation of SQLite indicies doesn't escape the index name,
> which causes issues when you use for example '/' in your app_labels.
>
> Offending file is db/backends/sqlite3/schema.py , line 18.
>
> If said line is swapped with this:
>

> {{{
>     sql_create_unique = "CREATE UNIQUE INDEX \"%(name)s\" ON %(table)s
> (%(columns)s)"
> }}}
>
> creation of indices works fine.

New description:

 Django 2's creation of SQLite indicies doesn't escape the index name,
 which causes issues when you use for example '/' in your app_labels.

 Offending file is db/backends/sqlite3/schema.py , line 18.

 If said line is swapped with this:


 {{{
     sql_create_unique = "CREATE UNIQUE INDEX \"%(name)s\" ON %(table)s
 (%(columns)s)"
 }}}

 creation of indices works fine.


 Update: This also happens on MySQL (tested on Python 3.5.3, Django 2.0,
 PyMySQL 0.7.11

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28875#comment:1>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.46af61e130feccb5b96986278efa6bc0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to