Changeset 10256 for mirror/edenwall
- Timestamp:
- 04/06/09 17:23:05 (16 months ago)
- svm:headrev:
c624a6cb-57d4-0310-9736-a25a8df6d016:18258- svk:copy_cache_prev:
- 10255
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
mirror/edenwall/nulog2/branches/2.0/scripts/ulog_rotate.py
r9332 r10256 109 109 110 110 def __table_exists(self, table): 111 try: 112 self.cursor.execute("""SHOW TABLES LIKE '%s'""" % table) 113 return self.cursor.fetchone()!=None 114 except _mysql_exceptions.ProgrammingError, e: 115 self.debug(e) 116 return False 111 117 118 def __table_creates(self, table, pattern): 112 119 try: 113 self.cursor.execute( 'select id from %s_1 limit 1' % self.ulog)120 self.cursor.execute("CREATE TABLE IF NOT EXISTS `%s` LIKE `%s`" % (table, pattern)) 114 121 return True 115 122 except _mysql_exceptions.ProgrammingError, e: … … 119 126 def daily_rotate(self, table, timestamp): 120 127 121 if not self.__table_exists(table ):128 if not self.__table_exists(table+"_1") and not self.__table_creates(table+"_1",table): 122 129 return 123 130 self.cursor.execute("""INSERT INTO %s_1
