Skip to Content.
Sympa Menu

freetds - Re: Odd problem round 2.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James Cameron <cameron AT stl.dec.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Odd problem round 2.
  • Date: Wed, 03 Jan 2001 10:17:17 +1100


Lyris mailing list manager rejected my first reply on spurious grounds
... the references header included a message id that it didn't like,
because it contains the "Lyris" keyword, despite it coming from the
mailing list. I'm fairly certain my mail client is doing the Right
Thing.

Tim Uckun wrote:
> $server= sybase_connect('192.168.0.4' , 'web' , 'web');
> $connectionID = sybase_select_db('crims', $server);

My code just does a sybase_connect(), there is no attempt to select a
database. No idea if that is significant.

> There are 5 "Attempting to convert unknown source type 104" errors one
> for each row. If I change the statement to return more or less rows
> this stays consistent. I get one of these errors for each row.

This is probably related. Any idea where this message is in the source
code? Is it FreeTDS or PHP?

# pwd
/usr/local/src/php-4.0.3pl1
# find . -type f -exec grep -i "attempting to convert" {} /dev/null \;
# pwd
/usr/local/src/freetds-0.51pre1
# find . -type f -exec grep -i "attempting to convert" {} /dev/null \;
./src/tds/convert.c: fprintf(stderr,"Attempting to
convert unknown source type %d\n",srctype);

So it is a FreeTDS error. The function returns a failure token when
this error is generated. It may be that a higher function is passing
the token back to PHP or something.

I suggest you now try to isolate the cause of this error, in case it is
significant. Here is how I would do it: make a version of PHP
containing a FreeTDS that will abort at the point of the error rather
than continue. As a result, you will be able to examine program state
to determine the cause of the error.

1) edit src/tds/convert.c and insert a line after the fprintf that
generates the error message:

abort();

This will cause the program to stop at this point instead of continuing.
(There are other ways, involving gdb breakpoints, but this is simplest
to describe.)

2) compile this modified FreeTDS but do not install it into production,

3) relink PHP with the modified FreeTDS, but again, avoid installing it,

4) run the PHP with the reproducer, which should cause an abort and core
dump at the point of failure,

5) use gdb to do a back trace at the point of failure and post the
result to the mailing list.

> Here is the structure of the table
> CREATE TABLE [dbo].[tblWebReportsAudit] (
> [ID] [int] IDENTITY (1, 1) NOT NULL ,
> [searchid] [int] NULL ,
> [RefNo] [varchar] (50) NULL ,
> [VendorID] [int] NULL ,
> [Result] [varchar] (50) NULL ,
> [Notes] [varchar] (150) NULL ,
> [when_ts] [datetime] NULL ,
> [done] [bit] NULL

Interesting. And it only does it with this table? Try a SELECT on each
column to isolate it further?

--
James Cameron (cameron AT stl.dec.com)

http://quozl.linux.org.au/ (or) http://quozl.netrek.org/




Archive powered by MHonArc 2.6.24.

Top of Page