mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY (#5327)
* feature: Add mysql failed query logging + fixed queries that break ONLY_FULL_GROUP_BY * fix all schema errors and update system
This commit is contained in:
committed by
Tony Murray
parent
8936d9503b
commit
da5783d917
@@ -143,7 +143,7 @@ foreach ($result_options as $option) {
|
||||
|
||||
echo '</select></td>';
|
||||
|
||||
$count_query = 'SELECT COUNT(id)';
|
||||
$count_query = 'SELECT COUNT(*)';
|
||||
$full_query = 'SELECT *';
|
||||
$sql = '';
|
||||
$param = array();
|
||||
@@ -152,7 +152,7 @@ if (isset($device['device_id']) && $device['device_id'] > 0) {
|
||||
$param = array($device['device_id']);
|
||||
}
|
||||
|
||||
$query = " FROM alert_rules $sql ORDER BY id ASC";
|
||||
$query = " FROM alert_rules $sql";
|
||||
$count_query = $count_query.$query;
|
||||
$count = dbFetchCell($count_query, $param);
|
||||
if (!isset($_POST['page_number']) && $_POST['page_number'] < 1) {
|
||||
@@ -162,7 +162,7 @@ if (!isset($_POST['page_number']) && $_POST['page_number'] < 1) {
|
||||
}
|
||||
|
||||
$start = (($page_number - 1) * $results);
|
||||
$full_query = $full_query.$query." LIMIT $start,$results";
|
||||
$full_query = $full_query.$query." ORDER BY id ASC LIMIT $start,$results";
|
||||
|
||||
foreach (dbFetchRows($full_query, $param) as $rule) {
|
||||
$sub = dbFetchRows('SELECT * FROM alerts WHERE rule_id = ? ORDER BY `state` DESC, `id` DESC LIMIT 1', array($rule['id']));
|
||||
|
||||
Reference in New Issue
Block a user