Differential D19811 Diff 47348 src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | if ($res == null) { | ||||
throw new Exception(pht('No query result to fetch from!')); | throw new Exception(pht('No query result to fetch from!')); | ||||
} | } | ||||
while (($row = $this->fetchAssoc($res))) { | while (($row = $this->fetchAssoc($res))) { | ||||
$result[] = $row; | $result[] = $row; | ||||
} | } | ||||
return $result; | return $result; | ||||
} | } | ||||
public function executeRawQuery($raw_query) { | public function executeQuery(PhutilQueryString $query) { | ||||
$display_query = $query->getMaskedString(); | |||||
$raw_query = $query->getUnmaskedString(); | |||||
$this->lastResult = null; | $this->lastResult = null; | ||||
$retries = max(1, $this->getConfiguration('retries', 3)); | $retries = max(1, $this->getConfiguration('retries', 3)); | ||||
while ($retries--) { | while ($retries--) { | ||||
try { | try { | ||||
$this->requireConnection(); | $this->requireConnection(); | ||||
$is_write = $this->checkWrite($raw_query); | $is_write = $this->checkWrite($raw_query); | ||||
$profiler = PhutilServiceProfiler::getInstance(); | $profiler = PhutilServiceProfiler::getInstance(); | ||||
$call_id = $profiler->beginServiceCall( | $call_id = $profiler->beginServiceCall( | ||||
array( | array( | ||||
'type' => 'query', | 'type' => 'query', | ||||
'config' => $this->configuration, | 'config' => $this->configuration, | ||||
'query' => $raw_query, | 'query' => $display_query, | ||||
'write' => $is_write, | 'write' => $is_write, | ||||
)); | )); | ||||
$result = $this->rawQuery($raw_query); | $result = $this->rawQuery($raw_query); | ||||
$profiler->endServiceCall($call_id, array()); | $profiler->endServiceCall($call_id, array()); | ||||
if ($this->nextError) { | if ($this->nextError) { | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |