Skip Menu |

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

Report information
The Basics
Id: 77283
Status: resolved
Priority: 0/
Queue: DBD-ODBC

People
Owner: Nobody in particular
Requestors: bohica [...] ntlworld.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.37
Fixed in: 1.38_1



Subject: DiscardString with SQL_INTEGER not working properly
use DBI qw(:sql_types); use strict; use warnings; my $dbh = DBI->connect('dbi:ODBC:DSN=baugi','sa','easysoft', {RaiseError => 1, PrintError => 0}); eval { $dbh->do(q/drop table test/); }; $dbh->do(q/create table test(a varchar(10))/); $dbh->do(q/insert into test values(?)/, undef, 100); my $sth = $dbh->prepare('select a from test'); $sth->execute; my $aa; $sth->bind_col(1, \$aa, {DiscardString => 1, TYPE => SQL_INTEGER}); $sth->fetch; outputs: Argument "d\0\0\0" isn't numeric in subroutine entry at discard.pl line 19. It is because the returned data is an SQL_INTEGER (4 bytes) and not a string. Martin -- Martin J. Evans Wetherby, UK
The sql_type_cast.t test should demonstrate this but it is broken because it calls bind_col multiple times and bind calls are sticky. Martin -- Martin J. Evans Wetherby, UK