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|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.