You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Stefan Ruppert <sr...@myarm.com> on 2011/09/07 11:17:14 UTC

[PATCH] apr_dbd_oracle.c escape string implementation

Hi all,

today we got an error by using the APR DBD oracle driver with a string 
containing a single quote. Attached is a patch which implements a simple 
quoting mechanism for the oracle driver. It does not make use of oracle 
special quoting mechanism as introduced in 10g q'<string>' but it 
escapes any single quote with an additional single quote.

Regards,
Stefan

-- 
Stefan Ruppert <st...@myarm.com>
MyARM GmbH, Altkönigstr. 7, 65830 Kriftel, Germany
Phone: +49 6192/9772818
Web: http://www.myarm.com

Re: [PATCH] apr_dbd_oracle.c escape string implementation

Posted by Stefan Ruppert <sr...@myarm.com>.
On 07.09.2011 13:26, Jeff Trawick wrote:
> On Wed, Sep 7, 2011 at 5:17 AM, Stefan Ruppert<sr...@myarm.com>  wrote:
>> Hi all,
>>
>> today we got an error by using the APR DBD oracle driver with a string
>> containing a single quote. Attached is a patch which implements a simple
>> quoting mechanism for the oracle driver. It does not make use of oracle
>> special quoting mechanism as introduced in 10g q'<string>' but it escapes
>> any single quote with an additional single quote.
>
> Please update the patch to avoid tab characters, include a space
> within "if(", "while(", etc., and in general format the code like the
> rest of the file (I hope this file isn't an odd one ;) ).
>
> If nobody jumps on this patch soon, open a bug with the patch so that
> it isn't forgotten.

Ok, here is the revised patch according to tabs vs spaces and apr coding 
style ;-)

Stefan

-- 
Stefan Ruppert <st...@myarm.com>
MyARM GmbH, Altkönigstr. 7, 65830 Kriftel, Germany
Phone: +49 6192/9772818
Web: http://www.myarm.com

Re: [PATCH] apr_dbd_oracle.c escape string implementation

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Sep 7, 2011 at 5:17 AM, Stefan Ruppert <sr...@myarm.com> wrote:
> Hi all,
>
> today we got an error by using the APR DBD oracle driver with a string
> containing a single quote. Attached is a patch which implements a simple
> quoting mechanism for the oracle driver. It does not make use of oracle
> special quoting mechanism as introduced in 10g q'<string>' but it escapes
> any single quote with an additional single quote.

Please update the patch to avoid tab characters, include a space
within "if(", "while(", etc., and in general format the code like the
rest of the file (I hope this file isn't an odd one ;) ).

If nobody jumps on this patch soon, open a bug with the patch so that
it isn't forgotten.