/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to classes/cache/cachedb.php

  • Committer: Suren A. Chilingaryan
  • Date: 2018-04-12 16:11:59 UTC
  • Revision ID: csa@suren.me-20180412161159-06pd3o04t2vciore
Provide additional info on failures to create caching tables

Show diffs side-by-side

added added

removed removed

Lines of Context:
975
975
 
976
976
        /*, `duration` INT, `complete` BOOL,*/
977
977
        if (!mysql_query("CREATE TABLE IF NOT EXISTS `$name` (`time` DATETIME PRIMARY KEY, `n` BIGINT, `missing` INT" .  $query . ") ENGINE = $ADEI_CACHE_ENGINE  COMPRESSION=\"$ADEI_CACHE_COMPRESSION\"", $this->dbh)) {
978
 
            throw new ADEIException(translate("Unable to create cache table, error") . ": " . mysql_error($this->dbh));
 
978
            throw new ADEIException(translate("Unable to create cache table (resolution: %s, items: 3 + 3 * %s), error: %s", $resolution, $items, mysql_error($this->dbh)));
979
979
        }
980
980
    } else {    
981
981
            // There is no way to create if not existing. So there is a lot of errors in log. Rarely changed, so moved to system.
994
994
        }
995
995
        
996
996
        if (!mysql_query("CREATE TABLE IF NOT EXISTS `$name` ($id, $time"  .  $query . "$index) ENGINE =  $ADEI_CACHE_ENGINE", $this->dbh)) {
997
 
            throw new ADEIException(translate("Unable to create cache table, error: %s [%s]", mysql_error($this->dbh), "CREATE TABLE IF NOT EXISTS `$name` ($time"  .  $query . ",$index)"));
 
997
            throw new ADEIException(translate("Unable to create cache table (resolution: 0, items: 2/4 + %s), error: %s [%s]", $items, mysql_error($this->dbh), "CREATE TABLE IF NOT EXISTS `$name` ($time"  .  $query . ",$index)"));
998
998
        }
999
999
    }
1000
1000
    if ($ADEI_DELAYED_KEYS) {