server/sources/native.py
changeset 10076 3810332ef42c
parent 10061 ecbfec2da8a2
child 10136 c33dcd18e0bb
child 10178 4b33246cb43c
equal deleted inserted replaced
10073:c53062c49d53 10076:3810332ef42c
   697         """Execute a query.
   697         """Execute a query.
   698         it's a function just so that it shows up in profiling
   698         it's a function just so that it shows up in profiling
   699         """
   699         """
   700         cursor = cnx.cnxset.cu
   700         cursor = cnx.cnxset.cu
   701         if server.DEBUG & server.DBG_SQL:
   701         if server.DEBUG & server.DBG_SQL:
   702             cnx = cnx.cnxset.cnx
   702             print 'exec', query, args, cnx.cnxset.cnx
   703             # getattr to get the actual connection if cnx is a CnxLoggingWrapper
       
   704             # instance
       
   705             print 'exec', query, args, getattr(cnx, '_cnx', cnx)
       
   706         try:
   703         try:
   707             # str(query) to avoid error if it's a unicode string
   704             # str(query) to avoid error if it's a unicode string
   708             cursor.execute(str(query), args)
   705             cursor.execute(str(query), args)
   709         except Exception as ex:
   706         except Exception as ex:
   710             if self.repo.config.mode != 'test':
   707             if self.repo.config.mode != 'test':