# HG changeset patch # User Mark Brand # Date 1300827372 -3600 # Node ID 0a638accde38793798f643ac34f36623e2399b83 # Parent 7f4aeb15a70093a8a9dda65b15e4aa1618f7f7b0 upgrade package freetds to cvs diff -r 7f4aeb15a700 -r 0a638accde38 src/freetds-1-fastforward.patch --- a/src/freetds-1-fastforward.patch Tue Mar 22 10:10:37 2011 +0100 +++ b/src/freetds-1-fastforward.patch Tue Mar 22 21:56:12 2011 +0100 @@ -176870,3 +176870,1441 @@ if (pdata->Aflag && pdata->packetsize > 0) { DBSETLPACKET(login, pdata->packetsize); } + +commit 76772b234cde83105f6f897f1370bee35edec619 +Author: jklowden +Date: Tue Mar 22 00:23:23 2011 +0000 + + updated for upcoming release + +diff --git a/ChangeLog b/ChangeLog +index d330b3f..ac8e369 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,6 @@ ++Mon Mar 21 20:21:51 EDT 2011 JK Lowden ++ * doc/userguide.sgml updated for upcoming release ++ + Sun Mar 13 14:40:55 EDT 2011 JK Lowden + * doc/bsqldb.txt doc/freebcp.txt doc/tsql.txt + - doc/userguide.sgml +@@ -3180,4 +3183,4 @@ Wed Jan 9 19:54:43 EST 2008 JK Lowden + * ChangeLog-0.82 added because of release + + $FreeTDS$ +-$Id: ChangeLog,v 1.3201 2011/03/13 21:32:39 jklowden Exp $ ++$Id: ChangeLog,v 1.3202 2011/03/22 00:23:23 jklowden Exp $ +diff --git a/doc/userguide.sgml b/doc/userguide.sgml +index ac19ae9..80f95bc 100644 +--- a/doc/userguide.sgml ++++ b/doc/userguide.sgml +@@ -13,8 +13,8 @@ + ]> + + +- $Date: 2011/03/12 12:54:01 $ +- $Revision: 1.134 $ ++ $Date: 2011/03/22 00:23:24 $ ++ $Revision: 1.135 $ + &freetds; User Guide + A Guide to Installing, Configuring, and Running &freetds; + +@@ -63,9 +63,9 @@ + + The version you're reading is: + +- $Revision: 1.134 $ +- $Date: 2011/03/12 12:54:01 $ +- CVS control number $Id: userguide.sgml,v 1.134 2011/03/12 12:54:01 jklowden Exp $. ++ $Revision: 1.135 $ ++ $Date: 2011/03/22 00:23:24 $ ++ CVS control number $Id: userguide.sgml,v 1.135 2011/03/22 00:23:24 jklowden Exp $. + + + can be found on the &freetds; +@@ -83,17 +83,18 @@ + What is &freetds;? + + +-&freetds; is re-implementation of C libraries originally implmented by Sybase and Microsoft SQL Server. It includes drop-in replacements for ++&freetds; is re-implementation of C libraries originally marketed by Sybase and Microsoft SQL Server. It allows many open source applications such as Perl and PHP (or your own C or C++ program) to connect to Sybase or Microsoft SQL Server. ++ ++&freetds; provides drop-in replacements for + + +- Sybase's DB-Library or CT-Library +- Microsoft's DB-Library (which differs in small details from Sybase's) +- an ODBC library similar that provided by the vendors ++ Sybase's &dblib; and &ctlib; ++ Microsoft's &dblib; (which differs in small details from Sybase's) ++ the &odbc; drivers from both vendors ++ interactive SQL and BCP utilities + + +-The TDS part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream. +- +-&freetds; allows many open source applications such as Perl and PHP (or your own C or C++ program) to connect to Sybase or Microsoft SQL Server. ++The TDS part of the name comes from name of the protocol used to communicate with such servers: the Tabular Data Stream. + + &freetds; is distributed in source code form, and is expected to compile on just about any operating system. That means every form of Unix® and Unix-like™ system (including notable variants such as Interix® and QNX®), as well as Win32®, VMS®, and OS X®. If it doesn't compile on your system — and you're not using MS-DOS® — it's probably considered a bug. + +@@ -104,17 +105,17 @@ The TDS part of the name comes from name of the protocol used to + + TDS is a protocol, a set of rules describing how to transmit data between two computers. Like any protocol, it defines the types of messages that can be sent, and the order in which they may be sent. Protocols describe the bits on the wire, how data flow. + +-In reading this manual, it may be helpful to keep in mind that a protocol is not an API, although the two are related. The server recognizes and speaks a protocol; anything that can send it the correct combination of bytes in the right order can communicate with it. But programmers aren't generally in the business of sending bytes; that's the job of a library. Over the years, there have been a few libraries — each with its own API — that do the work of moving SQL through a TDS pipe. ODBC, &dblib;, and &ctlib; have very different APIs, but they're all one to the server, because on the wire they speak TDS. ++In reading this manual, it may be helpful to keep in mind that a protocol is not an API, although the two are related. The server recognizes and speaks a protocol; anything that can send it the correct combination of bytes in the right order can communicate with it. But programmers aren't generally in the business of sending bytes; that's the job of a library. Over the years, there have been a few libraries — each with its own API — that do the work of moving SQL through a TDS pipe. &odbc;, &dblib;, and &ctlib; have very different APIs, but they're all one to the server, because on the wire they speak TDS. + +-The TDS protocol was designed and developed by Sybase Inc. for their Sybase SQL Server relational database engine in 1984. The problem Sybase faced then still exists: There was no commonly accepted application-level protocol to transfer data between a database server and its client. To encourage the use of their product, Sybase came up with DB-Library. ++The TDS protocol was designed and developed by Sybase Inc. for their Sybase SQL Server relational database engine in 1984. The problem Sybase faced then still exists: There was no commonly accepted application-level protocol to transfer data between a database server and its client. To encourage the use of their product, Sybase came up with &dblib;. + +-DB-Library provided an API to the client program, and communicated with the server. What it sent to the server took the form of a stream of bytes meant for tables of data, a Tabular Data Stream. ++&dblib; provided an API to the client program, and communicated with the server. What it sent to the server took the form of a stream of bytes meant for tables of data, a Tabular Data Stream. + +-In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own SQL Server. Microsoft kept the DB-Library API and added ODBC. (Microsoft has since added other APIs, too. It no longer supports its own DB-Library implementation.) At about the same time, Sybase introduced a more powerful successor to DB-Library, called CT-Library, and called the pair OpenClient. ++In 1990 Sybase entered into a technology sharing agreement with Microsoft which resulted in Microsoft marketing its own SQL Server. Microsoft kept the &dblib; API and added &odbc;. (Microsoft has since added other APIs, too. It no longer supports its own &dblib; implementation.) At about the same time, Sybase introduced a more powerful successor to &dblib;, called &ctlib;, and called the pair OpenClient. + +-CT-Library, DB-Library, and ODBC are APIs that — however different their programming style may be — all communicate with the server in the same way. The language they use is TDS. ++&ctlib;, &dblib;, and &odbc; are APIs that — however different their programming style may be — all communicate with the server in the same way. The language they use is TDS. + +-The TDS protocol comes in several flavors, most of which have never been openly documented. If anything, it's probably considered to be something like a trade secret, or at least proprietary technology. The exception is TDS 5.0, used exclusively by Sybase, for which documentation is available from Sybase. ++The TDS protocol comes in several flavors, most of which were not openly documented. If anything, it was considered to be something like a trade secret, or at least proprietary technology. The exception is TDS 5.0, used exclusively by Sybase, for which documentation is available from Sybase. + + + +@@ -132,46 +133,43 @@ The TDS part of the name comes from name of the protocol used to + The version in use at the time of the Sybase/Microsoft split. + + +- TDS 5.0 +- Sybase +- +- +-Introduced for Sybase. Because TDS 5.0 includes negotiated capabilities through which protocol features can be expanded, we are unlikely to see a new TDS version from Sybase. +- ++ ++ TDS 5.0 Sybase ++ Introduced for Sybase. Because TDS 5.0 includes negotiated capabilities through which protocol features can be expanded, we are unlikely to see a new TDS version from Sybase. ++ + +- TDS 7.0 +- Microsoft +- +- +-Introduced for SQL Server 7.0. Includes support for the extended datatypes in SQL Server 7.0 (such as char/varchar fields of more than 255 characters). It also includes support for Unicode. +- ++ ++ TDS 7.0 Microsoft ++ Introduced for SQL Server 7.0. Includes support for the extended datatypes in SQL Server 7.0 (such as char/varchar fields of more than 255 characters). It also includes support for Unicode. ++ + +- TDS 7.1 +- Microsoft +- +- +-Introduced for SQL Server 2000. Includes support for big integer (64-bit int) and variant datatypes. +- ++ ++ TDS 7.1 Microsoft ++ was 8.0 ++ Earlier &freetds; documentation referred to versions 7, 8 and 9. Microsoft subsequently published a protocol specification document denoting 7.1 and 7.2, and one finds scattered references using that scheme elsewhere, too. For that reason, &freetds; switched to Microsoft's nomenclature. ++ ++ Introduced for SQL Server 2000. Includes support for big integer (64-bit int) and variant datatypes. ++ + +- TDS 7.2 +- Microsoft +- ++ ++ TDS 7.2 Microsoft ++ was 9.0 ++ Introduced for SQL Server 2005. Includes support for varchar(max), varbinary(max), xml datatypes and MARS. ++ + +-Introduced for SQL Server 2005. Includes support for varchar(max), varbinary(max), xml datatypes and MARS. +- +- + + + +- History of &freetds; ++ ++ History of &freetds; + + &freetds; was and is developed by observation and experimentation, which is to say, by trial and error. + + In early 1997, the only option for connecting to a Sybase server from Linux or other free systems was an aging Sybase-released version of OpenClient. Unfortunately it had a few problems. The original release was a.out-based, although Greg Thain did a great service in converting the library to ELF. Secondly, it included only the newer &ctlib; API. The older &dblib; API was missing. + +-Brian Bruns, a Sybase DBA and originator of the &freetds; project, had some &dblib; programs he wanted to run under Linux, and thus began the &freetds; project. The original work focused on &dblib; and version 5.0 of the protocol, but quickly expanded to include a &ctlib; compatible layer and TDS version 4.2. Later support for ODBC and TDS 7.0 and 7.1 was added. Craig Spannring wrote a Java JDBC driver which became FreeTDS/JDBC. ++Brian Bruns, a Sybase DBA and originator of the &freetds; project, had some &dblib; programs he wanted to run under Linux, and thus began the &freetds; project. The original work focused on &dblib; and version 5.0 of the protocol, but quickly expanded to include a &ctlib; compatible layer and TDS version 4.2. Later support for &odbc; and TDS 7.0 and 7.1 was added. Craig Spannring wrote a Java JDBC driver which became FreeTDS/JDBC. + +-As the project matured, it gained new participants. Frediano Ziglio greatly expanded the ODBC driver, and continues to improve both it and the underlying TDS library. Bill Thompson wrote most of the present BCP system and added cursors to our &ctlib;. Your humble author joined the project to add documentation, and wound up as the project's maintainer. Such are the rewards for doing a good deed. ++As the project matured, it gained new participants. Frediano Ziglio greatly expanded the &odbc; driver, and continues to improve both it and the underlying TDS library. Bill Thompson wrote most of the present BCP system and added cursors to our &ctlib;. Your humble author joined the project to add documentation, and in 2002 became its maintainer. Such are the rewards for doing a good deed. + + There have been many other contributions. Please see the AUTHORS in the distribution for a (we hope) complete list. + +@@ -182,7 +180,7 @@ The TDS part of the name comes from name of the protocol used to + + &freetds; consists of two projects. The &freetds; C libraries and &freetds;/ JDBC. + +- The &freetds; C libraries support three separate APIs: &dblib;, &ctlib;, and ODBC. Underlying these three is libtds, which handles the low-level details of the TDS protocol, such as sending, receiving, and datatype conversion. This document and the FreeTDS website are dedicated to these libraries. ++ The &freetds; C libraries support three separate APIs: &dblib;, &ctlib;, and &odbc;. Underlying these three is libtds, which handles the low-level details of the TDS protocol, such as sending, receiving, and datatype conversion. This document and the FreeTDS website are dedicated to these libraries. + + If Java is your game, we refer you to the + jTDS +@@ -194,7 +192,7 @@ The TDS part of the name comes from name of the protocol used to + + Status + +-The libraries are portable, mature, and stable. They're expected to compile readily and normally do not crash or corrupt data. There is a logging feature to aid in diagnosing problems. While they do not include every feature provided by the vendors' libaries, they do faithfully implement a useful — and widely used — subset of their APIs. ++The libraries are portable, mature, and stable. They're expected to compile readily and normally do not crash or corrupt data. Extensive logging aids in diagnosing problems. While they do not include every feature provided by the vendors' libraries, they do faithfully implement a useful — and widely used — subset of their APIs. + + The &dblib; and &ctlib; APIs have been usable for several years. They have been successfully substituted for Sybase's own libraries in a variety of venues, including Perl and PHP. + +@@ -202,11 +200,13 @@ The TDS part of the name comes from name of the protocol used to + + Basic API coverage information for all libraries may be found in this manual. It is maintained in doc/api_status.txt, included in the source distribution. + ++For Microsoft servers, &freetds; now offers the best &dblib; for any OS on the planet (including Windows!) thanks not only to the hard work of its contributors, but also to Microsoft'sMicrosoft ceased enhancing &dblib; in 2001, advising customers to avoid using &dblib;. For Microsoft's unmaintained product, that's good advice. But if the &dblib; specification meets your needs, &freetds; permits you to keep using it with little loss (and some gain) of functionality. strategy. It is the only Win64 implementation of &dblib;, and the only Win32 implementation to support modern versions of the protocol. (SQL Server 2008 still accepts the TDS 4.2 connections that Microsoft's old library uses, but rejects BCP uploads with a spurious permission-denied message.) ++ + In addition to the core &dblib; API, &freetds; includes a full implementation of &dblib;'s bcp functions, as well as freebcp, a replacement for Sybase's bcp utility. + +-How big is it? &freetds; has over 90,000 lines of C code, maintained by a handful of developers. Patches arrive irregularly, varying in size from one-liners to thousand-line monsters. Almost all are applied or used in some way. The mailing list has some 700 or so subscribers at this writing. Safe to say, &freetds;'s success so far lies somewhere between the Beetle and the Edsel. ++How big is it? &freetds; has over 100,000 lines of C code, maintained by a handful of developers. Patches arrive irregularly, varying in size from one-liners to thousand-line monsters. Almost all are applied or used in some way. The mailing list has some 700 or so subscribers at this writing. Safe to say, &freetds;'s success so far lies somewhere between the Beetle and the Edsel. + +-Who uses it? Oh, pretty much everyone. &freetds; users almost certainly number in the tens of thousands. It's used by large corporations, by the U.S. federal government (e.g. Database Access Library at the National Center for Biotechnology Information) and, judging by the mailing list, by many webservers running Apache and PHP. Microsoft recommends &freetds; to their customers who want access to Microsoft SQL Server from non-Win32 clients. So do we. ++Who uses it? Oh, pretty much everyone. &freetds; users number in the tens of thousands. It's used by large corporations, by the U.S. federal government (e.g. Database Access Library at the National Center for Biotechnology Information) and, judging by the mailing list, by many webservers running Apache and PHP. Sybase recommends &freetds; for their EAServer product. Microsoft recommends &freetds; to their customers who want access to Microsoft SQL Server from non-Win32 clients. So do we. + + + Languages besides C and Java +@@ -227,19 +227,19 @@ The TDS part of the name comes from name of the protocol used to + + + +- ODBC bridge products +- They use the ODBC driver on the NT box where your SQL Server runs so you'll never have trouble with new protocols and the like. On the downside, they can be costly and may be inefficient. We know of EasySoft ODBC-ODBC Bridge from EasySoft, Universal Data Access Driver from OpenLink Software, SequeLink from Merant, and +- ODBC Router from August Software Corporation. ++ &odbc; bridge products ++ They use the &odbc; driver on the NT box where your SQL Server runs so you'll never have trouble with new protocols and the like. On the downside, they can be costly and may be inefficient. We know of EasySoft ODBC-ODBC Bridge from EasySoft, Universal Data Access Driver from OpenLink Software, SequeLink from Merant, and ++ &odbc; Router from August Software Corporation. + + + +- Inline ODBC driver +- Based on libtds, this is a native ODBC driver for i386 *nix. It is free in price, but comes only as a binary at the present time. ++ Inline &odbc; driver ++ Based on libtds, this is a native &odbc; driver for i386 *nix. It is free in price, but comes only as a binary at the present time. + + + + DBD::Proxy +- We have no direct experience with this Perl-only option. It has the same caveats as an ODBC bridge except it's free. ++ We have no direct experience with this Perl-only option. It has the same caveats as an &odbc; bridge except it's free. + + + +@@ -257,7 +257,14 @@ The TDS part of the name comes from name of the protocol used to + + The <acronym>GNU</> World + +-&freetds; uses GNU Automake, Autoconf, and libtool to increase portability. ++&freetds; uses GNU Autoconf, Automake, and libtool ++ ++ Versions used for this release ++ autoconf (GNU Autoconf) 2.65 ++ automake (GNU automake) 1.11.1 ++ ltmain.sh (GNU libtool) 2.2.6b ++ ++ to increase portability. + + For many people, the preceding sentence says it all (good or bad). If you're familiar with the GNU system, you can probably just download the tarball and get away with scanning the README impatiently and then following your instincts. Because everyone is a beginner once and no one is an expert at everything, we'll try to explain things in plain English where possible, and to define our terms as we go along. + +@@ -278,7 +285,7 @@ The TDS part of the name comes from name of the protocol used to + $ cvs -d:pserver:anonymous@freetds.cvs.sourceforge.net:/cvsroot/freetds login + $ cvs -z3 -d:pserver:anonymous@freetds.cvs.sourceforge.net:/cvsroot/freetds checkout -P freetds + Password: +- $ make install ++ $ + + For those behind firewalls or otherwise unable to access CVS, nightly snapshots of CVS are rolled up into tarballs for your convenience. They can be downloaded from + ibiblio.org. Tarballs are generated around 3am EST (GMT-5). +@@ -295,14 +302,14 @@ The TDS part of the name comes from name of the protocol used to + + For Experts + +- $ ./configure --prefix=/usr/local/freetds ++ $ ./configure --prefix=/usr/local + $ make + $ su root + Password: + $ make install + + +-Building from CVS is described in the file INSTALL.CVS. ++Building from CVS is described in the file INSTALL.CVS. + + + For Everyone Else +@@ -321,9 +328,9 @@ The TDS part of the name comes from name of the protocol used to + The simplest form of running configure is: + + $ ./configure +- and sometimes that's enough. configure accepts some command-line arguments, too, and you may need to provide some, depending on what your environment looks like. ++ and sometimes that's enough. configure accepts command-line arguments, too, and you may need to provide some, depending on what your environment looks like. + +-There are a few optional arguments to configure that may be important to you. For a complete list, see configure --help. ++There are a few optional arguments to configure that may be important to you. For a complete list, see configure --help. + + <command>configure</> options + +@@ -428,7 +435,7 @@ The TDS part of the name comes from name of the protocol used to + Things you can turn on + + +- Enable Microsoft behavior in the &dblib; API where it diverges from Sybase's. (For instance, Microsoft uses different names for the members of its date structure.) Typically needed only for porting Win32 applications to Unix. ++ Enable Microsoft behavior in the &dblib; API where it diverges from Sybase's. Use this option if you are replacing Microsoft's libraries with &freetds; + + This option specifies default behavior. Programs can change the default at compile time by defining MSDBLIB or SYBDBLIB (for Microsoft or Sybase behavior, respectively). + +@@ -548,9 +555,11 @@ and, sure enough, asprintf.c earlier includes win + + Which shouldn't be defined unless inttypes.h exists on your system. + +-Let's review: config.h defines a bunch of preprocessor definitions that (try to) describe your build environment to the compiler. In this example, it got one wrong, causing the compiler to look for a file that isn't present, creating the error. The solution is not to change the &freetds; source code, but merely to comment out line 92 in config.h. ++Let's review: config.h has preprocessor definitions that (try to) describe the build environment to the compiler. In this example, it got one wrong, causing the compiler to look for a file that isn't present, creating the error. The solution is not to change the &freetds; source code, but merely to comment out line 92 in config.h. + +-Perhaps you're shaking your head at such an old school approach. Over the years, Microsoft's proprietary project-configuration files have proved difficult to support. Every version is different, and there are a great many versions in use in the wild at any one time. As the project changes, it becomes impossible to maintain these kinds of files. ++Perhaps you're shaking your head at such an old school approach. Over the years, Microsoft's proprietary project-configuration files have proved difficult to support. Every version is different, and there are a great many versions in use in the wild at any one time. As the project changes, it becomes impossible to maintain these kinds of files. ++ ++ For Windows applications that use &freetds; the hard-won wisdom is just use the NMakefile, please, thanks! If you like a visual environment and visual debugging, no problem: Microsoft's tools support Makefile projects. The author has direct knowledge of developers for whom that arrangement works quite well. + + Other ways to build under Windows® + +@@ -607,7 +616,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + OS X® + +-As of this writing ($Date: 2011/03/12 12:54:01 $), the regular distribution compiles on OS X. Releases prior to 0.63 either did not compile or required patching. ++As of this writing ($Date: 2011/03/22 00:23:24 $), the regular distribution compiles on OS X. + + +@@ -740,21 +749,17 @@ Which shouldn't be defined unless inttypes.h exists on your + + + +-For best results, use the highest version of hte protocol supported by your server. If you encounter problems, try a lower version. If that works, though, please report it to the mailing list! ++For best results, use the highest version of the protocol supported by your server. If you encounter problems, try a lower version. If that works, though, please report it to the mailing list! ++ Want to help? Try out the auto-protocol feature. &freetds; has experimental support for iteratively trying protocol connections until it finds one the server accepts. This is suitable when query responses are non-trivial (because the tiny delay in connecting is thus insignificant). Try setting your TDS version to 0 and report your results. + +-TDS 4.2 has limitations +- ASCII only, of course. +- +- RPC is not supported. +- +- BCP is not supported. +- +- varchar fields are limited to 255 characters. If your table defines longer fields, they'll be truncated. +- +- dynamic queries (also called prepared statements) are not supported. +- +- +- ++ ++ TDS 4.2 has limitations ++ ASCII only, of course. ++ RPC is not supported. ++ BCP is not supported. ++ varchar fields are limited to 255 characters. If your table defines longer fields, they'll be truncated. ++ dynamic queries (also called prepared statements) are not supported. ++ + + The protocol version may also affect how database servers interpret + commands. For example, Microsoft SQL Server 2000 is known to behave differently with versions 4.2 +@@ -1690,8 +1695,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + + ClientCharset +- A name recognized by the iconv library linked to FreeTDS. +- This correspond to client charset in &freetdsconf;. ++ A name recognized by the iconv library linked to FreeTDS. Corresponds to client charset in &freetdsconf;. + ISO 8859-1 + Character set (encoding) used by the client. + +@@ -1722,21 +1726,20 @@ Which shouldn't be defined unless inttypes.h exists on your + + TextSize + Any +- DB dependent ++ Server-dependent + Maximum size returned from server for blobs. + + + PacketSize + Any +- DB dependent ++ Server-dependent + Size of packets to server. Some users saw some performance gain by increasing this value. Normally you shouldn't set it. + + + Trusted_Connection + Yes/No + No +- Use your current account instead of UID/PWD attributes. +- This option require SSPI or Kerberos. This superceed UID/PWD attributes. ++ Use your current account instead of UID/PWD attributes. This option require SSPI or Kerberos and supersedes any UID/PWD attributes passed from the application. + + + +@@ -1885,9 +1888,11 @@ Which shouldn't be defined unless inttypes.h exists on your + If tsql works and isql doesn't, you've isolated the problem to the ODBC setup. &freetds; might have some interoperability problems, but mere connection to the database isn't one of them! If tsql + doesn't work, turn on logging with TDSDUMP. The log will tell you what TCP/IP name (and address) FreeTDS is attempting to connect to, and what version of the TDS protocol it's using. + +- With iODBC ++ ++ With iODBC + +- iODBC comes with a sample command line query program called odbctest that is located in the iodbc/samples directory. Using this program you can get a listing of DSNs, connect, and issue queries. It is often useful to compile a program such as this directly against the &freetds; driver instead of using a driver manager. This makes it simpler to debug if something goes wrong. To do so, simply compile and install the ODBC driver with iODBC as normal When compiling directly to &freetds; you still need the Driver Manager's header files., then compile and link the program directly: ++ iODBC comes with a sample command line query program called odbctest, located in the iodbc/samples directory. Using this program you can get a listing of DSNs, connect, and issue queries. ++ For debugging purposes, you may wish to link a program such as odbctest directly to &freetds; instead of to the driver manager. Why? Once the program is started in the debugger, the driver entry points become viable breakpoints. Because the DM loads the driver dynamically with dlopen(3), no driver addresses even exist until the runtime linker loads it. To do so, compile and install the &odbc; driver with iODBC as normal When linking directly to &freetds; you still need the Driver Manager's header files., then compile and link the program: + + + Compile <filename>odbctest</> without a driver manager. +@@ -1896,7 +1901,7 @@ Which shouldn't be defined unless inttypes.h exists on your + $ gcc -g -o odbctest odbctest.o /usr/local/freetds/lib/libtdsodbc.a + + +- The ++ Now you can run gdb or another debugger and set breakpoints on functions in the library without the driver manager getting in the way. + + + With unixODBC +@@ -1961,8 +1966,10 @@ Which shouldn't be defined unless inttypes.h exists on your + | | + +---------------------------------------+ + SQL> +- +- ++ ++ ++The reader is here advised that the isql that comes with many versions of unixODBC will truncate text and surprise in other ways without warning. If it behaves strangely, try &freetds;'s bsqlodbc before you decide you've found a &freetds; bug. ++ + + + +@@ -2067,11 +2074,16 @@ Which shouldn't be defined unless inttypes.h exists on your + Domain Logins + Domain logins can be used only with TDS protocol versions 7.0 or above. + +-As mentioned in the installation chapter, Microsoft SQL Server includes the ability to use domain logins instead of standard server logins. The advantage of doing this is that the passwords are encrypted on the wire using a challenge-response protocol. ++As mentioned in the installation chapter, Microsoft SQL Server includes the ability to use domain ++ The term domain in this context is a Microsoft term. It refers to what's sometimes called an NT domain. It's unrelated to the DNS domain. DNS domains are used for name resolution. NT domains are used for authentication. Authentication is done by the domain controller, often the Primary Domain Controller (PDC). ++ The SQL Server machine may belong to an NT domain. &freetds; provides an encrypted password — a domain password, known to the domain controller — that the server will ask the domain controller to verify. ++logins instead of standard server logins. Passwords are encrypted on the wire using a challenge-response protocol. &freetds; plays nice with such logins. ++ ++&freetds; supports single sign-on (connecting without prompting for a username & password) or not, depending on how it was configured. For Windows hosts (both 32- and 64-bit), if SSPI is enabled, &freetds; will log in using so-called trusted authentication. For non-Windows hosts, enabling Kerberos provides similar functionality. + +-Domain logins may or may not support single sign-on (connecting without prompting for a password) depending on how &freetds; was configured. For Windows hosts (both 32- and 64-bit), if SSPI is enabled, &freetds; will log in using so-called "trusted authentication". For Linux (and similar) hosts, enabling Kerberos provides similar functionality. If neither option is enabled, &freetds; can still log in using the domain account, but the user must re-enter the password, as described next. ++When neither option is enabled, &freetds; can still log in using the domain account, but the user must supply the username & password. + +-To use domain logins, use the 'DOMAIN\username' syntax for the username and use the domain password. ++To use domain logins without SSPI or Kerberos, use the 'DOMAIN\username' syntax for the username and use the domain password. + Logging in with a domain login + + $ tsql -S camelot -U 'NOTTINGHAM\lancelot' -P roundtable +@@ -2082,10 +2094,7 @@ Which shouldn't be defined unless inttypes.h exists on your + 1> + + +- + When &freetds; sees the \ character, it automatically chooses a domain login. +- The term domain in this context is a Microsoft term. It refers to what's sometimes called an NT domain. It's unrelated to the DNS domain. DNS domains are used for name resolution. NT domains are used for authentication. Authentication is done by the domain controller, often the Primary Domain Controller (PDC). +-The SQL Server machine may belong to an NT domain. &freetds; provides an encrypted password — a domain password, known to the domain controller — that the server will ask the domain controller to verify. + + + Implementation details +@@ -2099,13 +2108,15 @@ Which shouldn't be defined unless inttypes.h exists on your + + + Kerberos Support +-Perhaps surprisingly, Kerberos can be used to authenticate to Microsoft SQL Servers. This affords single-signon (or, at most, double-signon) capability in non-Windows environment. The reason this works is that much of Active Directory is based on Kerberos. ++Perhaps surprisingly, ++ It works because much of Active Directory is based on Kerberos. From each according to his ability; to each according to his needs. ++Kerberos can be used to authenticate to Microsoft SQL Servers. This affords single-signon (or, at most, double-signon) capability in non-Windows environment. + +-To take advantage of Kerberos you have to set up your machine with keytab from your Active Directory. +- To configure your stuff you could use Samba or configure Kerberos directly (/etc/krb5.conf). configure includes options to define the location of your Kerberos installation (cf. ). ++To take advantage of Kerberos you have to set up your machine with keytab ++ No, the author does not really know what he's talking about. ++from your Active Directory. You could use Samba or configure Kerberos directly (/etc/krb5.conf). configure includes options to define the location of your Kerberos installation (cf. ). + +-By default UNIX does not initialize a Kerberos ticket with your login account. You have to use kinit to initialize a ticket. +- You could also configure Kerberos in PAM in order to initialize Kerberos ticket at login time. ++By default UNIX does not initialize a Kerberos ticket with your login account. You must use kinit to initialize a ticket. You could also configure Kerberos in PAM to initialize a Kerberos ticket at login time. + + + +@@ -2159,19 +2170,20 @@ Which shouldn't be defined unless inttypes.h exists on your + + TDS Connection Pooling + +-&freetds; 0.52 was the first to include a TDS Connection Pooling server. It lives in the src/pool directory. ++The Connection Pooling server swims in the src/pool directory. + +-The &freetds; connection pool is a server process, it acts just like a SQL Server. You can use any program to attach to it that you could use to attach to a real SQL Server. The pool in turn connects to the SQL Server and database you specify, and attempts to share these connections. See the README in the pool directory for a more detailed description of its inner workings. ++The &freetds; connection pool is a server process; it emulates a SQL Server. Any program that can attach to a real SQL Server may instead elect to attach to the pool server. The pool in turn connects to the SQL Server and database you specify, and attempts to share these connections. See the src/pool/README for a more detailed description of its inner workings. + +-To configure the pooling server, first make sure &freetds; has a working entry for the real SQL Server by connecting to it with SQSH or another program. +- The &freetds; connection pool currently only supports TDS version 4.2. This restriction applies to both the client-to-pool and pool-to-server connections! ++To configure the pool server, first make sure &freetds; has a working entry for the real SQL Server by connecting to it with SQSH or another program. ++ ++The &freetds; connection pool currently only supports TDS version 4.2. This restriction applies to both the client-to-pool and pool-to-server connections! + + + After FreeTDS has been installed, you will find an executable named tdspool in the /usr/local/bin directory (or whatever directory was specified with the configure + +-Next, edit the pool.conf file in the &freetds;'s etc directory. The pool.conf file is formatted like the &freetdsconf; with a section name in brackets and options for each section in key/value pairs. ++Edit pool.conf in the &freetds;'s etc directory. The pool.conf file is formatted like &freetdsconf;, with a section name in brackets and options for each section in key/value pairs. + +-Just like the &freetdsconf; file there are two types of sections, a [global] section whose options affect all pools, and a section with the name of the pool for pool-specific options. The following options are supported and may appear in either section. ++Just as in &freetdsconf; there are two types of sections, a [global] section whose options affect all pools, and a section with the name of the pool for pool-specific options. The following options are supported and may appear in either section. + + + pool.conf settings +@@ -2260,7 +2272,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + The [mypool] section defines a pool named mypool that will listen on port 5000. It will login to a SQL Server named fooserv using the user webuser and the ever so clever password of secret. Once logged in, the connections will use the database ebiz instead of webuser's default database. Also, since this SQL Server has a limited number of CALs (Client Access Licenses), we are restricting the maximum number of connections to 7, which overrides the global setting of 10. + +-Now you can run tdspool with the name of the pool you are serving. ++Run tdspool with the name of the pool you are serving. + + $ tdspool mypool + +@@ -2349,17 +2361,17 @@ Which shouldn't be defined unless inttypes.h exists on your + A non-interactive equivalent of the isql utility programs distributed by Sybase and Microsoft. Like them, bsqldb uses the command go on a line by itself as a separator between batches. The last batch need not be followed by go. + + +-bsqldb makes use of the db-lib API. Intended for production use. ++bsqldb makes use of the &dblib; API. Intended for production use. + + + + bsqlodbc + + +-A non-interactive equivalent of the isql utility programs distributed by Sybase and Microsoft. Like them, bsqlodbc uses the command go on a line by itself as a separator between batches. The last batch need not be followed by go. It uses the ODBC API. ++A non-interactive equivalent of the isql utility programs distributed by Sybase and Microsoft. Like them, bsqlodbc uses the command go on a line by itself as a separator between batches. The last batch need not be followed by go. It uses the &odbc; API. + + +-bsqlodbc is a demonstration project, but can also aid in isolating problems. ODBC applications typically have many layers, and it can be difficult to know if a problem arises in a layer, or in the interface between layers. By executing a query in bsqlodbc, you can see if the functionality of the ODBC driver works when used as the folks who wrote the driver thought it would be used. ++bsqlodbc is a demonstration project, but can also aid in isolating problems. &odbc; applications typically have many layers, and it can be difficult to know if a problem arises in a layer, or in the interface between layers. By executing a query in bsqlodbc, you can see if the functionality of the &odbc; driver works when used as the folks who wrote the driver thought it would be used. + + + +@@ -2372,7 +2384,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + datacopy will move table data from one server to another without the need for intermediate files. datacopy is much faster and more efficient than is freebcp out/in. + +-datacopy makes use of the db-lib bcp API. ++datacopy makes use of the &dblib; bcp API. + + + +@@ -2401,7 +2413,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + Replicates the functionality of the bcp utility programs distributed by Sybase and Microsoft. + +-freebcp makes use of the db-lib bcp API. ++freebcp makes use of the &dblib; bcp API. + + The manual pages or online help for Sybase or SQL Server can be referenced for more detailed information on bcp functionality. + +@@ -2419,7 +2431,7 @@ Which shouldn't be defined unless inttypes.h exists on your + tsql + + +-A diagnostic tool that uses uses the lowest level FreeTDS library, libtds, as a way to isolate potential bugs in the protocol implementation. ++A diagnostic tool that uses uses the lowest level &freetds; library, libtds, as a way to isolate potential bugs in the protocol implementation. + + tsql is not a replacement for a complete isql. + +@@ -2484,7 +2496,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + DBD::ODBC + +-You may also use DBD::ODBC with the &freetds; ODBC driver. You may find this attractive if you're familiar with DBD::ODBC. ++You may also use DBD::ODBC with the &freetds; &odbc; driver. You may find this attractive if you're familiar with DBD::ODBC. + + Sybperl + +@@ -2578,7 +2590,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + PHP + +-There are three options for building PHP with support for &freetds; corresponding to the three APIs that &freetds; supports: &dblib;, &ctlib;, and ODBC. ++There are three options for building PHP with support for &freetds; corresponding to the three APIs that &freetds; supports: &dblib;, &ctlib;, and &odbc;. + All these examples build the CGI version. Consult PHP's documentation for building the Apache module and including other extensions. + + &dblib; +@@ -2624,9 +2636,9 @@ Which shouldn't be defined unless inttypes.h exists on your + We hope an upcoming version of PHP will automatically detect the presence of &freetds; and include only the -lct library. + + +- <systemitem class="library">ODBC</systemitem> ++ &odbc; + +-The third and newest option is to use the &freetds; ODBC driver with PHP. First build the iODBC or unixODBC driver manager and &freetds; as detailed in . Then build PHP with support for ODBC. ++The third and newest option is to use the &freetds; &odbc; driver with PHP. First build the iODBC or unixODBC driver manager and &freetds; as detailed in . Then build PHP with support for ODBC. + + $ cd php + $ ./configure --with-iodbc=/usr/local +@@ -2690,24 +2702,24 @@ Which shouldn't be defined unless inttypes.h exists on your + + ODBC on Unix + +-ODBC have many issues under Unix mainly due to lack of specifications. +- ++&odbc; has some issues on Unix, mainly due to lack of clean specifications. ++ + ODBC and 64-bit + +-ODBC was originally specified as 32-bitIn fact, the earliest versions were 16-bit.. Its evolution to 64-bit took place in the absence of a good specification which led to conflicting declarations and associated problems. For instance, some parameters are defined as SQLINTEGER but are used for pointer offsets. But SQLINTEGER was (and remains) 32-bit, while pointer offsets must be 64-bit. Also row numbers and some other formerly 32-bity quantities are now 64-bit. ++ODBC was originally specified as 32-bitIn fact, the earliest versions were 16-bit.. Its evolution to 64-bit took place in the absence of a good specification which led to conflicting declarations and associated problems. For instance, some parameters are defined as SQLINTEGER but are used for pointer offsets. But SQLINTEGER was (and remains) 32-bit, while pointer offsets must be 64-bit. Also row numbers and some other formerly 32-bit quantities are now 64-bit. + + If you use unixODBC Frediano would recommend at least version 2.2.14. Earlier versions have issues if used on 64-bit environments. + +- ++ + sizeof(SQLWCHAR) + +-Under Windows sizeof(wchar_t) == sizeof(SQLWCHAR) == 2 but on many Unix systems you have sizeof(wchar_t) == 4. And some DMs decided to keep sizeof(SQLWCHAR) == 2 (including unixODBC) while in other DM sizeof(SQLWCHAR) == sizeof(wchar_t) == 4 (namely iODBC). This leads to incompatibile ABIs between applications and drivers. If you compile the &freetds; ODBC driver using iODBC take care to ensure all drivers are compiled with the same header files. ++Under Windows sizeof(wchar_t) == sizeof(SQLWCHAR) == 2 but on many Unix systems you have sizeof(wchar_t) == 4. And some DMs decided to keep sizeof(SQLWCHAR) == 2 (including unixODBC) while in other DM sizeof(SQLWCHAR) == sizeof(wchar_t) == 4 (namely iODBC). This leads to incompatible ABIs between applications and drivers. If you compile the &freetds; ODBC driver using iODBC take care to ensure all drivers are compiled with the same header files. + + Alternatively, compile &freetds; with both includes and rename the library to use two ABIs (for instance having a libtdsiodbc.so and a libtdsuodbc.so). + +-As of the time of writing Ubuntu compiled Qt using iODBC but most packages use unixODBC. If you plan to use Qt with the &freetds; ODBC driver, you should have an iODBC-compatible driver. Also be aware that the QODBC Qt driver has problems with iODBC and SQLWCHAR (see Qt). Due to these problems Frediano suggests not to use this configuration (Qt database) on Ubuntu at this time. ++At the time of writing Ubuntu compiled Qt using iODBC but most packages use unixODBC. If you plan to use Qt with the &freetds; &odbc; driver, you should have an iODBC-compatible driver. Also be aware that the QODBC Qt driver has problems with iODBC and SQLWCHAR (see Qt). Due to these problems Frediano suggests not using this configuration (Qt database) on Ubuntu at this time. + +- ++ + Default charset + + Character encoding is yet another trap. ODBC makes no provision for specifying client character encoding. By default many DM converting from multi-byte to wide characters assume the client uses ISO 8859-1. Even the &freetds; driver assumes ISO 8859-1 by default. Also some DM have problems converting multi-byte encodings (like UTF-8), by assuming a byte can be converted to a single wide character (and vice versa). That creates problems if you use multi-byte encoding for &freetds; driver. +@@ -2725,6 +2737,26 @@ Which shouldn't be defined unless inttypes.h exists on your + + + Known Issues ++ ++ ++ Porting Issues ++ ++ ++ Date Structures and Offsets ++ ++Microsoft and Sybase use different &dblib; date structures and conventions. Notably months can by [0,11] or [1,12]. Pay careful attention to the results of dbdatecrack(). ++ ++ ++ ++ Floating Point ++ ++Precision may surprise you if you pay attention. Microsoft's &dblib; promotes single-precision to double in dbbind() by appending zeros; C promotes it to the nearest double. &freetds; relies on the C compiler. ++ ++Math libraries vary, too. If porting an application whose output uses functions such at log(3), expect differences in different implementations. Perfectly consistent results between OSes will require the use of a single math library. ++ ++ ++ ++ + + <type>Text</type> Fields + +@@ -2746,8 +2778,9 @@ Which shouldn't be defined unless inttypes.h exists on your + + Another way to handle control the default TEXTSIZE is to use the setting in &freetdsconf;. + +- +- Endianism ++ ++ ++ Endianism + + If either your server or your client is a big endian system, pay careful attention to all references to endianism anywhere near &freetds;. See the section on Little Endian Emulation for details. + +@@ -2761,7 +2794,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + Microsoft's <quote>Integrated Security</quote> + +-&freetds; may be unable to connect to the server. The error message that appears will be "Login failed for user 'example'. Reason: Not associated with a trusted SQL Server connection". To solve this, turn on SQL Server authentication: ++&freetds; may be unable to connect to the server. The error message will be "Login failed for user 'example'. Reason: Not associated with a trusted SQL Server connection". To solve this, turn on SQL Server authentication: + + Open the SQL Server Enterprise Manager, + +@@ -2778,46 +2811,16 @@ Which shouldn't be defined unless inttypes.h exists on your + + + These instructions apply to Microsoft SQL Server 7 and SQL Server 2000. +- +- <productname>SQL Server</productname>'s Security Model + +-Microsoft supports two security models in three permutations: +- +- +- Windows NT Authentication Mode. The operating system performs authentication; users will not have explicit SQL Server accounts. +- +- Standard Mode. SQL Server authenticates connections itself without consulting the operating system. Users of course need SQL Server accounts to log in. +- +- Mixed Mode Combines the above two. +- +- +- For normal operation, you need either Standard or Mixed mode. +- +-Windows NT Authentication, often called integrated security, +- relies on Microsoft's domain login. In it, a user's network security attributes are established at network login time. When connecting to the database server, SQL +- Server uses the facilities of the host operating system (Windows NT or similar) to determine the authenticated network username. +- SQL Server then permits or denies login access based on that network +- username alone, without requiring a separate login name and password. +- The &freetds; supports integrated security mode. If you have SQL Server running in integrated (domain) mode along with a Windows PDC, and wish to try it, see Domain Logins in the Advanced Configurations chapter. If you have Active Directory you can also use Kerberos, see Kerberos support. ++&freetds; supports integrated security mode, too. If you have SQL Server running in integrated (domain) mode along with a Windows PDC, and wish to try it, see Domain Logins in the Advanced Configurations chapter. If you have Active Directory you can also use Kerberos, see Kerberos support. + + +-&freetds; supports the traditional database +- security model, which Microsoft terms SQL Server +- Authentication but is frequently known as standard +- security. Username+Password pairs have to be passed to the +- server explicitly. +- +-Mixed Mode allows users to connect using either authentication +- method. Users who connect through a Windows NT account can make use +- of trusted connections in either Windows NT Authentication Mode or +- Mixed Mode. After successful connection to SQL +- Server, the security mechanism is the same for both +- modes. +- + + ++ + + Is the server there? ++ + + Start with <command>ping</> + +@@ -2829,13 +2832,13 @@ Which shouldn't be defined unless inttypes.h exists on your + $ ping -c1 myhost + + PING myhost (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data. +- 64 bytes from myhost (127.0.0.1): icmp_seq=0 ttl=255 time=250 usec +- ++ 64 bytes from myhost (127.0.0.1): icmp_seq=0 ttl=255 time=250 usec + + A successful ping shows that your network isn't preventing you from reaching the machine hosting the server. + ++ + +- Test with <command>telnet</> ++ Test with <command>telnet</> + + Attempt to telnet to the port, to verify that the servername is listening. + +@@ -2845,16 +2848,15 @@ Which shouldn't be defined unless inttypes.h exists on your + + Trying 127.0.0.1... + Connected to myhost. +- Escape character is '^]'. +- ++ Escape character is '^]'. + +- If you get output as above, the servername is listening. If you get a 'Connection Refused' message, you're talking to the wrong host, wrong port, or the servername is down. +- To exit telnet: When connected, telnet's command mode may be entered by +- typing the telnet escape character (initially Ctrl-], as above). Once in command mode, telnet may be exited with the command quit. ++If you get output as above, the servername is listening. If you get a 'Connection Refused' message, you're talking to the wrong host, wrong port, or the servername is down. ++ To exit telnet: When connected, telnet's command mode may be entered by typing the telnet escape character (initially Ctrl-], as above). Once in command mode, telnet may be exited with the command quit. + ++ + + +- Test with <command>tsql</> ++ Test with <command>tsql</> + + tsql can be run in two ways, one which uses &freetdsconf; and one which connects directly using the host and port. First attempt a connection using host and port. + +@@ -2867,9 +2869,9 @@ Which shouldn't be defined unless inttypes.h exists on your + + If you receive a message like + +- +- Msg. No.: 18450 Severity: 14 State: 1 Login failed- User: loginid Reason: Not defined as a valid user of a trusted SQL Server connection +- ++ Msg. No.: 18450 Severity: 14 State: 1 Login failed- User: loginid ++ Reason: Not defined as a valid user of a trusted SQL Server connection ++ + SQL Server is accepting only domain logins. This applies only to Microsoft SQL Server and you'll need to have your DBA verify that server logins are allowed, or use a domain login. + + Finally, if you received a prompt, then try tsql using the servername. +@@ -2881,8 +2883,9 @@ Which shouldn't be defined unless inttypes.h exists on your + If this fails, FreeTDS is either not finding your &freetdsconf; file, finding the wrong one, or there is an error in the file. + + ++ + +- Logging ++ Logging + + &freetds; has quite extensive logging capabilities. These are often invaluable in setting up new configurations, when it's hard to be sure precisely what configuration information is being used, and what communication is (not) working. Often such questions can be quickly resolved by turning on logging and examining the logs. + Environment Variables that Control Logging +@@ -2895,7 +2898,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + $ export TDSDUMP=/tmp/freetds.log + Will generate a log file named freetds.log in the /tmp directory. +- The filenames stdout and stderr are also supported. They can be handy if you want to intersperse the log output with your application's output, or if your application opens more than one connection. (The logfile is otherwise normally truncatated each time the library connects to the server.) ++ The filenames stdout and stderr are also supported. They can be handy if you want to intersperse the log output with your application's output, or if your application opens more than one connection. (The logfile is otherwise normally truncated each time the library connects to the server.) + + + +@@ -3054,13 +3057,14 @@ Which shouldn't be defined unless inttypes.h exists on your + + #define NOREVERSELOOKUPS + +- in src/tds/config.c, rebuilding, and reinstalling. +- Reverse lookup code has been removed as of version 0.62 due to wrong implementation. ++ ++in src/tds/config.c, rebuilding, and reinstalling. ++ ++ Reverse lookup code has been removed as of version 0.62 because it was poorly implemented. + + + +-Packet size. Check packet size setting on &freetdsconf; (see initial block size). Default value (no configuration) is usually fine. The slowness is due to multiple packet to use. +- Under GNU/Linux system we use an optimization to reduce network traffic so you shouldn't see much difference using this system. ++Packet size. The default packet size setting in &freetdsconf; (see initial block size) is usually fine. Slowness can potentially be due to multiple packet to use. Under GNU/Linux system we use an optimization to reduce network traffic; you shouldn't see much difference using this system. + + + +@@ -3101,8 +3105,7 @@ Compile-time settings (established with the "configure" script) + iODBC: no + unixodbc: no + SSPI "trusted" logins: no +- Keberos: no +- ++ Keberos: no + + For &odbc; setup issues, the osql script is intended to confirm the configuration files are all sane. If it fails to report a problem, please post a message describing the problem to the mailing list. Thanks. + +@@ -3236,7 +3239,7 @@ For &odbc; setup issues, the osql script is intended to confi + + We have just begun an independent reference manual to &freetds;; the main API documents are the work of the server vendors. We're using Doxygen, which extracts documentation directly from comments in the source code, and we're maybe 25% done. + +-The TDS protocol is partly documented, as are the APIs to libtds and db-lib, but much remains. ++The TDS protocol is partly documented, as are the APIs to libtds and &dblib;, but much remains. + + + Be the Webmaster +@@ -3289,7 +3292,8 @@ For &odbc; setup issues, the osql script is intended to confi + What can &freetds; do that can't be done any other way? Glad you asked. &freetds; can + + Connect to every version of either vendor's server, using the same binaries. +- Provide a &ctlib; interface to Microsoft SQL Server. This feature alone allows DBD::Sybase and sqsh, among others, to connect to Microsoft's product. ++ Provide a &ctlib; for Microsoft SQL Server. This feature alone allows DBD::Sybase and sqsh, among others, to connect to Microsoft's product. ++ Provide a modern &dblib; for Microsoft SQL Server: Win32/64, and TDS 7+. + Provide a bcp-capable interface and command-line utility on unix-like operating systems for Microsoft SQL Server. + Run on many more operating systems than either vendor's libraries do. + Get fixed, instead of telling you to get stuffed. +@@ -3313,7 +3317,7 @@ For &odbc; setup issues, the osql script is intended to confi + + The reference manual is installed as part of FreeTDS. It can be regenerated at any time using Doxygen with cd doc; make doc. + +-The reference manual is a work in progress: only the db-lib library is completely documented, and quite minimally at that. Should you find it inadequate, you may be interested to learn it's not hard to add to, technically. Doxygen generates a manual from encoded comments in the source code. Its markup syntax is not hard to learn. You can read more about it at the Doxygen website. ++The reference manual is a work in progress: only &dblib; is completely documented, and quite minimally at that. Should you find it inadequate, you may be interested to learn it's not hard to add to, technically. Doxygen generates a manual from encoded comments in the source code. Its markup syntax is not hard to learn. You can read more about it at the Doxygen website. + + Basic API coverage information for the db-lib, ct-lib, and ODBC client libraries is maintained in doc/api_status.txt, included in the source distribution. For your convenience and enjoyment, we include that file in the following sections. In each table, we note for the function + Sybase and Microsoft sometimes use slightly different names for the same function. It is the intention of the + + +- db-lib API Implementation Summary ++ &dblib; API Implementation Summary + +-Microsoft's version of db-lib is ++Microsoft's version of &dblib; is + online. + Sybase's is both + online +@@ -3394,7 +3398,7 @@ For &odbc; setup issues, the osql script is intended to confi + + Few things are harder to put up with than the annoyance of a good example. + +- Below is a complete sample working db-lib program, presented as a series of examples. ++ Below is a complete sample working &dblib; program, presented as a series of examples. + Features of sample code + Processes command-line options to select the server, database, username, and password + Remaining arguments on the command line comprise the SQL query to execute +@@ -3409,7 +3413,7 @@ For &odbc; setup issues, the osql script is intended to confi + + Correct handling of errors is extremely important in database applications because they involve two systems most others don't: the network and the database server. Both can give rise to errors that, if not detected and reported when they occur, let the application proceed blithely on until something truly mysterious happens. In the worst case, in the absence of a properly reported error, the application may seem to have updated the data, when in fact it did not. + +-Every db-lib application uses the network, making it subject to network failures. Database programs also almost always have very high data integrity requirements. It is necessary to know the row was absolutely, positively committed, once and only once, without error or exception. Without taking great care to trap and handle all error conditions, no statement about the program's reliability can be made with confidence. ++Every &dblib; application uses the network, making it subject to network failures. Database programs also almost always have very high data integrity requirements. It is necessary to know the row was absolutely, positively committed, once and only once, without error or exception. Without taking great care to trap and handle all error conditions, no statement about the program's reliability can be made with confidence. + + + How to Get and Build the sample code +@@ -3438,11 +3442,11 @@ For &odbc; setup issues, the osql script is intended to confi + We now proceed to the code proper. + + Header files +- We need two header files to use db-lib. We need a few others to deal with I/O in C, as you know. Also declare the error and message handler functions, more about which later. ++ We need two header files to use &dblib;. We need a few others to deal with I/O in C, as you know. Also declare the error and message handler functions, more about which later. + + + +- Sample Code: <symbol>db-lib</> header files ++ Sample Code: &dblib; header files + + +@@ -3467,7 +3471,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + +- Sample Code: <symbol>db-lib</> prolog ++ Sample Code: &dblib; prolog + + extern char *optarg; + extern int optind; +@@ -3528,7 +3532,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + DBPROCESS is a structure that describes the connection. It is returned by dbopen(). + + +-RETCODE is the most common return code type for db-lib functions. ++RETCODE is the most common return code type for &dblib; functions. + + + +@@ -3537,7 +3541,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + +- Sample Code: <symbol>db-lib</> Initialize ++ Sample Code: &dblib; Initialize + + + +@@ -3585,7 +3589,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + +- Sample Code: <symbol>db-lib</> Connect to the server ++ Sample Code: &dblib; Connect to the server + + if ((dbproc = dbopen(login, options.servername)) == NULL) { + fprintf(stderr, "%s:%d: unable to connect to %s as %s\n", +@@ -3604,13 +3608,13 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + Send a query +- db-lib maintains a command buffer to hold the SQL to be sent to the server. Two functions — dbcmd() and dbfcmd() — build up the query from strings of text. The command buffer is reset after the query is sent to the server. ++ &dblib; maintains a command buffer to hold the SQL to be sent to the server. Two functions — dbcmd() and dbfcmd() — build up the query from strings of text. The command buffer is reset after the query is sent to the server. + + We left the SQL on the command line. We fetch it now and send it to the server. + + + +- Sample Code: <symbol>db-lib</> Send a query ++ Sample Code: &dblib; Send a query + + for (i=0; i < argc; i++) { + assert(argv[i]); +@@ -3637,7 +3641,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + Fetch Results +- A query may produce zero, one, or more results. Broadly, that entails providing buffers to db-lib to fill, and iterating over the results a row (and column) at a time. ++ A query may produce zero, one, or more results. Broadly, that entails providing buffers to &dblib; to fill, and iterating over the results a row (and column) at a time. + + Kinds of Results + +@@ -3747,16 +3751,16 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + Binding + + +-Each time dbresults() returns SUCCEED, there is something to retrieve. db-lib has different functions to deal with the different kinds of results. The functions are of two kinds: those that convert the data into a form desired by the application, known as binding, and those that return the data in native form. ++Each time dbresults() returns SUCCEED, there is something to retrieve. &dblib; has different functions to deal with the different kinds of results. The functions are of two kinds: those that convert the data into a form desired by the application, known as binding, and those that return the data in native form. + + + To understand binding, it may be easiest to examine two primitive functions, dbdata() and dbconvert(). dbdata() returns a pointer to the column's data. The data to which it points are in native form, 4 bytes for an INT, 8 bytes for a DATETIME and so on. dbconvert() converts between datatypes; you can hand it an integer and get back a character array (or a C double. You might think of dbconvert() as atoi(3) on steroids). dbbind() combines these two functions. The application indicates in what form it would like to use each column, and the library converts them on the fly as each row is read. + + +-To bind a column is to provide a buffer to db-lib to fill and indicate which datatype the buffer is meant to hold. This is the sort of thing C++'s type system does so much better ++To bind a column is to provide a buffer to &dblib; to fill and indicate which datatype the buffer is meant to hold. This is the sort of thing C++'s type system does so much better + + +-It may be well to pause here to observe the three ways a datatype is described in a db-lib program. ++It may be well to pause here to observe the three ways a datatype is described in a &dblib; program. + <function>db-lib</> Datatype Descriptors + + Sever Datatype +@@ -3782,7 +3786,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + +-Typically it's more convenient to have db-lib convert the data into the desired form. The function that does that is dbind(). So: after fetching the metadata, and before fetching the data, we usually prepare the bound columns. ++Typically it's more convenient to have &dblib; convert the data into the desired form. The function that does that is dbind(). So: after fetching the metadata, and before fetching the data, we usually prepare the bound columns. + + Fetching Data + +@@ -3896,14 +3900,14 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + Fetch All Rows! +- db-lib doesn't insist every column — or even any column — be bound or otherwise retrieved into the application's variables. There is, however, one absolutely crucial, inflexible, unalterable requirement: the application must process all rows produced by the query. Before the DBPROCESS can be used for another query, the application must either fetch all rows, or cancel the results and receive an acknowledgement from the server. Cancelling is beyond the scope of this document, so for now fetch all rows. ++ &dblib; doesn't insist every column — or even any column — be bound or otherwise retrieved into the application's variables. There is, however, one absolutely crucial, inflexible, unalterable requirement: the application must process all rows produced by the query. Before the DBPROCESS can be used for another query, the application must either fetch all rows, or cancel the results and receive an acknowledgement from the server. Cancelling is beyond the scope of this document, so for now fetch all rows. + + + Now, at last, some sample code that fetches data. In the interest of simplicity, we don't bind anything except regular rows. + + + +- Sample Code: <symbol>db-lib</> Fetch Results ++ Sample Code: &dblib; Fetch Results + + while ((erc = dbresults(dbproc)) != NO_MORE_RESULTS) { + struct COL +@@ -4023,7 +4027,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + Data-fetching Notes + As soon as dbresults() reports SUCCESS, the row's metadata are available. +- db-lib columns start with 1. ++ &dblib; columns start with 1. + dbcollen() returns the sizeof the native data (e.g. 4 bytes for a T-SQL INT). We'll use dbbind() to convert everything to strings. If the column is [VAR]CHAR, we want the column's defined size, otherwise we want its maximum size when represented as a string, which FreeTDS's dbwillconvert() returns (for fixed-length datatypes). For IMAGE data, we need to multiply by 2, because dbbind() will convert each byte to a hexadecimal pair. The example program will report an error with IMAGE data. + NTBSTRINGBIND null-terminates the character array for us. NTB might perhaps stand for null terminating byte. + A zero-length string is not a NULL! dbnullbind() arranges for the passed buffer to be set to -1 whenever that column is NULL for a particular row. +@@ -4033,7 +4037,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + + + Messages and Errors +- Errors may originate on the server or in the library itself. The former are known as messages (because they are: they arrive as messages from the server); the latter are termed errors. Their handling is a little intimidating. It requires writing and installing a callback function (whose parameters are predefined by db-lib), and thinking about how to handle different types of errors. ++ Errors may originate on the server or in the library itself. The former are known as messages (because they are: they arrive as messages from the server); the latter are termed errors. Their handling is a little intimidating. It requires writing and installing a callback function (whose parameters are predefined by &dblib;), and thinking about how to handle different types of errors. + + Kinds of Errors + +@@ -4047,7 +4051,7 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + Errors + + +-Errors arise either because the application has misused db-lib in some way — say, passed a NULL DBPROCESS pointer or tried to issue a query while results were pending — or because some trouble cropped up in communicating with the server (couldn't find it, say, or didn't hear back from it). ++Errors arise either because the application has misused &dblib; in some way — say, passed a NULL DBPROCESS pointer or tried to issue a query while results were pending — or because some trouble cropped up in communicating with the server (couldn't find it, say, or didn't hear back from it). + + + +@@ -4055,11 +4059,11 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + Why these two require distinct handling is lost in the mists of time. But it does help to keep them distinct in your mind, especially while reading the documentation. + + +-To have db-lib use your handler, pass its name to the appropriate dberrhandle() or dbmsghandle() function immediately after calling dbinit(). ++To have &dblib; use your handler, pass its name to the appropriate dberrhandle() or dbmsghandle() function immediately after calling dbinit(). + + + +- Sample Code: <symbol>db-lib</> Error and Message handlers ++ Sample Code: &dblib; Error and Message handlers + + int + msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, +@@ -4119,8 +4123,8 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + Severities are defined in the server documentation, and can be set by the T-SQL RAISERROR statement. + Message handlers always and only ever return zero. + When first writing the handler, pay careful attention to the precise type of each parameter. Only by carefully matching them will you convince a modern C compiler that the address of your function is of the type accepted by dberrhandle(). If that advice sounds familiar, it's because it bears repeating. +- Some messages are so severe they provoke db-lib into calling the error handler, too! If you have both installed — and of course you do, right? — then you can skip those lacking an error number. +- While INT_CANCEL is the most common return code, it's not the only one. For one thing, the error handler's return code can control how long db-lib keeps retrying timeout errors. See the documentation for details. ++ Some messages are so severe they provoke &dblib; into calling the error handler, too! If you have both installed — and of course you do, right? — then you can skip those lacking an error number. ++ While INT_CANCEL is the most common return code, it's not the only one. For one thing, the error handler's return code can control how long &dblib; keeps retrying timeout errors. See the documentation for details. + + + +@@ -4135,13 +4139,13 @@ int msg_handler(DBPROCESS*, DBINT, int, int, char*, char*, char*, int); + getuserdata(). + + +- If your application is written in C++, you may be tempted to use throw(). Don't! Your handler is a C function and, more important, it's an extension of db-lib. You can put a throw() in your handler and it will compile. But when it executes, it's going to rip through db-lib's stack. Your application will be unuseable at that point, if it doesn't cause a segment fault. ++ If your application is written in C++, you may be tempted to use throw(). Don't! Your handler is a C function and, more important, it's an extension of &dblib;. You can put a throw() in your handler and it will compile. But when it executes, it's going to rip through &dblib;'s stack. Your application will be unuseable at that point, if it doesn't cause a segment fault. + + + + Last Remarks + +-We've reached the end of our db-lib tour. The almost 300 lines of C above constitute program with these features: ++We've reached the end of our &dblib; tour. The almost 300 lines of C above constitute program with these features: + Sample Code features</> + <listitem><para>Accepts command-line parameters and SQL.</para></listitem> + <listitem><para>Checks for errors and server messages.</para></listitem> +@@ -4529,6 +4533,7 @@ Important to understand: <command>ldd</command> is <emphasis>not</emphasis> figu + <para>The linker, static or runtime, uses only the function's name to resolve references. Function parameters and semantics are invisible to it. </para> + + <para>The programmer and, to a lesser degree, the sysadmin direct the choice of which library to link to an executable. A missing function will prevent execution. A wrong function will promote wrong execution. Don't do that. </para> ++ + </section> + </Appendix> + + +commit 89d5fb43106ee5fb41168ea5839f76a96e313142 +Author: jklowden <jklowden> +Date: Tue Mar 22 00:41:31 2011 +0000 + + updated for upcoming release + +diff --git a/doc/userguide.sgml b/doc/userguide.sgml +index 80f95bc..6eb480a 100644 +--- a/doc/userguide.sgml ++++ b/doc/userguide.sgml +@@ -8,13 +8,13 @@ + <!ENTITY dblib '<systemitem class="library">DB-Library</systemitem>'> + <!ENTITY ctlib '<systemitem class="library">CT-Library</systemitem>'> + <!ENTITY odbc '<systemitem class="library">ODBC</systemitem>'> +- <!ENTITY version "0.92"> <!-- echo '0.84 + 0.5 * (1.0 - 0.84)' --> ++ <!ENTITY version "0.91"> <!-- echo $(( (100 - 82)/2 + 82))--> + <!ENTITY freetdsconf "<filename>freetds.conf</filename>"> + ]> + <book> + <bookinfo> +- <date>$Date: 2011/03/22 00:23:24 $</date> +- <releaseinfo>$Revision: 1.135 $</releaseinfo> ++ <date>$Date: 2011/03/22 00:41:31 $</date> ++ <releaseinfo>$Revision: 1.136 $</releaseinfo> + <title>&freetds; User Guide + A Guide to Installing, Configuring, and Running &freetds; + +@@ -63,9 +63,9 @@ + + The version you're reading is: + +- $Revision: 1.135 $ +- $Date: 2011/03/22 00:23:24 $ +- CVS control number $Id: userguide.sgml,v 1.135 2011/03/22 00:23:24 jklowden Exp $. ++ $Revision: 1.136 $ ++ $Date: 2011/03/22 00:41:31 $ ++ CVS control number $Id: userguide.sgml,v 1.136 2011/03/22 00:41:31 jklowden Exp $. + + + can be found on the &freetds; +@@ -616,7 +616,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + OS X® + +-As of this writing ($Date: 2011/03/22 00:23:24 $), the regular distribution compiles on OS X. ++As of this writing ($Date: 2011/03/22 00:41:31 $), the regular distribution compiles on OS X. + + + +commit ef6aecb2f6ebec3e23546e34fb02168b91eb8e32 +Author: jklowden +Date: Tue Mar 22 13:11:14 2011 +0000 + + updated for upcoming release + +diff --git a/doc/userguide.sgml b/doc/userguide.sgml +index 6eb480a..b154ca1 100644 +--- a/doc/userguide.sgml ++++ b/doc/userguide.sgml +@@ -13,8 +13,8 @@ + ]> + + +- $Date: 2011/03/22 00:41:31 $ +- $Revision: 1.136 $ ++ $Date: 2011/03/22 13:11:14 $ ++ $Revision: 1.137 $ + &freetds; User Guide + A Guide to Installing, Configuring, and Running &freetds; + +@@ -63,9 +63,9 @@ + + The version you're reading is: + +- $Revision: 1.136 $ +- $Date: 2011/03/22 00:41:31 $ +- CVS control number $Id: userguide.sgml,v 1.136 2011/03/22 00:41:31 jklowden Exp $. ++ $Revision: 1.137 $ ++ $Date: 2011/03/22 13:11:14 $ ++ CVS control number $Id: userguide.sgml,v 1.137 2011/03/22 13:11:14 jklowden Exp $. + + + can be found on the &freetds; +@@ -616,7 +616,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + OS X® + +-As of this writing ($Date: 2011/03/22 00:41:31 $), the regular distribution compiles on OS X. ++As of this writing ($Date: 2011/03/22 13:11:14 $), the regular distribution compiles on OS X. + + +@@ -745,6 +745,10 @@ Which shouldn't be defined unless inttypes.h exists on your + 7.2 + Includes support for varchar(max), varbinary(max), xml datatypes and MARSMultiple Active Result Sets. &freetds; does not support MARS.. + ++ ++ Microsoft SQL Server 2008 ++ 7.2 (unchanged) ++ + + +
+ +commit dfab441387bc2cac0d51f37a836ac1e0d9a7360c +Author: jklowden +Date: Tue Mar 22 16:00:44 2011 +0000 + + updated for upcoming release + +diff --git a/doc/userguide.sgml b/doc/userguide.sgml +index b154ca1..de05057 100644 +--- a/doc/userguide.sgml ++++ b/doc/userguide.sgml +@@ -13,8 +13,8 @@ + ]> + + +- $Date: 2011/03/22 13:11:14 $ +- $Revision: 1.137 $ ++ $Date: 2011/03/22 16:00:44 $ ++ $Revision: 1.138 $ + &freetds; User Guide + A Guide to Installing, Configuring, and Running &freetds; + +@@ -63,9 +63,9 @@ + + The version you're reading is: + +- $Revision: 1.137 $ +- $Date: 2011/03/22 13:11:14 $ +- CVS control number $Id: userguide.sgml,v 1.137 2011/03/22 13:11:14 jklowden Exp $. ++ $Revision: 1.138 $ ++ $Date: 2011/03/22 16:00:44 $ ++ CVS control number $Id: userguide.sgml,v 1.138 2011/03/22 16:00:44 jklowden Exp $. + + + can be found on the &freetds; +@@ -328,7 +328,7 @@ The TDS part of the name comes from name of the protocol used to + The simplest form of running configure is: + + $ ./configure +- and sometimes that's enough. configure accepts command-line arguments, too, and you may need to provide some, depending on what your environment looks like. ++ and sometimes that's enough. configure accepts command-line arguments, too, and you may need to provide some, depending on your environment.
+ + There are a few optional arguments to configure that may be important to you. For a complete list, see configure --help. + +@@ -449,14 +449,13 @@ The TDS part of the name comes from name of the protocol used to + + + +- Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket. +- This require you to configure Kerberos support on your machine. ++ Enable Kerberos support. With Kerberos you can connect to server using your stored Kerberos ticket. Obviously requires Kerberos be configured on the machine. + + + + + +- Enable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged account for authentication. With this option enabled, FreeTDS supports "trusted logins" for Win32/64, just as Microsoft's own implmentations do. ++ Enable SSPI support. SSPI is a Micrsoft library that allows you to use your current logged-in account for authentication. With this option enabled, FreeTDS supports "trusted logins" for Win32/64, just as Microsoft's own implementations do. + + + +@@ -512,6 +511,17 @@ The TDS part of the name comes from name of the protocol used to + You normally need to be root to make install, unless you used the + + With any luck, you've built and installed the &freetds; libraries. ++ ++ ++ Two bits of advice, if you like to keep things tidy and keep track of what you did. ++ ++ Create a file to hold your configure options called, say, .build_options. ++ ++ Create a build directory for the binaries, and invoke ../configure $(cat ../.build_options). ++ ++ This approach lets you remove the binaries at any time and rebuild from scratch using the same options ++ ++ + + +
+@@ -616,7 +626,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + OS X® + +-As of this writing ($Date: 2011/03/22 13:11:14 $), the regular distribution compiles on OS X. ++As of this writing ($Date: 2011/03/22 16:00:44 $), the regular distribution compiles on OS X. + + + +commit d796ef604f8988874b91b8e6719663a38d9b1f05 +Author: jklowden +Date: Tue Mar 22 16:03:44 2011 +0000 + + updated for upcoming release + +diff --git a/doc/userguide.sgml b/doc/userguide.sgml +index de05057..de9133f 100644 +--- a/doc/userguide.sgml ++++ b/doc/userguide.sgml +@@ -13,8 +13,8 @@ + ]> + + +- $Date: 2011/03/22 16:00:44 $ +- $Revision: 1.138 $ ++ $Date: 2011/03/22 16:03:44 $ ++ $Revision: 1.139 $ + &freetds; User Guide + A Guide to Installing, Configuring, and Running &freetds; + +@@ -63,9 +63,9 @@ + + The version you're reading is: + +- $Revision: 1.138 $ +- $Date: 2011/03/22 16:00:44 $ +- CVS control number $Id: userguide.sgml,v 1.138 2011/03/22 16:00:44 jklowden Exp $. ++ $Revision: 1.139 $ ++ $Date: 2011/03/22 16:03:44 $ ++ CVS control number $Id: userguide.sgml,v 1.139 2011/03/22 16:03:44 jklowden Exp $. + + + can be found on the &freetds; +@@ -519,7 +519,7 @@ The TDS part of the name comes from name of the protocol used to + + Create a build directory for the binaries, and invoke ../configure $(cat ../.build_options). + +- This approach lets you remove the binaries at any time and rebuild from scratch using the same options ++ This approach lets you remove the binaries at any time and rebuild from scratch using the same options. + + + +@@ -626,7 +626,7 @@ Which shouldn't be defined unless inttypes.h exists on your + + OS X® + +-As of this writing ($Date: 2011/03/22 16:00:44 $), the regular distribution compiles on OS X. ++As of this writing ($Date: 2011/03/22 16:03:44 $), the regular distribution compiles on OS X. + + + +commit 820de48076d626c32f80503a756cc5c1fd93da0e +Author: jklowden +Date: Tue Mar 22 17:54:04 2011 +0000 + + neater output + +diff --git a/ChangeLog b/ChangeLog +index ac8e369..7efbb19 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++Tue Mar 22 13:51:32 EDT 2011 JK Lowden ++ * autogen.sh neater output ++ * src/apps/tsql.c spell Kerberos correctly ++ * src/dblib/bcp.c initialize bcp_terminator ++ + Mon Mar 21 20:21:51 EDT 2011 JK Lowden + * doc/userguide.sgml updated for upcoming release + +@@ -3183,4 +3188,4 @@ Wed Jan 9 19:54:43 EST 2008 JK Lowden + * ChangeLog-0.82 added because of release + + $FreeTDS$ +-$Id: ChangeLog,v 1.3202 2011/03/22 00:23:23 jklowden Exp $ ++$Id: ChangeLog,v 1.3203 2011/03/22 17:54:04 jklowden Exp $ +diff --git a/autogen.sh b/autogen.sh +index 13f0052..8111ee3 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -1,7 +1,7 @@ + #!/bin/sh + # Run this to generate all the initial makefiles, etc. + +-# $Id: autogen.sh,v 1.9 2006/10/21 12:23:07 freddy77 Exp $ ++# $Id: autogen.sh,v 1.10 2011/03/22 17:54:04 jklowden Exp $ + + # From automake.info: + # +@@ -34,7 +34,9 @@ PKG_NAME="FreeTDS." + #conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c + + if test x$NOCONFIGURE = x; then +- echo Running $srcdir/configure $conf_flags "$@" ... ++ echo Running $srcdir/configure $conf_flags "$@" '...' \ ++ | tr ' ' \\n \ ++ | sed 's/^-/ &/' + $srcdir/configure $conf_flags "$@" \ + && echo Now type \`make\' to compile $PKG_NAME + else + +commit 596ea4c77e9652eb16082f26da68ef333ec4a252 +Author: jklowden +Date: Tue Mar 22 17:54:09 2011 +0000 + + spell Kerberos correctly + +diff --git a/src/apps/tsql.c b/src/apps/tsql.c +index 43c9029..c2e9ee6 100644 +--- a/src/apps/tsql.c ++++ b/src/apps/tsql.c +@@ -87,7 +87,7 @@ + #include "tdsconvert.h" + #include "replacements.h" + +-TDS_RCSID(var, "$Id: tsql.c,v 1.139 2010/12/21 16:55:24 jklowden Exp $"); ++TDS_RCSID(var, "$Id: tsql.c,v 1.140 2011/03/22 17:54:09 jklowden Exp $"); + + #define TDS_ISSPACE(c) isspace((unsigned char) (c)) + +@@ -459,7 +459,7 @@ populate_login(TDSLOGIN * login, int argc, char **argv) + "iODBC", settings->iodbc ? "yes" : "no", + "unixodbc", settings->unixodbc ? "yes" : "no", + "SSPI \"trusted\" logins", have_sspi, +- "Keberos", enable_krb5); ++ "Kerberos", enable_krb5); + exit(0); + break; + default: + +commit 8b182a2cf698b9be27c6ad8cd37bc6b2b4934a4e +Author: jklowden +Date: Tue Mar 22 17:54:13 2011 +0000 + + initialize bcp_terminator + +diff --git a/src/dblib/bcp.c b/src/dblib/bcp.c +index 728e364..1fb35d9 100644 +--- a/src/dblib/bcp.c ++++ b/src/dblib/bcp.c +@@ -62,7 +62,7 @@ + #define MAX(a,b) ( (a) > (b) ? (a) : (b) ) + #endif + +-TDS_RCSID(var, "$Id: bcp.c,v 1.196 2011/01/14 14:18:15 freddy77 Exp $"); ++TDS_RCSID(var, "$Id: bcp.c,v 1.197 2011/03/22 17:54:13 jklowden Exp $"); + + #ifdef HAVE_FSEEKO + typedef off_t offset_type; +@@ -2352,6 +2352,9 @@ bcp_bind(DBPROCESS * dbproc, BYTE * varaddr, int prefixlen, DBINT varlen, + colinfo->column_varaddr = (char *)varaddr; + colinfo->column_bindtype = vartype; + colinfo->column_bindlen = varlen; ++ ++ TDS_ZERO_FREE(colinfo->bcp_terminator); ++ colinfo->bcp_term_len = 0; + if((colinfo->bcp_terminator = malloc(termlen)) == NULL) { + dbperror(dbproc, SYBEMEM, errno); + return FAIL;