[asterisk-users] MYSQL grammar diff in 1.6.2.1?

Zhang Shukun bitzsk at gmail.com
Wed Jan 27 01:38:46 CST 2010


2010/1/26 Tilghman Lesher <tlesher at digium.com>:
> 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).

wow, i learn this method from voip-info and do the same as the example showed.

so i add backslash.

> This is the problem, and if you remove the backslashes, you should be fine.

you are right! it really works now by remove backslash.

maybe in asterisk 1.4 add backslash or not is both working.

but in asterisk 1.6 , must not contain backslash. or it will not work any more.

>
> --
> Tilghman
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Best regards,
Sucan



More information about the asterisk-users mailing list