protected function executeQuery($sql, $checkThreshold = false)
{
if ($this->CaptureOnly) {
if (!property_exists($this->Database, 'CapturedSql')) {
$this->Database->CapturedSql = array();
}
$this->Database->CapturedSql[] = $sql;
return true;
} elseif ($checkThreshold && $this->getAlterTableThreshold() && $this->getRowCountEstimate($this->tableName()) >= $this->getAlterTableThreshold()) {
$this->addIssue("The table was past its threshold. Run the alter manually.", $sql);
// Log an event to be captured and analysed later.
Logger::event('structure_threshold', Logger::ALERT, "Cannot alter table {tableName}. Its count of {rowCount,number} is past the {rowThreshold,number} threshold.", ['tableName' => $this->tableName(), 'rowCount' => $this->getRowCountEstimate($this->tableName()), 'rowThreshold' => $this->getAlterTableThreshold()]);
return true;
} else {
$Result = $this->Database->query($sql);
return $Result;
}
}