#22401: SQL Function initial SQL data does not work.
-------------------------------------+-------------------------------------
     Reporter:  pouete               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by timo):

 * status:  closed => new
 * severity:  Normal => Release blocker
 * needs_better_patch:  1 => 0
 * version:  1.6 => master
 * has_patch:  1 => 0
 * resolution:  fixed =>


Comment:

 There's a regression here because `sqlparse` does not strip trailing
 comments the way the regex does (see #4680 for when this behavior was
 added). `tests/initial_sql_regress/sql/simple.sql` contains a trailing
 comment on line 2 and this causes MySQL to error out with "Commands out of
 sync; you can't run this command now". Jenkins doesn't have `sqlparse`
 installed, so it's still using the regex logic.

 You can reproduce this behavior with the following code:
 {{{
 >>> from django.db import connection
 >>> cursor = connection.cursor()
 >>> cursor.execute("SELECT 1; --")
 >>> cursor.execute("SELECT 2;")
 Traceback ...
 django.db.utils.ProgrammingError: (2014, "Commands out of sync; you can't
 run this command now")
 }}}

 I've realized that initial SQL data is deprecated (pending confirmation
 from Andrew Godwin in #22444) so I'm inclined just to revert this and mark
 it "won't fix".

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22401#comment:7>
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.f9aa3038fbe6e3762859e15cea5cc895%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to