# HG changeset patch # User Julien Cristau # Date 1410341672 -7200 # Node ID 3810332ef42c5ec69c75e41afa833890b7f30267 # Parent c53062c49d5309776236a5d69179adc531f54381 [server] fix 'cnx' variable confusion in DBG_SQL exception case The rollback handling expects 'cnx' to be the cubicweb Connection, but the DBG_SQL block was replacing it with an sql connection, leading to lulz down the line. Also remove obsolete getattr (the sqlite wrapping is now done at the cnxset level, so cnx.cnxset.cnx should be the right thing already). diff -r c53062c49d53 -r 3810332ef42c server/sources/native.py --- a/server/sources/native.py Sun Nov 30 21:24:36 2014 +0100 +++ b/server/sources/native.py Wed Sep 10 11:34:32 2014 +0200 @@ -699,10 +699,7 @@ """ cursor = cnx.cnxset.cu if server.DEBUG & server.DBG_SQL: - cnx = cnx.cnxset.cnx - # getattr to get the actual connection if cnx is a CnxLoggingWrapper - # instance - print 'exec', query, args, getattr(cnx, '_cnx', cnx) + print 'exec', query, args, cnx.cnxset.cnx try: # str(query) to avoid error if it's a unicode string cursor.execute(str(query), args)