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
pull/3/head
Ashesh Vashi 2016-02-10 15:00:48 +05:30
parent b32496f71a
commit 639a3ed0ac
1 changed files with 2 additions and 2 deletions

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