Fixes the qtIdent function in the psycopg2 driver about not taking care

of double quote within it.

The 'replace' function of immutable type string do create a new
instance of type string, which needed to be reassgined to the variable
'value'.

Reported By: Murtuza Zabuawala
This commit is contained in:
Ashesh Vashi 2016-02-10 15:00:48 +05:30
parent b32496f71a
commit 639a3ed0ac

View File

@ -894,7 +894,7 @@ class Driver(BaseDriver):
value = val
if (Driver.needsQuoting(val, True)):
value.replace("\"", "\"\"")
value = value.replace("\"", "\"\"")
value = "\"" + value + "\""
res = ((res and res + '.') or '') + value
@ -918,7 +918,7 @@ class Driver(BaseDriver):
value = val
if (Driver.needsQuoting(val, False)):
value.replace("\"", "\"\"")
value = value.replace("\"", "\"\"")
value = "\"" + value + "\""
res = ((res and res + '.') or '') + value