/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-10-11 10:40:12 UTC
  • Revision ID: csa@dside.dyndns.org-20181011104012-q3pdyix39wogfiin
Don't use COMPRESSION parameter if compression is turned off (this is required to support older versions of MySQL without compression support)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1082
1082
 
1083
1083
    $name = $this->GetTableName($resolution, $postfix);
1084
1084
    
 
1085
    if (strcasecmp($ADEI_CACHE_COMPRESSION, "None"))
 
1086
        $compression="COMPRESSION=\"$ADEI_CACHE_COMPRESSION\"";
 
1087
    else
 
1088
        $compression="";
 
1089
 
1085
1090
    if ($resolution > 0) {
1086
1091
        for ($i = 0; $i < $items; $i++)
1087
1092
            $query .= ", `min" . $i . "` DOUBLE, `max" . $i . "` DOUBLE, `mean" . $i . "` DOUBLE";
1088
1093
 
1089
1094
        /*, `duration` INT, `complete` BOOL,*/
1090
 
        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)) {
 
1095
        if (!mysql_query("CREATE TABLE IF NOT EXISTS `$name` (`time` DATETIME PRIMARY KEY, `n` BIGINT, `missing` INT" .  $query . ") ENGINE = $ADEI_CACHE_ENGINE  $compression", $this->dbh)) {
1091
1096
            throw new ADEIException(translate("Unable to create cache table (resolution: %s, items: 3 + 3 * %s), error: %s", $resolution, $items, mysql_error($this->dbh)));
1092
1097
        }
1093
1098
    } else {