Re: [PATCH] dlr_mysql.c - Table name fix

Vincent CHAVANIS <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
this is Mysql specs (cf http://dev.mysql.com/doc/refman/5.0/en/identifiers.html)
eg. : A reserved word that follows a period in a qualified name must be an identifier, so it need not be quoted.

Then, binds have absolutly nothing to do with this patch
I'm talking about field/table names specified on the config file.
But if binds are not escaped, then we need regular quotes is strings.

Actually if you have a table/field names called SELECT or UPDATE or LIMIT or whatever reserved by mysql
then the SQL parsing error will occur. (And you have plenty of these, please check the link below)
(http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html)

Vincent.


Nikos Balkanas a écrit :
> Hi,
> 
> But this works as it is. Under what conditions do you recreate error? 
> Lastly what about the binds wouldn't they need escaping, too, if strings?
> 
> BR,
> Nikos
> ----- Original Message ----- From: "Vincent CHAVANIS" 
> <[email protected]>
> To: <[email protected]>
> Sent: Friday, October 09, 2009 4:21 PM
> Subject: [PATCH] dlr_mysql.c - Table name fix
> 
> 
>> Hi all,
>>
>> Here is a patch that escape table names from mysql specs.
>> This will fix the SQL syntax error.
>>
>> Simple POC (set your mysql conf as this)
>> group = dlr-db
>> id = mydlr
>> table = SELECT
>>
>> You will get : ERROR 1064 (42000): You have an error in your SQL syntax;
>>
>> Vincent
>>
>> -- 
>> Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
>> Service Technique/Reseau - NOC
>> Direction du Developpement xMS+
>> http://www.telemaque.fr/
>> [email protected]
>> Tel : +33 4 92 90 99 84 (fax 9142)
>>
> 
> 
> 

-- 
Telemaque - 06560 SOPHIA-ANTIPOLIS - (FR)
Service Technique/Reseau - NOC
Direction du Developpement xMS+
http://www.telemaque.fr/
[email protected]
Tel : +33 4 92 90 99 84 (fax 9142)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.