From db853306c40437a8ad3dc9f510865820a941c3b5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 22 Mar 2015 19:05:22 -0400 Subject: - Fixed unicode support for PyMySQL when using an "executemany" operation with unicode parameters. SQLAlchemy now passes both the statement as well as the bound parameters as unicode objects, as PyMySQL generally uses string interpolation internally to produce the final statement, and in the case of executemany does the "encode" step only on the final statement. fixes #3337 --- lib/sqlalchemy/dialects/mysql/pymysql.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py') diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index 92aaf89af..87159b561 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -37,7 +37,12 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): driver = 'pymysql' description_encoding = None + + # generally, these two values should be both True + # or both False. PyMySQL unicode tests pass all the way back + # to 0.4 either way. See [ticket:3337] supports_unicode_statements = True + supports_unicode_binds = True @classmethod def dbapi(cls): -- cgit v1.2.1