[asterisk-users] MYSQL grammar diff in 1.6.2.1?
Tilghman Lesher
tlesher at digium.com
Mon Jan 25 17:47:37 CST 2010
On Monday 25 January 2010 03:12:08 Zhang Shukun wrote:
> hi, dear all
>
> MYSQL commands work well in 1.4.28 edition, but not in 1.6.21
>
> is that the grammar is different between them?
>
> extensions.conf
>
> exten => s,2,MYSQL(Query resultid ${connid} SELECT\ callerid\ from\
> blacklist\ where\ companycode = ${ARG2} and callerid=${ARG1} and
> blockenabled = 1)
>
> cli:
> -- Executing [s at macro-checkblacklist:2] MYSQL("SIP/1003-00000006",
> "Query resultid 1 SELECT\ callerid\ from\ blacklist\ where\
> companycode = 95040654321 and callerid=1003 and blockenabled = 1") in
> new stack
> [Jan 25 17:05:34] WARNING[2583]: app_addon_sql_mysql.c:374
> aMYSQL_query: aMYSQL_query: mysql_query failed. Error: You have an
> error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near '\ callerid\
> from\ blacklist\ where\ companycode = 95040654321 and callerid=1003 '
> at line 1
I have no idea why you backslashed your spaces in 1.4, as that has never been
a requirement (as is evident later in the line, where you neglected them).
This is the problem, and if you remove the backslashes, you should be fine.
--
Tilghman
More information about the asterisk-users
mailing list