Code

Opened 4 years ago

Closed 4 years ago

#14613 closed (invalid)

sql custom bug

Reported by: rilldo Owned by: pandres
Component: Core (Other) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

1, following sql faild, because django refuse '---' string.
INSERT INTO priority (value, isactive) VALUES ('---', 500);

the '---' string is default string for many database table. so I think this is a bug.

2, try to fix:
code file: django/core/management/sql.py
169 line: statement = re.sub(ur"--.*([\n\Z]|$)", "", statement)
modify to:
statement = re.sub(ur"\.*([\n\Z]|$)", "", statement)

hope django can accept this fix.

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by pandres

  • Owner changed from nobody to pandres

comment:2 Changed 4 years ago by pandres

  • Resolution set to invalid
  • Status changed from new to closed

I don't see your django code. I've tried creating objects with the '---' string in some fields and worked fine.

The line you point shouldn't be changed, '--' is an escape sequence in most db engines.

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.