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: Thu, 11 Jul 2002 02:36:09 -0400
All,
We now have dbwillconvert().
There is an implementation niggle wiggle.
There is a new include file that I did not add to cvs:
src/tds/tds_willconvert.h
If you look at the comments above tds_willconvert in tds/convert.c, you'll
find that tds_willconvert.h is a perl-generated file, and that the
requisite perl is embedded in said comments. So, it's really not
necessary to have tds_willconvert.h in the archive. Perl can generate it
and probably should.
It would be cool, I think, to add this dependency to the auto* stuff. I
don't know how, but there's time for that. Until then, if you want to use
the function, follow the instructions in the comments. Or grab the file
from:
http://www.SchemaMania.org/freetds/cvs/freetds/src/tds/tds_willconvert.h
+++
You may also wish to peruse:
http://www.SchemaMania.org/freetds/cvs/freetds/src/dblib/unittests/
for a file "convert_acid.c". It takes any query and attempts to convert
every returned value to every available datatype. "Attempt" is the
operative word, it perhaps should go without saying:
select 1 as one, '9' as nine <== the query
2 columns returned.
column_name: one
column_type: 56
column_size: 4
length: 4
data (first word):
1
[56,47] '0001' -> '1'
Will not convert 56, 39
Will not convert 56, 38
[56,48] '0001' -> '1'
[56,52] '0001' -> '01'
[56,56] '0001' -> '0001'
Will not convert 56, 127
[56,62] No output converting 4 bytes of 56 to 62
Will not convert 56, 61
[56,50] No output converting 4 bytes of 56 to 50
[56,35] No output converting 4 bytes of 56 to 35
[...]
"will not convert" means dbwillconvert returned FALSE.
"no output" means we called dbconvert, but it returned zero.
else it prints what it got.
(The [56,35] are the #define'd SYB* values in tds.h.)
If you're curious about what works and what doesn't this will show you.
Regards,
--jkl
$ cvs diff -u -r 1.100 ChangeLog
jklowden AT cvs.freetds.sourceforge.net's password:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/freetds/freetds/ChangeLog,v
retrieving revision 1.100
retrieving revision 1.102
diff -u -r1.100 -r1.102
--- ChangeLog 9 Jul 2002 03:15:46 -0000 1.100
+++ ChangeLog 11 Jul 2002 05:55:42 -0000 1.102
@@ -1,3 +1,17 @@
+Thu Jul 11 01:47:47 EDT 2002
+ + src/tds/convert.c, implement tds_willconvert
+ + include/tds_willconvert.h, perl-generated static data
+ + src/tds/convert.c, implement tds_willconvert
+ * src/dblib/dblib.c, implement dbwillconvert via tds_willconvert
+
+Tue Jul 9 23:16:12 EDT 2002 JK Lowden <jklowden AT schemamania.org>
+ declare TDSUNIQUE in the same way as windows and unixodbc
(Frediano):
+ + include/tds.h.in, patch #579149.
+ + src/tds/convert.c, patch #579149
+ * src/tds/convert.c, simplify tds_convert_text
+ * src/dblib/dblib.c, fix dbconvert to work with new
tds_convert_text
+ * src/tds/token.c, tds_process_row, fix little endian numeric
datatype (Bill Thompson)
+
Mon Jul 8 19:03:33 EDT 2002 JK Lowden <jklowden AT schemamania.org>
* src/tds/convert.c: reverted tds_convert_text to 1.12 logic;
1.13 patch was mistaken, per Brian.
-
changes overnight,
James K. Lowden, 07/10/2002
- <Possible follow-up(s)>
- changes overnight, James K . Lowden, 07/11/2002
- changes overnight, James K . Lowden, 07/16/2002
Archive powered by MHonArc 2.6.24.