mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Emit warning if an XML query returns 10000+ rows, probably because of missing condition
This commit is contained in:
parent
2f0ec84cc2
commit
d6dca30e0f
1 changed files with 6 additions and 0 deletions
|
|
@ -531,6 +531,7 @@ class DB
|
|||
$result = array();
|
||||
$index = $last_index;
|
||||
$step = $last_index !== 0 ? -1 : 1;
|
||||
$count = 0;
|
||||
$result_class = ($result_class && $result_class !== 'master') ? $result_class : 'stdClass';
|
||||
if (!class_exists($result_class))
|
||||
{
|
||||
|
|
@ -540,6 +541,11 @@ class DB
|
|||
{
|
||||
$result[$index] = $row;
|
||||
$index += $step;
|
||||
$count++;
|
||||
if ($count === 10000 && $this->_query_id !== '')
|
||||
{
|
||||
trigger_error('XML query ' . $this->_query_id . ' returned 10000 rows or more', E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
$stmt->closeCursor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue