[Serusers] Serweb or MySQL bug ?

Juan J. Sierralta P. juanjo at atmlab.utfsm.cl
Fri Jul 25 20:44:55 CEST 2003


Hi,

	I'm accounting for missed calls onto MySQL everything fine. But Serweb
doesn't show the missed calls so checking on missed_calls.php line 29:

$q="select distinct t1.from_uri, t1.sip_from, t1.time, t1.sip_status
from "
        $config->table_missed_calls." t1, ".$config->table_aliases."
t2".
        " where t1.username='".$auth->auth["uname"].
        "' OR ('sip:".$auth->auth["uname"]."@".$config->default_domain.
            "'=t2.contact AND t2.username=t1.username) ".
        " order by time desc";

	Is the line that make the actual query to DB so I run the following
queries on MySQL (v3.23.49):

mysql> select t1.from_uri,t1.username from missed_calls t1 where
t1.username='5624108980';
+-----------------------------------------+------------+
| from_uri                                | username   |
+-----------------------------------------+------------+
| sip:5624108990 at 192.168.65.14;user=phone | 5624108980 |
+-----------------------------------------+------------+
1 row in set (0.00 sec)

	Fine so far, but if check for the something similar as serweb's query:

mysql> select t1.from_uri,t1.username from missed_calls t1, aliases t2
where t1.username='5624108980' OR ('5624108980 at marte'=t2.contact AND
t2.username=t1.username);

Empty set (0.01 sec)

	If I understand correctly the idea of the query is to get that missed
calls that match the username or an alias, in my case I have not aliases
defined; but since the query uses OR for aliases part I don't know why
the query gets an empty set.
	BTW I'm no SQL fluent :)



-- 
Juanjo sin .sig :(




More information about the sr-users mailing list