Skip to Content.
Sympa Menu

freetds - RE: Possible corruption

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Possible corruption
  • Date: Wed, 30 Oct 2002 09:58:28 +0100


>
> On a patched Solaris 8 (SPARC) server, running:
> Perl 5.6.1 or 5.8.0
> DBI 1.30 or 1.28 or 1.21
> DBD-Sybase 0.95 or 0.94 communicating with a Sybase server.
> (All version demonstrate the same symptoms)
>
> Freetds 0.53 works fine with the above, 0.6 seems to have the
> following
> problem:
> If I do a select on a field (using $Sth->fetchrow_hashref())
> and then use
> this information in another query, the query fails.
> The string seems to contain a non-printable character.
>
> eg:
>
> $Query = "select Serial, Identifier from alerts.status where
> Severity =
> 2;";

What are declaration of status table? What type of fields ?

> $Sth = $OsDbhRead->prepare($Query) || die "Unable to prepare
> query.\n$DBI::errstr\n";
> $Sth->execute || die "Unable to execute query\n$DBI::errstr\n";
>
> while ($MyData = $Sth->fetchrow_hashref()) {
>
> $Query = "update alerts.status set Flag = 3 where Identifier =
> '$MyData->{Identifier}'";
>
> print "$Query\n";
>

What's the output ?

> $OsDbhWrite->do($Query) || die "Unable to do
> Query.\n$DBI::errstr\n";
>
> }
>
> The above will not set the field "Flag" to 3 on any valid rows.
> If I set manualy set Query it works, indicating that the return result
> from the first query has a problem
> eg Modifying the $Query var by replace Identifier =
> '$MyData->{Identifier}' with
> Identifier = 'ABC12345678'
>
> If I use the printed query in both the code above, this also
> works wich
> seems to me to indicate a non-printable character problem.
>
> As mentioned 0.53 works as expected with the above code and the extact
> same environment, but the new version 0.6 does not.
>
> Thanks.
> Mike.
>

Some change has been done for padding/length. Perhaps is wrong the insert
and field contain some invalid characters. For example db string can contain
null terminator while C cannot. This has been fixed in 0.60. Another problem
is padding. CHAR is right padded (with spaces) while VARCHAR not.

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page