Modify the SQL's string from double quote to single quote.
Using double quotes for strings does not conform to the ANSI standard. While MySQL accepts it, PostgreSQL raises an error. This patch fixes crash when used with PostgreSQL. Closes-Bug: #1606534 Change-Id: Id979043b1573bf2ea473e772c7ea7417c733d753
This commit is contained in:
parent
823f6d26a2
commit
6ba331aad2
@ -497,7 +497,7 @@ def find_node(**attributes):
|
||||
% (name, value))
|
||||
value_list = []
|
||||
for v in value:
|
||||
value_list.append('name="%s" AND value="%s"' % (name, v))
|
||||
value_list.append("name='%s' AND value='%s'" % (name, v))
|
||||
stmt = ('select distinct uuid from attributes where ' +
|
||||
' OR '.join(value_list))
|
||||
rows = (db.model_query(db.Attribute.uuid).from_statement(
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- Use only single quotes for strings inside SQL statements. Fixes a crash
|
||||
when PostgreSQL is used as a database backend.
|
Loading…
Reference in New Issue
Block a user