Skip to Content.
Sympa Menu

freetds - [freetds] ODBC bug large image parameter

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Matthew McGillis <matthew AT jenika.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] ODBC bug large image parameter
  • Date: Mon, 27 Feb 2012 09:08:55 -0800

With intel 64 running Red Hat Enterprise Linux Server 6.1 using FreeTDS 0.82,
unixODBC 2.3.0, perl 5.10 and DBD::ODBC 1.29.

Connecting to a Windows box with Microsoft SQL Server 2005 - 9.00.4035.00
(X64)

If I create this stored procedure in a database.

"create procedure testbug @data image as begin return end"

Then create a script "bug" with the following:

#!/usr/bin/perl

use DBI;

my $dbh=DBI->connect("dbi:ODBC:".$ENV{DB},$ENV{USER},$ENV{PASS},
{PrintError => 1, RaiseError=> 1}) ||
die "Failed DB connect: ".$dbh->errstr;


my $query = qq/{call testbug( ? )}/;
my $sth = $dbh->prepare($query);

my $name="";
while (true) {
$name.="a";
$sth->bind_param(1,$name, -4);
$sth->execute() || die $dbh->errstr;
print length($name)."\n";
}

The "bug" script will die when $name reaches 32768 chars with the message:

DBD::ODBC::st execute failed: Unable to fetch information about the error
at ./bug line 17.

however if I replace the query so it includes a ";" at the end like:

my $query = qq/{call testbug( ? )};/;

The code will not die at 32768 chars and goes way beyond (never actually let
the program run long enough to determine if it ever does die at some other
larger limit).

Matthew


  • [freetds] ODBC bug large image parameter, Matthew McGillis, 02/27/2012

Archive powered by MHonArc 2.6.24.

Top of Page