Opened 16 years ago

Closed 16 years ago

#6713 closed (wontfix)

';' in comments (i.e. lines starting with '--') in sql/mymodel.sql causes error in syncdb

Reported by: alainD Owned by: nobody
Component: Tools Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

for instance the following script :

INSERT INTO "app_model" ("col1", "col2") VALUES (45, 107);
--INSERT INTO "app_model" ("col1", "col2") VALUES (45, 107);
INSERT INTO "app_model" ("col1", "col2") VALUES (45, 107);

causes an error while importing it via syncdb ... because of the commented line (starting with '--')

Change History (1)

comment:1 by jefurii, 16 years ago

Component: UncategorizedTools
Resolution: wontfix
Status: newclosed

This is not a Django problem. If you're using MySQL it's actually a MySQL quirk:

In MySQL, the “-- ” (double-dash) comment style requires the second dash
to be followed by at least one whitespace or control character (such as
a space, tab, newline, and so on). This syntax differs slightly from 
standard SQL comment syntax
Note: See TracTickets for help on using tickets.
Back to Top