diff options
author | robocoder <anthon.pang@gmail.com> | 2011-07-03 02:29:01 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2011-07-03 02:29:01 +0400 |
commit | 8d2efe9ad3fff6b850860aae572c508f6787bde3 (patch) | |
tree | 4a54f17659f41be24cdfa6d11e1a58d1ae44e919 /core | |
parent | 24eb9e31c64df784180ac32765e1e27b3f7b6cb7 (diff) |
refs #2512
git-svn-id: http://dev.piwik.org/svn/trunk@4968 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
-rw-r--r-- | core/TablePartitioning.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/TablePartitioning.php b/core/TablePartitioning.php index e9d07898c2..7712e82b3a 100644 --- a/core/TablePartitioning.php +++ b/core/TablePartitioning.php @@ -70,7 +70,7 @@ abstract class Piwik_TablePartitioning { if(is_null(self::$tablesAlreadyInstalled)) { - self::$tablesAlreadyInstalled = Piwik::getTablesInstalled(); + self::$tablesAlreadyInstalled = Piwik::getTablesInstalled($forceReload = false); } if(!in_array($this->generatedTableName, self::$tablesAlreadyInstalled)) @@ -81,7 +81,16 @@ abstract class Piwik_TablePartitioning $config = Zend_Registry::get('config'); $prefixTables = $config->database->tables_prefix; $sql = str_replace( $prefixTables . $this->tableName, $this->generatedTableName, $sql); - $db->query( $sql ); + try { + $db->query( $sql ); + } catch(Exception $e) { + // mysql error 1050: table already exists + if(! $db->isErrNo($e, '1050')) + { + // failed for some other reason + throw $e; + } + } self::$tablesAlreadyInstalled[] = $this->generatedTableName; } |