Django

Code

Ticket #2161 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[Patch] Trailing blank lines in inital data SQL file break syncdb

Reported by: russellm Assigned to: adrian
Milestone: Component: django-admin.py
Version: Keywords: management blank newline
Cc: freakboy@iinet.net.au Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

If the initial data SQL file for a model has trailing \n's, the sql regex in management.py's get_sql_initial_data_for_model() identifies the trailing \n's as a statement. When syncdb runs this statement (on Postgres - don't know if it affects other databases), it reports a "Failed to install initial SQL" error.

Attachments

blanklines.diff (0.7 kB) - added by russellm on 06/14/06 23:12:27.
Fixed regex to eliminate blank lines from initial SQL

Change History

06/14/06 22:16:10 changed by russellm

  • component changed from Core framework to django-admin.py.
  • summary changed from Trailing blank lines in inital data SQL file break syncdb to [Patch] Trailing blank lines in inital data SQL file break syncdb.

Added patch to exclude blank lines from initial data SQL statements.

06/14/06 23:12:27 changed by russellm

  • attachment blanklines.diff added.

Fixed regex to eliminate blank lines from initial SQL

06/20/06 02:12:45 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [3177]) Fixed #2161 -- handle trailing newlines in initial SQL data. Includes regression test. Thanks to russellm.


Add/Change #2161 ([Patch] Trailing blank lines in inital data SQL file break syncdb)




Change Properties
Action