MySQLdb 1.2.1 assumes that queries will be unicode
objects rather than string objects. The attached patch
aims to do the right thing. The assumption about alwasy
encoding using the charset specified in the mysql URI
is somewhat questionable, and it may be better to try
and infer self.encoding from the locale instead.