}
// validate foreign keys
- $keyCount = 0;
+ $expectedForeignKeyCount = 0;
$conditionBuilder = new PreparedStatementConditionBuilder(true, 'OR');
foreach ($this->foreignKeys as $table => $keys) {
foreach ($keys as $column => $reference) {
$conditionBuilder->add('('. $innerConditionBuilder .')', $innerConditionBuilder->getParameters());
- $keyCount++;
+ $expectedForeignKeyCount++;
}
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $this->results['mysql']['foreignKeys'] = $statement->fetchSingleColumn() === $keyCount;
+ $this->results['mysql']['foreignKeys'] = $statement->fetchSingleColumn() === $expectedForeignKeyCount;
if ($this->results['mysql']['result'] && $this->results['mysql']['innodb'] && $this->results['mysql']['foreignKeys']) {
$this->results['status']['mysql'] = true;