item = self.rowproxy[index]
if isinstance(item, _array):
item = item.tostring()
+ # Py2K
if self.charset and isinstance(item, str):
+ # end Py2K
+ # Py3K
+ #if self.charset and isinstance(item, bytes):
return item.decode(self.charset)
else:
return item
item = getattr(self.rowproxy, attr)
if isinstance(item, _array):
item = item.tostring()
+ # Py2K
if self.charset and isinstance(item, str):
+ # end Py2K
+ # Py3K
+ #if self.charset and isinstance(item, bytes):
return item.decode(self.charset)
else:
return item
class MySQL_mysqlconnector(MySQLDialect):
driver = 'mysqlconnector'
- supports_unicode_statements = False
+ supports_unicode_statements = True
supports_unicode_binds = True
- supports_sane_rowcount = False
+ supports_sane_rowcount = True
supports_sane_multi_rowcount = True
- description_encoding = None
default_paramstyle = 'format'
execution_ctx_cls = MySQL_mysqlconnectorExecutionContext
(7, 'sally')]
conn.execute("delete from users")
- @testing.fails_on_everything_except('mysql+mysqldb', 'postgresql')
+ @testing.fails_on_everything_except('mysql+mysqldb', 'mysql+mysqlconnector', 'postgresql')
@testing.fails_on('postgresql+zxjdbc', 'sprintf not supported')
# some psycopg2 versions bomb this.
def test_raw_sprintf(self):
# pyformat is supported for mysql, but skipping because a few driver
# versions have a bug that bombs out on this test. (1.2.2b3, 1.2.2c1, 1.2.2)
@testing.skip_if(lambda: testing.against('mysql+mysqldb'), 'db-api flaky')
- @testing.fails_on_everything_except('postgresql+psycopg2', 'postgresql+pypostgresql')
+ @testing.fails_on_everything_except('postgresql+psycopg2', 'postgresql+pypostgresql', 'mysql+mysqlconnector')
def test_raw_python(self):
for conn in (testing.db, testing.db.connect()):
conn.execute("insert into users (user_id, user_name) values (%(id)s, %(name)s)",
self._test_onetomany(True)
# PG etc. need passive=True to allow PK->PK cascade
- @testing.fails_on_everything_except('sqlite')
+ @testing.fails_on_everything_except('sqlite', 'mysql+mysqlconnector')
def test_onetomany_nonpassive(self):
self._test_onetomany(False)
self._test_pk(True)
# PG etc. need passive=True to allow PK->PK cascade
- @testing.fails_on_everything_except('sqlite')
+ @testing.fails_on_everything_except('sqlite', 'mysql+mysqlconnector')
def test_pk_nonpassive(self):
self._test_pk(False)
self._test_fk(True)
# PG etc. need passive=True to allow PK->PK cascade
- @testing.fails_on_everything_except('sqlite')
+ @testing.fails_on_everything_except('sqlite', 'mysql+mysqlconnector')
def test_fk_nonpassive(self):
self._test_fk(False)
-
\ No newline at end of file
+