Skip Menu |
 

This queue is for tickets about the DBD-ADO CPAN distribution.

Report information
The Basics
Id: 52048
Status: resolved
Priority: 0/
Queue: DBD-ADO

People
Owner: Nobody in particular
Requestors: frioux [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Bind Length messes up after first prepare
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 815
Download (untitled) / with headers
text/plain 815b
This is really weird. So if you do a query where the first param is *shorter* than later params the later params cause undef to be returned. It's easier to see in code than with words. #!perl use strict; use warnings; use DBI; my $dbh = DBI->connect('DBI:ADO:PROVIDER=sqlncli10;SERVER=tcp:10.6.0.9;MARS Connection=True;Initial Catalog=CIS_dev;UID=cis_web;PWD=elided;'); #my $dbh = DBI->connect('dbi:ODBC:dsn=CIS;UID=cis_web;PWD=elided;'); # <-- works no matter what my $sth = $dbh->prepare(' SELECT exp_date FROM User_Products WHERE ( product_name = ? AND user_id = ? )'); #for (qw{PF DMF }) { # <-- returns undef on the second result for (qw{ DMF PF }) { # <-- works fine $sth->execute($_, 'wesm'); while (my @row = $sth->fetchrow_array) { print @row; } print "\n"; } Thanks much!
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-16080-1259105979-559.52048-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1325
Download (untitled) / with headers
text/plain 1.2k
Here is the DBI trace (1) when I do this: Broken: <- prepare(' SELECT exp_date FROM User_Products WHERE ( product_name = ? AND user_id = ? )')= DBI::st=HASH(0x2c32e64) at wtfi swrong.pl line 12 <- execute('PF', 'wesm')= -1 at wtfiswrong.pl line 17 <- fetchrow_array= ( '12/21/2012' ) [1 items] row1 at wtfiswrong.pl line 18 <- fetchrow_array= ( ) [0 items] row1 at wtfiswrong.pl line 18 12/21/2012 <- execute('DMF', 'wesm')= '0E0' at wtfiswrong.pl line 17 <- fetchrow_array= ( ) [0 items] at wtfiswrong.pl line 18 <- DESTROY(DBI::st=HASH(2c32ea4))= undef <- FETCH('Active')= 1 at ADO.pm line 986 Working: <- prepare(' SELECT exp_date FROM User_Products WHERE ( product_name = ? AND user_id = ? )')= DBI::st=HASH(0x2c32e64) at wtfi swrong.pl line 12 <- execute('DMF', 'wesm')= -1 at wtfiswrong.pl line 17 <- fetchrow_array= ( '12/21/2012' ) [1 items] row1 at wtfiswrong.pl line 18 <- fetchrow_array= ( ) [0 items] row1 at wtfiswrong.pl line 18 12/21/2012 <- execute('PF', 'wesm')= -1 at wtfiswrong.pl line 17 <- fetchrow_array= ( '12/21/2012' ) [1 items] row1 at wtfiswrong.pl line 18 <- fetchrow_array= ( ) [0 items] row1 at wtfiswrong.pl line 18 12/21/2012 <- DESTROY(DBI::st=HASH(2c32ea4))= undef <- FETCH('Active')= 1 at ADO.pm line 986
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-9877-1259140017-1314.52048-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 496
Download (untitled) / with headers
text/plain 496b
On Di. 24. Nov. 2009, 18:23:57, frew wrote: Show quoted text
> This is really weird. So if you do a query where the first param is > *shorter* than later params the later params cause undef to be
returned. Thanks for the bug report! Looks like this SQLOLEDB bug <http://search.cpan.org/~sgoeldner/DBD-ADO-2.97/lib/DBD/ ADO.pm#ADO_providers> It seems that all SQL Server clients (ADO Provider) have this strange behavior - and not only for INSERT buffer. Does the ado_size workaround work for you? Steffen


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.