1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #2161 -- handle trailing newlines in initial SQL data. Includes

regression test. Thanks to russellm.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3177 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2006-06-20 07:12:45 +00:00
parent a513fcb455
commit 3e97535907
5 changed files with 28 additions and 4 deletions

View File

@@ -334,8 +334,9 @@ def get_sql_initial_data_for_model(model):
# Some backends can't execute more than one SQL statement at a time,
# so split into separate statements.
sql_expr = re.compile(
r"""( # each statement is...
(?: # one or more chunks of ...
r"""( # each statement ...
[^\r\n;] # starts with something other than a line ending or ';'
(?: # then has one or more chunks of ...
(?:[^;'"]+) # not the end of a statement or start of a quote
| (?:'[^']*') # something in single quotes
| (?:"[^"]*") # something in double quotes