[Users] The lcr module has incorrect syntax for the current mysql release
Brandon Price
brandon at dacrib.net
Fri Aug 4 22:08:48 CEST 2006
I am pulling that query right out of my mysql query log. This works
if I downgrade to an earlier version of mysql. Please reply.
again the query being run is...
SELECT gw.ip_addr, gw.port, gw.uri_scheme, gw.transport, gw.strip,
gw.prefix FROM gw, lcr WHERE ''<sip:15183024234 at eastern.mynoc.net>''
LIKE lcr.from_uri AND '13143212222' LIKE CONCAT(lcr.prefix, '%') AND
lcr.grp_id = gw.grp_id ORDER BY CHAR_LENGTH(lcr.prefix), lcr.priority
DESC, RAND()
Would it have anything to do with the fact that the table type is
ndbcluster not myisam? I am willing to provide an account on that
box, but that is definitely the query being run.
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 sr-users
mailing list