You may need to upgrade the modules used in this program. When running your program with the latest module versions, I do not get the error message described above.
As for your second question, I'm not sure I understand what you are trying to do with that SQL statement:
SELECT * FROM table WHERE value = (SELECT * FROM table2 WHERE value2 = ?)
As far as I know, it is not valid SQL syntax to have
field = (LIST). You probably want
field IN (LIST).
In addition, you probably should only be selecting a single column in your subquery:
SELECT * FROM table WHERE value = (SELECT value2 FROM table2 WHERE value2 = ?)
If the statement above matches your intent, perhaps you need a join rather than a subquery:
SELECT * FROM table t, table2 t2 WHERE t.value = t2.value
If you can explain the desired effect of your SQL statement, I may be able to offer some other suggestions.