Skip to content

Commit

Permalink
fix another IN issue
Browse files Browse the repository at this point in the history
  • Loading branch information
josuebrunel committed Jun 7, 2015
1 parent afde5db commit 90ecf7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion myql/myql.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def clauseFormatter(self, cond):
'''Formats conditions
args is a list of ['column', 'operator', 'value']
'''

if cond[1].lower() == 'in':
if len(cond[2]) > 1:
cond[2] = "('{0}')".format(','.join(map(str,[ "{0}".format(e) for e in cond[2] ])))
cond[2] = "({0})".format(','.join(map(str,[ "'{0}'".format(e) for e in cond[2] ])))
else:
cond[2] = "({0})".format(','.join(map(str,[ "{0}".format(e) for e in cond[2] ])))

cond = " ".join(cond)
else:
cond[2] = "'{0}'".format(cond[2])
Expand Down

0 comments on commit 90ecf7e

Please sign in to comment.