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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user