Code

Opened 4 years ago

Closed 4 years ago

#12415 closed (duplicate)

wrong parsing of SQL comments in initial SQL data

Reported by: samlowry Owned by: nobody
Component: Core (Management commands) Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Function custom_sql_for_model in core/management/sql.py incorrectly cut SQL comments - without considering to a query context. For example, function cuts end of such query:

INSERT INTO `table` (`description`) VALUES ('Come play on our boat -- On the Water');

It's because of a very simple regexp at line 187:

statement = re.sub(ur"^--.*([\n\Z]|$)", "", statement)

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #3214.

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.