Skip to Content.
Sympa Menu

freetds - New patch set [WAS Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug)]

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: New patch set [WAS Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug)]
  • Date: Wed, 28 Jun 2000 10:58:05 -0400 (EDT)


On Tue, 27 Jun 2000, Maraya Michael wrote:

> I don't think this fix made it to the 06/22/00 snapshot.
> Could you send me the patch please? Thanks.

We've done even better than that-- we've sent the patches to
freetds-jdbc-bug AT internetcds.com so that Craig can make them available
to everyone.

Craig -- Do you think you'll be able to review and plug in this set of
patches sometime soon? We're eager to have them get broader testing in
as many environments as possible.

The submitted patch file includes a significant number of modifications.
A summary of these changes is provided below.

(a) More properties of the database connection can be set - either as
appended parameters to the URL (we've chosen the ;key=value syntax
used by Sun in their JDBC-ODBC driver) or inside the Properties
instance handed to the getConnection(URL, Properties) method.

The additional Properties that are recognized right now are tds to
specify the protocol version (with legal values of 7.0 and 4.2 - 4.2
being the default) and charset to specify the assumed server
charset.

Support for this has led to a change in the constructors of
Connection and Tds that now take a single Properties argument. This
change also affects Driver and Constructors.

None of these changes affect the original syntax for connecting
using the driver. Existing connection code works as before.

(b) The port the server listens on is specified as an int instead of a
short as port numbers are unsigned. Affected classes are
Connection_base and Tds.

(c) Support for warning chains has been added. This affects Statement,
Connection_base, PreparedStatement_base, ResultSet_base, and Tds,
and adds a new class SQLWarningChain.

(d) The detection of the JDBC version is based on reflection instead
of the JVM version. The class Constructors is affected by this.

(e) The charset the server uses is taken into account and the strings
sent to the server and received from the server are encoded/decoded
properly. This has been tested against iso_1, cp437 and cp850 and
will most probably need wider testing from the user community.

Affected classes are Tds and ParameterUtils, and a new class
EncodingHelper has been added.

TdsAsciiInputStream doesn't get used anymore.

(f) Support has been added for Strings with more than 255 characters in
PreparedStatement.setString(). If the protocol is TDS 4.2 longer
Strings get transferred as TEXT; if it is TDS 7.0 they get
transferred as NVARCHAR, VARCHAR or NTEXT, depending on the length
of the encoded value, and whether the value can be represented in
the server's charset without loss of information.

Affected classes are PreparedStatement_base, ParameterUtils,
Procedure, and Tds.

Also, testcases 21 and 41 have been enabled.

(g) The ResultSet.getXXXStream methods have been added. Affected
classes are ResultSet_base and ResultSet_2_0.

(h) TDS 7.0 support including support for the new login and result
packets, NCHAR types and CHAR/BINARY values with up to 8000 bytes.

The primarily affected classes are Tds and TdsComm.

(i) The unittests have all been modified to cope with expected
Exceptions in languages other than us_english. I.e. they accept all
exceptions on drop table. Furthermore the date format is explicitly
set to ymd in the testcases involving date values - by default SQL
Server 7 changes its interpretation of date-time string constants
embedded in the SQL query according to the local language setting on
the server.

(j) Three new testcases have been added for the Stream methods, TDS 7.0
support (expected to fail if tds=4.2 is used), and warning chains.

(k) Fixed DatabaseMetaData.getCatalogs() to enable t0051 to pass.

(l) Modified ResultSet_base.next() to deal with TDS_RET_STAT_TOKEN
properly.

(m) Fixed a math bug in date handling and added support for dates under
7.0 (in Tds.java), enabling all date-time unit tests to pass.

(n) Rewrote decimal handling (Tds.java) to handle 7.0 encoding as well
as values larger than 64 bits of precision.


All unit tests have been run with the new code (both TDS 7.0 and TDS
4.2) against SQL Server 7 installed for iso_1, cp850, and cp437. The
only remaining failures are t0026, t0029, and t0038.

Thanks!

--
Bob Kline









  • New patch set [WAS Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug)], Bob Kline, 06/28/2000

Archive powered by MHonArc 2.6.24.

Top of Page