From 7f293afe74e1ad42bfd142dcc8585247abf66b97 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 18 Feb 2013 15:18:53 +0100 Subject: [PATCH] Proper escaping for SQL identificators in Oracle (also, revert for 9b5f33560bad301b5a07a1ceee21ed83b077e229) --- lib/core/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index 8461ee0c5..53a2b5866 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2820,6 +2820,8 @@ def safeSQLIdentificatorNaming(name, isTable=False): retVal = "`%s`" % retVal.strip("`") elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2): retVal = "\"%s\"" % retVal.strip("\"") + elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,): + retVal = "\"%s\"" % retVal.strip("\"").upper() elif Backend.getIdentifiedDbms() in (DBMS.MSSQL,): retVal = "[%s]" % retVal.strip("[]") @@ -2838,8 +2840,10 @@ def unsafeSQLIdentificatorNaming(name): if isinstance(name, basestring): if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.ACCESS): retVal = name.replace("`", "") - elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.PGSQL, DBMS.DB2): + elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2): retVal = name.replace("\"", "") + elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,): + retVal = name.replace("\"", "").upper() elif Backend.getIdentifiedDbms() in (DBMS.MSSQL,): retVal = name.replace("[", "").replace("]", "")