freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: James K. Lowden <jklowden AT speakeasy.org>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: changes overnight
- Date: Tue, 6 Aug 2002 03:10:13 -0400
All,
I didn't apply any patches last night, but added a few things to help Bill
along with convert.c.
char->tinyint was not checking for negative values. Negative values
should fail to convert. Now they do: dbconvert returns 0 if the input
buffer evaluates to a value between 0 and 255.
dbconvert was not noticing if tds_convert returned zero, but continued on
with its processing. Result was garbage in dest if the conversion failed
(e.g., 'adbc'->datetime). Didn't look at the other APIs.
Bill, I took up the dare in your comments to write a better hex->int
algorithm. See what you think. If you like my version, we can delete the
"cruddy" one.
Sybase allows embedded blanks -- as Bill discovered -- in char->int. I
wrote tds_atoi() and used a macro to route all atoi() calls through it.
That solves that, say I.
While on the topic, Sybase does not similarly handle embedded blanks in
char->float. Neither do we. An interesting and scary test would be to
embed some other non-printable characters (say, tab, or NL, or ^D) in a
character string and try to convert it to an int. Imagine the sheer
wonder of discovery!
The atoll() testing has been corrected (I hope) and used in the places
David Varley pointed out. Always glad to support the burgeoning Tru64
community.
Since no one objected, DBDEAD() is now dbdead(), with an uppercase macro
in tds.h for those who need it.
ChangeLog follows.
--jkl
Tue Aug 6 00:16:34 EDT 2002 JK Lowden <jklowden AT schemamania.org>
+ include/tds.h.in cosmetic changes
+ include/sybdb.h changed DBDEAD to dbdead; provided macro.
Aids binary compatibility.
+ src/dblib/dblib.c dbconvert returns 0 if tds_convert returns
0
+ src/tds/convert.c char->tinyint disallows <0
char->int allows embedded spaces
hex->int is more efficient
-
changes overnight,
James K . Lowden, 08/06/2002
- <Possible follow-up(s)>
- changes overnight, James K. Lowden, 08/22/2002
- RE: changes overnight, ZIGLIO Frediano, 08/22/2002
- RE: changes overnight, Varley, David(CBorn at Alcoa), 08/22/2002
- RE: changes overnight, Brian Bruns, 08/22/2002
- changes overnight, James K. Lowden, 08/27/2002
- changes overnight, James K. Lowden, 08/29/2002
Archive powered by MHonArc 2.6.24.