Index: trunk/ippToPsps/jython/mysql.py
===================================================================
--- trunk/ippToPsps/jython/mysql.py	(revision 35417)
+++ trunk/ippToPsps/jython/mysql.py	(revision 37246)
@@ -83,4 +83,5 @@
     '''
     def lockTable(self, table):
+        # print "Locking table: " + table
         self.execute("LOCK TABLES " + table + " WRITE")
 
@@ -89,4 +90,5 @@
     '''
     def unlockTables(self):
+        # print "Unlocking tables"
         self.execute("UNLOCK TABLES")
 
@@ -109,4 +111,13 @@
             print "failed to kill connection: ", connectionID
 
+    def listTables(self):
+
+        sql = "show tables"
+        rs = self.executeQuery(sql)  
+        while (rs.next()):
+            tableName = rs.getString(1)
+            # print "table: " + tableName
+        rs.close()
+
     '''
     Checks whether this table exists
@@ -200,4 +211,13 @@
 
     '''
+    Add a column to the table
+    '''
+    def addColumn(self, table, column, type):
+
+        sql = "ALTER TABLE " + table + " ADD COLUMN " + column + " " + type
+        try: self.execute(sql)
+        except: return
+
+    '''
     Drops a list of tables
     '''
@@ -271,4 +291,23 @@
         except: pass
             #self.logger.warn("Index already in place on '" + column + "' for table '" + table + "'")
+
+    def addPrimaryKeyWithIgnore(self, table, column):
+        # note that in mysql versions later than 5.1, this fails
+        # unless the following is called first: 
+        # "set session old_alter_table=1"
+
+        # follow the command with 
+        # "set session old_alter_table=0"
+
+        # OF COURSE, this fails for mysql version <= 5.1...
+        if self.scratchDb.version > 5.1:
+            self.scratchDb.execute("set session old_alter_table=1")
+
+        # I should probably do this before the whole table is built, right?
+        sql = "ALTER IGNORE TABLE " + table + " ADD PRIMARY KEY (" + column + ")"
+        self.scratchDb.execute(sql)
+        
+        if self.scratchDb.version > 5.1:
+            self.scratchDb.execute("set session old_alter_table=0")
 
     '''
