mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08:00
The quote function should return a string suitable for dropping into a
query string. This fixes a bug where bool types sometimes returned with a string that could not be dropped into a query.
This commit is contained in:
parent
84666801ed
commit
9ff872a272
@ -29,7 +29,7 @@ def _quote(d, t):
|
|||||||
|
|
||||||
if t == 'bool':
|
if t == 'bool':
|
||||||
# Can't run upper() on these
|
# Can't run upper() on these
|
||||||
if d in (0, 1): return ('f', 't')[d]
|
if d in (0, 1): return ("'f'", "'t'")[d]
|
||||||
|
|
||||||
if string.upper(d) in ['T', 'TRUE', 'Y', 'YES', '1', 'ON']:
|
if string.upper(d) in ['T', 'TRUE', 'Y', 'YES', '1', 'ON']:
|
||||||
return "'t'"
|
return "'t'"
|
||||||
|
Loading…
Reference in New Issue
Block a user