1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #4680 -- Improved initial_sql parsing

In particular, allow the '--' sequence to be present in string
values without being interpreted as comment marker.
Thanks Tim Chase for the report and shaleh for the initial patch.
This commit is contained in:
Claude Paroz
2012-07-21 14:24:29 +02:00
parent 32a4df6c55
commit 423244bc6b
3 changed files with 39 additions and 16 deletions

View File

@@ -1,8 +1,10 @@
INSERT INTO initial_sql_regress_simple (name) VALUES ('John');
-- a comment
INSERT INTO initial_sql_regress_simple (name) VALUES ('John'); -- another comment
INSERT INTO initial_sql_regress_simple (name) VALUES ('-- Comment Man');
INSERT INTO initial_sql_regress_simple (name) VALUES ('Paul');
INSERT INTO initial_sql_regress_simple (name) VALUES ('Ringo');
INSERT INTO initial_sql_regress_simple (name) VALUES ('George');
INSERT INTO initial_sql_regress_simple (name) VALUES ('Miles O''Brien');
INSERT INTO initial_sql_regress_simple (name) VALUES ('Semicolon;Man');
INSERT INTO initial_sql_regress_simple (name) VALUES ('This line has a Windows line ending');
INSERT INTO initial_sql_regress_simple (name) VALUES ('This line has a Windows line ending');