Opened 4 years ago

Closed 4 years ago

#15155 closed (duplicate)

Invalid regular expression for escaping %s substitutions in sqlite backend of django 1.2.4

Reported by: zyga Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The actual bug was discovered by zyga and fixed by apollo13 during an IRC session on #django

The issue can be reproduced by this code. Note the code sample below is using _fixed_ sqlite3 backend.

>>> from django.db import connection
>>> cursor = connection.cursor()
>>> list(cursor.execute("select strftime('%%s', date('now'))"))
[(u'1295827200',)]

The bug is caused by invalid regular expression in FORMAT_QMARK_REGEX.
I will follow-up with a patch and a test case

Attachments (1)

fix-15155.patch (1.4 KB) - added by zyga 4 years ago.
Patch + test case

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by zyga

Patch + test case

comment:1 Changed 4 years ago by apollo13

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by ramiro

Duplicate of #13648.

comment:3 Changed 4 years ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top