summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2012-10-27 04:51:14 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2012-10-27 05:26:42 +0300
commit2249bd275cbae6b73716bf36f5f36def1bb4222e (patch)
treead7cbdbfefc680c2dcf9fa1641cfbae5f3351ffc /django
parent11699ac4b5f98ec11dba02b356a8fd4ab6b4b889 (diff)
Fixed Oracle failure for "%" in table name
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/oracle/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index 6bf2e815a7..aad52992dd 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -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):