Code

Opened 6 years ago

Closed 6 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: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 '--')

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by jefurii

  • Component changed from Uncategorized to Tools
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.