quora/mysql-ctypes — Issue #13: InternalError: No decoder for type 6710628, value: latin1
Author: meermanr
Created: 2012-02-02 20:20:15+00:00
State: open

When I try to use mysql-ctypes (both quora/mysql-ctypes@32d79b05c2394875ed9dec45eac69ede3bc45384 and EnTeQaAk/mysql-ctypes@4d5c61c76c34b604e80834851ce34efe0b02af84) I get the following error:

```Python 2.6.5 (r265:79063, Aug 31 2010, 14:04:38)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>> sConn = MySQLdb.connect(host="hostname", user="username", passwd="password", db="schema", port=3306)
>>> sCur = sConn.cursor()
>>> sCur.execute("SHOW VARIABLES LIKE 'character_set%%'")
>>> sCur.fetchall()
Traceback (most recent call last):
File "", line 1, in
File "/home/robmee01/.local/lib/python2.6/site-packages/MySQLdb/cursors.py", line 148, in fetchall
return self._result.fetchall()
File "/home/robmee01/.local/lib/python2.6/site-packages/MySQLdb/cursors.py", line 286, in fetchall
self.flush()
File "/home/robmee01/.local/lib/python2.6/site-packages/MySQLdb/cursors.py", line 278, in flush
row = self._get_row()
File "/home/robmee01/.local/lib/python2.6/site-packages/MySQLdb/cursors.py", line 241, in _get_row
" type %s, value: %s" % (self.description[i][1], val)
InternalError: No decoder for type 6710628, value: latin1
>>>```

The same query run in the MySQL client proper returns the following:

```mysql> SHOW VARIABLES LIKE 'character_set%%';
+--------------------------+--------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /apps/mysql/product/mysql-5.1.59/share/charsets/ |
+--------------------------+--------------------------------------------------+
8 rows in set (0.01 sec)```

Since SQL Alchemy (v0.7.2) does this automatically everytime it connects to my MySQL server this is preventing me from using mysql-ctypes, and I so wanted to migrate to Pypy + mysql-ctypes!

My MySQL server version is: 5.1.59-log (and my client version is 14.14 Distrib 5.1.50, so I presume my libmysqlclient.so is too).