Opened 6 years ago

Closed 6 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.

Change History (2)

comment:1 Changed 6 years ago by pandres

Owner: changed from nobody to pandres

comment:2 Changed 6 years ago by pandres

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top