farcepest/MySQLdb1 — pull request #36 by gbandet (2013-11-04 15:38:08+00:00)
Title: Fix the conversion of list or tuple args to a SQL.

When making a query with an argument which is a one element list (or tuple) for an IN clause, the generated SQL is not valid and the query fails.

Examples:
* `c.execute("SELECT * from T WHERE id IN %s", [[1, 2, 3]])` --> `SELECT * from T WHERE id IN ('1', '2', '3')` **OK**
* `c.execute("SELECT * from T WHERE id IN %s", [[1]])` --> `SELECT * from T WHERE id IN ('1',)` **Fail**
* `c.execute("SELECT * from T WHERE id IN %(list)s", {'list': [1, 2, 3]})` --> `SELECT * from T WHERE id IN ('1', '2', '3')` **OK**
* `c.execute("SELECT * from T WHERE id IN %(list)s", {'list': [1]})` --> `SELECT * from T WHERE id IN ('1',)` **Fail**

In fact the list is converted as the string representation of a python tuple, with a final coma for one element tuples, and then breaks the SQL syntax.