Code

Opened 6 years ago

Closed 6 years ago

#8461 closed (wontfix)

manage.py reset crashes running initial SQL if there's a #comment on the same line as valid SQL

Reported by: niccl Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

manage.py reset can run initial SQL. If this SQL has valid SQL at the start, followed by a # comment, then it will fail with
_mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now")

It fails because the regex in sql.py doesn't check for '# comment' when parsing the SQL file. '# comment' is valid in (at least) MySQL.

Attachments (1)

sql_py.diff (666 bytes) - added by niccl 6 years ago.

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by niccl

comment:1 Changed 6 years ago by niccl

  • Component changed from django-admin.py runserver to django-admin.py
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Doh. finger trouble selecting component

comment:2 Changed 6 years ago by toke

  • Resolution set to wontfix
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Someday/Maybe

The only types of supported comments for all databases (sqlite,MySQL and PostgreSQL) are:

-- for single line comments
/* … */ for multiline comments

These two are standard compliant

# is a MySQL only extension

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.