Changeset 56801 in vbox for trunk/src/VBox/ValidationKit/testmanager
- Timestamp:
- Jul 3, 2015 11:10:57 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101451
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/core/db.py
r56295 r56801 119 119 """ See TMDatabaseConnection.callProc()""" 120 120 return self._oDb.callProcInternal(self._oCursor, sProcedure, aoArgs, utils.getCallerName()); 121 122 def insertList(self, sInsertSql, aoList, fnEntryFmt): 123 """ See TMDatabaseConnection.insertList. """ 124 return self._oDb.insertListInternal(self._oCursor, sInsertSql, aoList, fnEntryFmt, utils.getCallerName()); 121 125 122 126 def fetchOne(self): … … 384 388 return oRc; 385 389 390 def insertListInternal(self, oCursor, sInsertSql, aoList, fnEntryFmt, sCallerName): 391 """ 392 Optimizes the insertion of a list of values. 393 """ 394 oRc = None; 395 asValues = []; 396 for aoEntry in aoList: 397 asValues.append(fnEntryFmt(aoEntry)); 398 if len(asValues) > 256: 399 oRc = self.executeInternal(oCursor, sInsertSql + 'VALUES' + ', '.join(asValues), None, sCallerName); 400 asValues = []; 401 if len(asValues) > 0: 402 oRc = self.executeInternal(oCursor, sInsertSql + 'VALUES' + ', '.join(asValues), None, sCallerName); 403 return oRc 404 386 405 def _fetchOne(self, oCursor): 387 406 """Wrapper around Psycopg2.cursor.fetchone.""" … … 425 444 """ 426 445 return self.callProcInternal(self._oCursor, sProcedure, aoArgs, utils.getCallerName()); 446 447 def insertList(self, sInsertSql, aoList, fnEntryFmt): 448 """ 449 Optimizes the insertion of a list of values. 450 """ 451 return self.insertListInternal(self._oCursor, sInsertSql, aoList, fnEntryFmt, utils.getCallerName()); 427 452 428 453 def fetchOne(self): … … 629 654 return True; 630 655 656 def debugDisableExplain(self): 657 """ Disables explain. """ 658 self._oExplainCursor = None; 659 self._oExplainConn = None 660 return True; 661 662 def debugIsExplainEnabled(self): 663 """ Check if explaining of SQL statements is enabled. """ 664 return self._oExplainConn is not None; 665
Note:
See TracChangeset
for help on using the changeset viewer.