[Devel] Re: [Users] The lcr module has incorrect syntax for the
current mysql release
Brandon Price
brandon at dacrib.net
Fri Aug 4 22:21:32 CEST 2006
Also I changed line 1062 from ...
q_len = snprintf(query, MAX_QUERY_SIZE, "SELECT %.*s.%.*s, %.*s.%.*s,
%.*s.%.*s, %.*s.%.*s, %.*s.%.*s, %.*s.%.*s FROM %.*s, %.*s WHERE
'%.*s' LIKE %.*s.%.*s AND '%.*s' LIKE CONCAT(%.*s.%.*s, '%%') AND
%.*s.%.*s = %.*s.%.*s ORDER BY CHAR_LENGTH(%.*s.%.*s), %.*s.%.*s
DESC, RAND()",
to..
q_len = snprintf(query, MAX_QUERY_SIZE, "SELECT %.*s.%.*s, %.*s.%.*s,
%.*s.%.*s, %.*s.%.*s, %.*s.%.*s, %.*s.%.*s FROM %.*s, %.*s WHERE %.*s
LIKE %.*s.%.*s AND '%.*s' LIKE CONCAT(%.*s.%.*s, '%%') AND %.*s.%.*s
= %.*s.%.*s ORDER BY CHAR_LENGTH(%.*s.%.*s), %.*s.%.*s DESC, RAND()",
and it works. Notice I removed the ''s after WHERE.
On Aug 4, 2006, at 6:43 AM, Juha Heinanen wrote:
> Brandon Price writes:
>
>> SELECT gw.ip_addr, gw.port, gw.uri_scheme, gw.transport, gw.strip,
>> gw.prefix FROM gw, lcr WHERE ''<sip:12345678910 at eastern.mynoc.net>''
>> LIKE lcr.from_uri AND '15184782222' LIKE CONCAT(lcr.prefix, '%') AND
>> lcr.grp_id = gw.grp_id ORDER BY CHAR_LENGTH(lcr.prefix), lcr.priority
>> DESC, RAND()
>
> lcr module only adds a single single quote before and after from uri:
>
> q_len = snprintf(query, MAX_QUERY_SIZE, "SELECT %.*s.%.*s, %.*s.%.*s,
> %.*s.%.*s, %.*s.%.*s, %.*s.%.*s, %.*s.%.*s FROM %.*s, %.*s WHERE
> '%.*s'
> LIKE %.*s.%.*s AND '%.*s' LIKE CONCAT(%.*s.%.*s, '%%') AND %.*s.%.*s =
> %.*s.%.*s ORDER BY CHAR_LENGTH(%.*s.%.*s), %.*s.%.*s DESC, RAND()",
>
> -- juha
>
>
More information about the Devel
mailing list