1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed Oracle failure for "%" in table name

This commit is contained in:
Anssi Kääriäinen
2012-10-27 04:51:14 +03:00
parent 11699ac4b5
commit 2249bd275c
3 changed files with 19 additions and 4 deletions

View File

@@ -256,6 +256,10 @@ WHEN (new.%(col_name)s IS NULL)
if not name.startswith('"') and not name.endswith('"'):
name = '"%s"' % util.truncate_name(name.upper(),
self.max_name_length())
# Oracle puts the query text into a (query % args) construct, so % signs
# in names need to be escaped. The '%%' will be collapsed back to '%' at
# that stage so we aren't really making the name longer here.
name = name.replace('%','%%')
return name.upper()
def random_function_sql(self):