diff options
author | André Malo <ndparker@users.sf.net> | 2012-10-03 13:20:19 -0400 |
---|---|---|
committer | farcepest <farcepest@gmail.com> | 2012-10-03 13:20:19 -0400 |
commit | cd44524fef63bd3fcb71947392326e9742d520e8 (patch) | |
tree | 946926150c129304546567fc343ab0e78620f57f /MySQLdb | |
parent | c05a2c6a50bb57655165cf95279d5501226ce369 (diff) | |
download | mysqldb1-cd44524fef63bd3fcb71947392326e9742d520e8.tar.gz |
Patch 4/4: Fix TEXT vs. BLOB conversion.
This patch assumes an applied patch 3 (https://sourceforge.net/p/mysql-python/patches/79/). Looks a bit like a hack, but the infrastructure doesn't seem to allow anything else. And it works here very well. I'm not sure, how it works with very old mysql versions (<= 4.0).
https://sourceforge.net/p/mysql-python/patches/80/
Diffstat (limited to 'MySQLdb')
-rw-r--r-- | MySQLdb/_mysql.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index b222663..b721a66 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -471,13 +471,17 @@ _mysql_ResultObject_Initialize( return -1; } if (PyTuple_Check(t) && PyTuple_GET_SIZE(t) == 2) { - long mask; + long mask, flags; PyObject *pmask=NULL; pmask = PyTuple_GET_ITEM(t, 0); fun2 = PyTuple_GET_ITEM(t, 1); if (PyInt_Check(pmask)) { mask = PyInt_AS_LONG(pmask); - if (mask & fields[i].flags) { + flags = fields[i].flags; + if (fields[i].charsetnr != 63) { /* maaagic */ + flags &= ~BINARY_FLAG; + } + if (mask & flags) { Py_DECREF(t); break; } |