Skip to Content.
Sympa Menu

freetds - Re: [freetds] SP input parameter problem on 0.63

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Frank M. Kromann" <frank AT kromann.info>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Cc: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SP input parameter problem on 0.63
  • Date: Mon, 08 Aug 2005 16:08:33 -0700

Hi Freddy,

I'm trying to solve http://bugs.php.net/bug.php?id=29316 too. As far as I
can tell this is an issue in FreeTDS too. I'm using 0.64-dev from cvs and
I'm caling a SP that returns two results. First result does not have any
rows. On my windows box the code returns both results but it looks like
FreeTDS is skipping the first result.

The code:
create procedure a_test as
select * from t1 where 1=2
select * from t1

The php code:


<?php
if (!extension_loaded("mssql"))
{
dl("php_mssql." . PHP_SHLIB_SUFFIX);
}

$host = "64.186.239.115";
$user = "web";
$password = "webuser";
$database = "Swwwing2000";

$con = mssql_connect($host, $user, $password);
if ($con) {
if (mssql_select_db($database, $con)) {
$stmt = mssql_init("a_test", $con);
$rs = mssql_execute($stmt);
if (is_resource($rs)) {
echo "fetching...\n";
$i = 1;
do {
echo "Processing result $i\n";
echo "Num rows = " . mssql_num_rows($rs) .
"\n";
// Process result
$i++;
} while (mssql_next_result($rs));
mssql_free_result($rs);
}
}
mssql_close($con);
}
?>

The result on Windows:
fetching...
Processing result 1
Num rows = 0
Processing result 2
Num rows = 222

The result on Linux with FreeTDS:
fetching...
Processing result 1
Num rows = 222


- Frank

> >
> > I opened this PHP bug:
> > http://bugs.php.net/bug.php?id=33963
> > with a similar problem.
> >
> > As I said in the bug report, a NULL valued variable length type will
> > always fail.
> >
> > The conclusion to this so far is that the FreeTDS code is
> > wrong [see the
> > bug comments linked to above].
> >
> > I haven't had a close enough look at the specification to see who I
> > think is right ;-)
> >
> > Paul
> >
>
> I saw...
> This patch should solve your problems (vedi.diff).
> Attached also full post 0.63 patch.
>
> freddy77
>







Archive powered by MHonArc 2.6.24.

Top of Page