[Erp5-report] r34689 jerome - /erp5/trunk/products/ZMySQLDA/db.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 20 18:20:12 CEST 2010


Author: jerome
Date: Tue Apr 20 18:20:09 2010
New Revision: 34689

URL: http://svn.erp5.org?rev=34689&view=rev
Log:
use constants for MySQLdb rather than 1064

Modified:
    erp5/trunk/products/ZMySQLDA/db.py

Modified: erp5/trunk/products/ZMySQLDA/db.py
URL: http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/db.py?rev=34689&r1=34688&r2=34689&view=diff
==============================================================================
--- erp5/trunk/products/ZMySQLDA/db.py [utf8] (original)
+++ erp5/trunk/products/ZMySQLDA/db.py [utf8] Tue Apr 20 18:20:09 2010
@@ -406,8 +406,8 @@
             self.db.query(query)
         except ProgrammingError, exception:
           LOG('ZMySQLDA', ERROR, 'query failed: %s' % (query,))
-          if exception[0] == 1064:
-            # 1064 = You have an error in your SQL syntax
+          if exception[0] == ER.PARSE_ERROR:
+            # You have an error in your SQL syntax
             # Replace MySQL brain dead error message with a more meaningful
             # one. (MySQL only reports the SQL query *from* the error place,
             # which strips important contextual information).




More information about the Erp5-report mailing list