server/sources/native.py
changeset 10136 c33dcd18e0bb
parent 10125 bc6461a7d2da
parent 10076 3810332ef42c
child 10187 0df931eb08de
equal deleted inserted replaced
10135:52e011d08675 10136:c33dcd18e0bb
   709         """Execute a query.
   709         """Execute a query.
   710         it's a function just so that it shows up in profiling
   710         it's a function just so that it shows up in profiling
   711         """
   711         """
   712         cursor = cnx.cnxset.cu
   712         cursor = cnx.cnxset.cu
   713         if server.DEBUG & server.DBG_SQL:
   713         if server.DEBUG & server.DBG_SQL:
   714             cnx = cnx.cnxset.cnx
   714             print 'exec', query, args, cnx.cnxset.cnx
   715             # getattr to get the actual connection if cnx is a CnxLoggingWrapper
       
   716             # instance
       
   717             print 'exec', query, args, getattr(cnx, '_cnx', cnx)
       
   718         try:
   715         try:
   719             # str(query) to avoid error if it's a unicode string
   716             # str(query) to avoid error if it's a unicode string
   720             cursor.execute(str(query), args)
   717             cursor.execute(str(query), args)
   721         except Exception as ex:
   718         except Exception as ex:
   722             if self.repo.config.mode != 'test':
   719             if self.repo.config.mode != 'test':