-
Incident report
-
Resolution: Fixed
-
Major
-
1.8.2
-
None
Spotted this in my MySQL slow query log:-
- Time: 100619 12:27:14
- User@Host: zabbix[zabbix] @ []
- Query_time: 0.002134 Lock_time: 0.000121 Rows_sent: 675 Rows_examined: 1
SET timestamp=1276950434;
SELECT u.userid,u.alias,u.name,u.surname,u.url,u.refresh,u.passwd FROM users u, users_groups ug, usrgrp g WHERE u.alias='monitoring' AND ((u.userid BETWEEN 000000000000000 AND 099999999999999));
Why do you perform a join on tables you don't use??
Fixed it with this patch:-
- diff -up api/classes/class.cuser.php api/classes/class.cuser.php.orig
-
- api/classes/class.cuser.php 2010-06-19 12:36:41.000000000 +0000
+++ api/classes/class.cuser.php.orig 2010-06-19 12:27:02.000000000 +0000
@@ -379,7 +379,7 @@ class CUser extends CZBXAPI{
- api/classes/class.cuser.php 2010-06-19 12:36:41.000000000 +0000
-
if($login){
$sql = 'SELECT u.userid,u.alias,u.name,u.surname,u.url,u.refresh,u.passwd '.
- ' FROM users u '.
+ ' FROM users u, users_groups ug, usrgrp g '.
' WHERE u.alias='.zbx_dbstr($name).
((ZBX_AUTH_INTERNAL==$auth_type)?' AND u.passwd='.zbx_dbstr($password):'').
' AND '.DBin_node('u.userid', $ZBX_LOCALNODEID);