Re: PATCH: Fix strange sql// filename handling

Martin Sperl <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Actually the code was intended to allow the options to use "::" or any other "double" separator instead of // as well... 
But as this behavior is not documented, it is good to avoid this possible conflict.

Ciao,
		Martin


On 03.03.2011, at 07:56, Tobias Oetiker wrote:

> Hi Peter,
> 
> thanks for the patch ... integrated
> 
> cheers
> tobi
> Yesterday Peter Stamfest wrote:
> 
>> 
>> Hi!
>> 
>> This fixes some strange file name handling wrt libdbi.
>> 
>> The original code would identify a file named "sqlxxabc.rrd" as a libdbi
>> specification, if I read the code right.
>> 
>> I found this when browsing the source code, so both the bug and the fix are
>> untested.
>> 
>> Patch is both inlined and attached:
>> 
>> 
>> 
>> Index: src/rrd_fetch.c
>> ===================================================================
>> --- src/rrd_fetch.c    (revision 2175)
>> +++ src/rrd_fetch.c    (working copy)
>> @@ -240,10 +240,8 @@
>> 
>> #ifdef HAVE_LIBDBI
>>     /* handle libdbi datasources */
>> -    if (strncmp("sql",filename,3)==0) {
>> -      if (filename[3]==filename[4]) {
>> +    if (strncmp("sql//",filename,5)==0) {
>>     return
>> rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
>> -      }
>>     }
>> #endif
>> 
>> 
>> 
>> 
>> 
>> peter
>> 
> 
> -- 
> Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
> http://it.oetiker.ch [email protected] ++41 62 775 9902 / sb: -9900
> 
> _______________________________________________
> rrd-developers mailing list
> [email protected]
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
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.