[Sqlalchemy-tickets] Issue #3101: mysql dialect is_disconnect incorrectly classifies COMMANDS_OUT_O
Brought to you by:
zzzeek
|
From: novas0x2a <iss...@bi...> - 2014-06-26 20:55:53
|
New issue 3101: mysql dialect is_disconnect incorrectly classifies COMMANDS_OUT_OF_SYNC https://bitbucket.org/zzzeek/sqlalchemy/issue/3101/mysql-dialect-is_disconnect-incorrectly novas0x2a: In 0.9.7 (and going back to at least 0.7, I think) [mysql/base's is_disconnect]( https://bitbucket.org/zzzeek/sqlalchemy/src/f2cf62090c4f9812bf4a57a9f68172b1b2eafd6c/lib/sqlalchemy/dialects/mysql/base.py?at=master#cl-2227) catches OperationalError and, if the error is on the whitelist, reports it as a disconnect. One of the items on the list, error 2014 (COMMANDS_OUT_OF_SYNC), is actually a ProgrammingError, not an OperationalError (See [mysqldb source](https://github.com/farcepest/MySQLdb1/blob/master/_mysql.c#L161) and [constants list](https://github.com/farcepest/MySQLdb1/blob/63ab17980da8b31ca02ad31236420ed57006e315/MySQLdb/constants/CR.py#L3)). One potential easy fix is attached. |