IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 10, 2015, 12:40:44 PM (11 years ago)
Author:
eugene
Message:

make code less forgiving: sql execute aborts on failures; deal with various hidden problems: add IF EXISTS to drop table operations to avoid raising unneeded error, make sure tables exist before trying to add indexes, test for existence of the stack _xsrc, _xfit, etc tables (and skip if missing); fix sqlLine.group to cast inputs to string before performing string ops; getKeyFloat now returns a float value which is safe with sqlLine.group, but can be used in a math expression; use python math. operators as needed (sqrt, fabs); fulltest.sh runs for camera, stack, object stages; update dvoSkyTable to use REGION_ID instead of special word INDEX; add existsClient method (avoid using mysql failure as a test for table existence); no need to test for exceptions to sql.execute since we abort on failure; replace esoteric SQL with dropTable calls; trap errors in stilts.treads in setupScratchdb; drop StackObjecThin and StackDetOffMeta along with other stack scratch tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/mysql.py

    r37917 r38837  
    230230    def dropTable(self, table):
    231231
    232         sql = "DROP TABLE " + table
     232        sql = "DROP TABLE IF EXISTS " + table
    233233        try: self.execute(sql)
    234234        except: return
     
    334334
    335335        stmt = self.con.createStatement()
    336         stmt.execute(sql)
     336
     337        try: stmt.execute(sql)
     338        except Exception, e:
     339            print "--- Error calling mysql: "
     340            print "--- sql: " + sql
     341            print "--- " + str(e)
     342            os._exit(2)
    337343        stmt.close()
    338344
Note: See TracChangeset for help on using the changeset viewer.