Re: [Sqlrelay-discussion] Can't bind undef to variable with Perl DBI
Brought to you by:
mused
|
From: Tim B. <Tim...@po...> - 2007-02-02 15:57:56
|
On Fri, Feb 02, 2007 at 10:32:21AM +0000, Tim Bunce wrote: > On Fri, Feb 02, 2007 at 01:36:30PM +1100, ja...@th... wrote: > > Hi all, > > > > I've recently started using sqlrelay's DBI driver to connect Perl to > > Oracle (sqlrelay 0.38). I find that I can't bind NULL values (undef, > > in Perl) to a prepared statement. > > > Looking at the source code, I see that src/api/perl/Cursor/Cursor.xs > > tries to detect NULLness of bind values by comparing the SV's address > > to &sv_undef. I don't think that this is right - on my machine (Perl > > 5.8.4 on Linux) the comparison fails even thought the bind value is > > null. > > > > I think the right way to check whether the SV structure contains undef > > is to use the SvOK macro. > > > Does anyone have any further thoughts on this? > > Looks good to me. > > Tim. > > p.s. I've have some fixes to DBD::SQLRelay I need to dig out and post here. I've attached it to this email. These changes came from some work I did for Shopzilla to evaluate sqlrelay for use with Sybase. I did that by setting the DBI_AUTOPROXY environment variable to refer to DBD::SQLRelay and then running DBD::Sybase's own test suite. I'd recommend that approach to anyone looking to use DBD::SQLRelay. DBD::SQLRelay still needs more love, but it won't be getting any more from me in the near future. Shopzilla decided not to use sqlrelay for their sybase application and are instead going to use the new DBD::Gofer driver that's part of DBI 1.54. Tim. |