Edgewall Software

Changes between Initial Version and Version 1 of Ticket #11571, comment 4


Ignore:
Timestamp:
Apr 4, 2014, 8:11:53 AM (10 years ago)
Author:
Jun Omae

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11571, comment 4

    initial v1  
    22
    33Reproduced with the following cases.
    4  - PostgreSQL and SQLite: `SELECT 1 AS "%s", $USER`
    5  - MySQL: {{{SELECT 1 AS `%s`, $USER}}}
     4 - PostgreSQL: `SELECT 1 AS "%s", $USER`
     5 - SQLite and MySQL: {{{SELECT 1 AS `%s`, $USER}}}
    66
    77The percent sign in quoted identifier and dynamic variables in query lead the issue. Unfortunately, Trac doesn't log the error while executing report.
     
    1010 - SQLite:
    1111{{{
    12 2014-04-04 13:08:48,947 Trac[report] WARNING: Exception caught while executing report for count: SELECT COUNT(*) FROM (
    13 SELECT 1 AS "%s", %s
    14 ) AS tab, args [u'jun66j5']
     122014-04-04 13:08:48,947 Trac[report] WARNING: Exception caught while executing report: u'SELECT 1 AS `%s`, $USER', args {'USER': u'jun66j5'}
    1513Traceback (most recent call last):
    16   File "/home/jun66j5/src/trac/edgewall/git/trac/ticket/report.py", line 683, in execute_paginated_report
     14  File "/home/jun66j5/src/trac/edgewall/git/trac/ticket/report.py", line 384, in _render_view
     15    offset)
     16  File "/home/jun66j5/src/trac/edgewall/git/trac/ticket/report.py", line 629, in execute_paginated_report
    1717    cursor.execute(count_sql, args)
    18   File "/home/jun66j5/src/trac/edgewall/git/trac/db/util.py", line 65, in execute
    19     return self.cursor.execute(sql_escape_percent(sql), args)
     18  File "/home/jun66j5/src/trac/edgewall/git/trac/db/util.py", line 54, in execute
     19    r = self.cursor.execute(sql_escape_percent(sql), args)
    2020  File "/home/jun66j5/src/trac/edgewall/git/trac/db/sqlite_backend.py", line 78, in execute
    2121    result = PyFormatCursor.execute(self, *args)