Skip to Content.
Sympa Menu

freetds - Re: prerelease delayed by documentation

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Eric Deutsch" <edeutsch AT systemsbiology.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: prerelease delayed by documentation
  • Date: Tue, 3 Sep 2002 12:35:33 -0700



> From: Brian Bruns [mailto:camber AT ais.org]
[...]
> > > Is ODBC working with DBD::ODBC now? There was a
> > > problem as I recall. Others?
> >
> > I don't plan to test ODBC.
>
> I don't have the time. Maybe Eric will update us on its viability?

I would be delighted to! I just downloaded the latest from CVS, ran a
bunch of DBD::Sybase tests and all seems to be working fine. I then ran
the DBD::ODBC tests, and there are a bunch of issues. Some queries do
work fine, but others do not, apparently due to the column types of the
columns requested. Here's the information. My debugging skills are
limited, but I stand ready to assist in any way I can!

I compared identical queries using Perl DBD::Sybase with DBD::ODBC.
DBD::Sybase appears to work flawlessly in all my tests. Same exact
program used for both drivers, I just switched the DSN back and forth to
test both Sybase and ODBC.

Setup includes:
Red Hat 7.2 Linux
Perl 5.6.1
DBI 1.18
FreeTDS (CVS version from 2002-09-03 11:00am PDT)
DBD::Sybase 0.94
DBD::ODBC 0.30
unixODBC 2.0.7
Built with: ./autogen.sh --with-tdsver=7.0 --with-unixodbc=/usr
--with-ssl

Summary:

-FLOAT fields truncated after first digit and core dump.
-REAL fields truncated after first digit. But no core dump.
-DATETIME fields truncated after first digit and core dump.
-TEXT fields are not terminated properly can cause error and core dump.
-Server error messages are not reported nicely (or at all, actually).

Also: column type numbers in $sth->{TYPE} (displayed below after the
column name) are different between the two drivers. Is this a known
situation or an error? It makes writing code that can work with either
driver awkward.

Detailed output is below. I can send TDSDUMPs for any or all of the
various queries if desired.

Many thanks!
Eric


-------------------------------------------------
Details:


Using DBD::Sybase

[QUERY]: SELECT test_id,intfield,floatfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (floatfield): 6 --> float
=1|20|3.1415=
=2|25|2.17=
=3|30|1.23456789012346=
=4|35|-500=
=5|50|1.23=


Using DBD::ODBC

[QUERY]: SELECT test_id,intfield,floatfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (floatfield): 8 --> 8
=1|20|3=
=2|25|2=
=3|30|1=
=4|35|-=
=5|50|1=
Segmentation fault (core dumped)

FLOAT fields truncated after first digit and core dump.


Using DBD::Sybase

[QUERY]: SELECT test_id,intfield,charfield,realfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 1 --> varchar
3 (realfield): 7 --> real
=1|20|butter?|2.77699995040894=
=2|25|milk|2.77699995040894=
=3|30|swamp gas|2.77699995040894=
=4|35|pillow|2.77699995040894=
=5|50|chicken|2.77699995040894=


Using DBD::ODBC

[QUERY]: SELECT test_id,intfield,charfield,realfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 12 --> 12
3 (realfield): 6 --> float
=1|20|butter?|2=
=2|25|milk|2=
=3|30|swamp gas|2=
=4|35|pillow|2=
=5|50|chicken|2=

REAL fields truncated after first digit. But no core dump.



Using DBD::Sybase

[QUERY]: SELECT test_id,intfield,charfield,datefield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 1 --> varchar
3 (datefield): 11 --> date
=1|20|butter?|2000-01-25 18:00:00=
=2|25|milk|2001-01-22 00:00:00=
=3|30|swamp gas|1998-05-10 22:11:00=
=4|35|pillow|2002-09-03 11:37:11=
=5|50|chicken|2002-09-03 11:37:11=


Using DBD::ODBC

[QUERY]: SELECT test_id,intfield,charfield,datefield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 12 --> 12
3 (datefield): 11 --> date
=1|20|butter?|2=
=2|25|milk|2=
=3|30|swamp gas|1=
=4|35|pillow|2=
=5|50|chicken|2=
Segmentation fault (core dumped)

DATETIME fields truncated after first digit and core dump.



Using DBD::Sybase

[QUERY]: SELECT test_id,intfield,charfield,textfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 1 --> varchar
3 (textfield): -1 --> text
=1|20|butter?|some text=
=2|25|milk|more text=
=3|30|swamp gas|no text, or is it text*=
=4|35|pillow|There are quite a few perl modules and classes - do not
worry, there is no need to understand them all, unless you really want
to get in the thick of development. If you want to just use the tools,
available, look at the instructions for the script you want in the
scripts/ directory. A good starting place for writing tools is by
looking at the existing ones in the scripts/ directory. You will notice
that the clients (scripts) are generally quite thin, with the majority
of the clever stuff happening in the modules themselves.=
=5|50|chicken|no text, or is it text?=


Using DBD::ODBC

[QUERY]: SELECT test_id,intfield,charfield,textfield FROM
testdb.dbo.dbaccesstests
0 (test_id): 4 --> int
1 (intfield): 4 --> int
2 (charfield): 12 --> 12
3 (textfield): -1 --> text
=1|20|butter?|some text
=2|25|milk|more text
=3|30|swamp gas|no text, or is it text*@=
Error during retrieval
Error 1 ([unixODBC][Driver Manager]Data source name not found, and no
default driver specified (SQL-IM002)(DBD: st_fetch/SQLFetch (long
truncated) err=1))
Segmentation fault (core dumped)

TEXT fields are not terminated properly can cause error and core dump.



Using DBD::Sybase: request for a non-existent column:

Error 207 (Server message number=207 severity=16 state=3 line=1
server=MSSQL01 text=Invalid column name 'varcharfield'.)

Using DBD::ODBC: request for a non-existent column:
Error -1 ([unixODBC][Driver Manager]Data source name not found, and no
default driver specified (SQL-IM002)(DBD: st_execute/SQLExecute err=-1))

Server error messages are not reported nicely.









Archive powered by MHonArc 2.6.24.

Top of Page