- Timestamp:
- Jul 31, 2014, 10:59:37 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140717/ippToPsps/jython/mysql.py
r37129 r37156 83 83 ''' 84 84 def lockTable(self, table): 85 print "Locking table: " + table 85 86 self.execute("LOCK TABLES " + table + " WRITE") 86 87 … … 89 90 ''' 90 91 def unlockTables(self): 92 print "Unlocking tables" 91 93 self.execute("UNLOCK TABLES") 92 94 … … 280 282 except: pass 281 283 #self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'") 284 285 def addPrimaryKeyWithIgnore(self, table, column) 286 # note that in mysql versions later than 5.1, this fails 287 # unless the following is called first: 288 # "set session old_alter_table=1" 289 290 # follow the command with 291 # "set session old_alter_table=0" 292 293 # OF COURSE, this fails for mysql version <= 5.1... 294 if self.scratchDb.version > 5.1: 295 self.scratchDb.execute("set session old_alter_table=1") 296 297 # I should probably do this before the whole table is built, right? 298 sql = "ALTER IGNORE TABLE " + table + " ADD PRIMARY KEY (" + column + ")" 299 self.scratchDb.execute(sql) 300 301 if self.scratchDb.version > 5.1: 302 self.scratchDb.execute("set session old_alter_table=0") 282 303 283 304 '''
Note:
See TracChangeset
for help on using the changeset viewer.
