From 90ecf7ec5783e1558ddb18c1959c2806a867bc0a Mon Sep 17 00:00:00 2001 From: josuebrunel Date: Sun, 7 Jun 2015 15:08:47 +0200 Subject: [PATCH] fix another IN issue --- myql/myql.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/myql/myql.py b/myql/myql.py index 4185f7e..f6e60e0 100755 --- a/myql/myql.py +++ b/myql/myql.py @@ -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])