Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2034 closed defect (fixed)

[patch] sqlinitialdata broken in mysql

Reported by: Joeboy Owned by: adrian
Component: Core (Other) Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I think [2985] broke sqlinitialdata in mysql. It seems to strip trailing semicolons, and hence errors out on hitting the next sql statement.

Attachments (2)

django.core.management.diff (527 bytes) - added by jpellerin@… 9 years ago.
Patch to exclude empty statements from sqlinitialdata
category.sql (200 bytes) - added by Joeboy 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by jpellerin@…

Patch to exclude empty statements from sqlinitialdata

comment:1 Changed 9 years ago by jpellerin@…

  • Summary changed from sqlinitialdata broken in mysql to [patch] sqlinitialdata broken in mysql

Mysql is failing when an initial data file has trailing whitespace after the last semicolon. Patch attached that removes empty statements from the list passed to output.extend().

comment:2 Changed 9 years ago by Joeboy

Thanks, but that doesn't seem to be it. I have a one-line sql file, and the trailing semicolon is the last character in it. I tried the patch in case I was missing something, but it doesn't fix the problem :-(

comment:3 Changed 9 years ago by jpellerin@…

Could you post the sql file (or a sanitized example suitable for public view) that's failing for you? I've tried with one-line and multiline files with trailing semicolons and not and I can't reproduce the error once the patch is applied.

Changed 9 years ago by Joeboy

comment:4 Changed 9 years ago by Joeboy

fwiw, file that errors out is attached

comment:5 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [3178]) Fixed #2119 -- fixed problems with splitting SQL statements into separate
statements. Uses a patch from eaw@… and some contributions from
jpellerin@…. Also fixes #2034 and #1935.

Note: See TracTickets for help on using tickets.
Back to Top