Skip to Content.
Sympa Menu

freetds - Re: [freetds] ODBC bug large image parameter

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ODBC bug large image parameter
  • Date: Wed, 11 Jul 2012 22:08:52 +0100

Hi,
sorry to reply so late but I saw the mail only after looking at
DBD::ODBC bug report.

Probably that's something wrong with the way we handle parsing the rpc
call. mssql have a limit of 64kb of query so perhaps from here the
32kb limit came (still to test).

Frediano

2012/2/27 Matthew McGillis <matthew AT jenika.com>:
> 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



  • Re: [freetds] ODBC bug large image parameter, Frediano Ziglio, 07/11/2012

Archive powered by MHonArc 2.6.24.

Top of Page