Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2034 closed defect (fixed)

[patch] sqlinitialdata broken in mysql

Reported by: Joeboy Owned by: Adrian Holovaty
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@… 10 years ago.
Patch to exclude empty statements from sqlinitialdata
category.sql (200 bytes) - added by Joeboy 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by jpellerin@…

Attachment: django.core.management.diff added

Patch to exclude empty statements from sqlinitialdata

comment:1 Changed 10 years ago by jpellerin@…

Summary: sqlinitialdata broken in mysql[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 10 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 10 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 10 years ago by Joeboy

Attachment: category.sql added

comment:4 Changed 10 years ago by Joeboy

fwiw, file that errors out is attached

comment:5 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(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