Permalink
Browse files

Duplicate percent signs in names in quote_name() so the names can be …

…used in statements
  • Loading branch information...
shaib committed Sep 25, 2012
1 parent f51eab7 commit e696437445f699ab32135f1c2e946320d04dba5f
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/backends/oracle/base.py
@@ -256,6 +256,10 @@ def quote_name(self, name):
if not name.startswith('"') and not name.endswith('"'):
name = '"%s"' % util.truncate_name(name.upper(),
self.max_name_length())
+ # This backend puts the query text into a (query % args) construct,
+ # so % signs in names need to be protected.
+ # Because of this, we are also not really making the name longer here.
+ name = name.replace('%','%%')
return name.upper()
def random_function_sql(self):

0 comments on commit e696437

Please sign in to comment.