equal
deleted
inserted
replaced
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': |