Re: [PATCH] dlr_mysql.c - Table name fix
Alexander Malysh <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
commited to cvs, thx!
Thanks,
Alexander Malysh
Am 13.10.2009 um 11:01 schrieb Vincent CHAVANIS:
>
> Ok, attached the new patch here.
>
> Vincent.
>
>
> Alexander Malysh a écrit :
>> Am 13.10.2009 um 00:09 schrieb Vincent CHAVANIS:
>>>
>>> I'm sure we will find other specific cases that will be processed
>>> into this function ;)
>>> Let it as it.
>> Vincent, sorry but I don't see reason and case that we will add
>> there. Please consider to kill function call
>> or show me another functional line in this function...
>> We always can easy add this function again if we find any case that
>> we have to escape...
>>>
>>> Vincent.
>>>
>>>
>>> Alexander Malysh a écrit :
>>>> hmm, you make it tooo complicated ;)
>>>> why not just:
>>>> octstr_replace(fields->table, octstr_imm("`"), octstr_imm("``"));
>>>> ...
>>>> instead of calling function/macro with only one line?
>>>> Thanks,
>>>> Alex
>>>> Am 12.10.2009 um 13:45 schrieb Vincent CHAVANIS:
>>>>>
>>>>> done.
>>>>>
>>>>> Vincent
>>>>>
>>>>>
>>>>> Alexander Malysh a écrit :
>>>>>> Hi again,
>>>>>> I don't see reason to use macro because macro contains only one
>>>>>> line...
>>>>>> Could you please drop macro and use plain function call?
>>>>>> Thanks,
>>>>>> Alex
>>>>>> Am 12.10.2009 um 12:39 schrieb Vincent CHAVANIS:
>>>>>>>
>>>>>>> Damn! you're right ;-)
>>>>>>>
>>>>>>> For this issue, i decided to use a macro that
>>>>>>> replaces names during the init process
>>>>>>>
>>>>>>> Comments ?
>>>>>>>
>>>>>>> Vincent.
>>>>>>>
>>>>>>>
>>>>>>> Alexander Malysh a écrit :
>>>>>>>> Hi,
>>>>>>>> +1 for this patch but patch is not complete. It doesn't
>>>>>>>> handle this case:
>>>>>>>> CREATE TABLE `a``b` (`c"d` INT);
>>>>>>>> Would you like update your patch? I think as optional
>>>>>>>> callback function ?
>>>>>>>> Thanks,
>>>>>>>> Alex
>>>>>>>> Am 09.10.2009 um 16:27 schrieb Vincent CHAVANIS:
>>>>>>>>>
>>>>>>>>> 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.
>>>>>>>>>
>>>>> <mysql_table_quotes.patch>
>>>
>>> --
>>> 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)
> <mysql_table_quotes.patch>