Skip to Content.
Sympa Menu

freetds - RE: [freetds] Need Help on dblib program

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Steven J. Backus" <backus AT math.utah.edu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Need Help on dblib program
  • Date: Thu, 31 Jul 2003 16:28:07 -0600 (MDT)

> A little before the I5 conversion is the dage conversion. Your table has
> that as datatype float, 8 bytes, and you're binding it to a C float, 4
> bytes. Does anything change if you redefine the age column as datatype
> "real" instead?

I changed float to real in the table definition. I changed float
to DBREAL in the program. Now the output looks correct:

id did dmonth dday dyear dage orderinlist
i1 i2 i3 i4 i5 family
----------- ----------- ----------- ----------- ----------- ---- -----------
---- ---- ---- ---- ---- ------
176936 300004 2 5 1904 79 1
NULL NULL NULL NULL I64 Y

But i5 still is messed up:

(gdb) print i5
$1 = "\00064\000\001"

Here's some more of the log that might help.

16:25:19.773750 dbsqlok() marker is ee
16:25:19.773846 dbsqlok() found result token
16:25:19.773985 dbresults()
16:25:19.774078 dbresults_r()
16:25:19.774172 processing result tokens. marker is ee(RESULT)
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.774413 processing result. type = 38(integer-null), varint_size 1
16:25:19.774513 processing result. column_size 4
tds_get_string: reading 3 from wire to give 3 to client.
16:25:19.774617 processing result. type = 38(integer-null), varint_size 1
16:25:19.774713 processing result. column_size 4
tds_get_string: reading 6 from wire to give 6 to client.
16:25:19.774816 processing result. type = 38(integer-null), varint_size 1
16:25:19.774913 processing result. column_size 4
tds_get_string: reading 4 from wire to give 4 to client.
16:25:19.775016 processing result. type = 38(integer-null), varint_size 1
16:25:19.775112 processing result. column_size 4
tds_get_string: reading 5 from wire to give 5 to client.
16:25:19.775215 processing result. type = 38(integer-null), varint_size 1
16:25:19.775311 processing result. column_size 4
tds_get_string: reading 4 from wire to give 4 to client.
16:25:19.775434 processing result. type = 109(float-null), varint_size 1
16:25:19.775531 processing result. column_size 4
tds_get_string: reading 11 from wire to give 11 to client.
16:25:19.775634 processing result. type = 38(integer-null), varint_size 1
16:25:19.775730 processing result. column_size 4
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.775833 processing result. type = 39(varchar), varint_size 1
16:25:19.775930 processing result. column_size 4
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.776033 processing result. type = 39(varchar), varint_size 1
16:25:19.776129 processing result. column_size 4
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.776232 processing result. type = 39(varchar), varint_size 1
16:25:19.776328 processing result. column_size 4
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.776431 processing result. type = 39(varchar), varint_size 1
16:25:19.776542 processing result. column_size 4
tds_get_string: reading 2 from wire to give 2 to client.
16:25:19.776647 processing result. type = 39(varchar), varint_size 1
16:25:19.776743 processing result. column_size 4
tds_get_string: reading 6 from wire to give 6 to client.
16:25:19.776846 processing result. type = 39(varchar), varint_size 1
16:25:19.776942 processing result. column_size 1
16:25:19.777038 dbresults_r() result_type = 4049 retcode = 1
16:25:19.777135 processing result tokens. marker is ae(CONTROL)
16:25:19.777231 tds_process_default_tokens() marker is ae(CONTROL)
eating token 174
16:25:19.777334 processing result tokens. marker is a9(ORDERBY)
16:25:19.777429 tds_process_default_tokens() marker is a9(ORDERBY)
eating token 169
16:25:19.777531 processing result tokens. marker is d1(ROW)
16:25:19.777626 dbresults_r() result_type = 4040 retcode = 1
16:25:19.777722 leaving dbresults() returning 1
16:25:19.777816 dbbind() column = 1 8 0
16:25:19.777912 dbbind() srctype = 56 desttype = 56
16:25:19.778035 tds_willconvert()
16:25:19.778134 tds_willconvert() 56 56 1
16:25:19.778229 dbbind() column = 2 8 0
16:25:19.778323 dbbind() srctype = 56 desttype = 56
16:25:19.778418 tds_willconvert()
16:25:19.778511 tds_willconvert() 56 56 1
16:25:19.778606 dbbind() column = 3 8 0
16:25:19.778700 dbbind() srctype = 56 desttype = 56
16:25:19.778795 tds_willconvert()
16:25:19.778888 tds_willconvert() 56 56 1
16:25:19.778982 dbbind() column = 4 8 0
16:25:19.779077 dbbind() srctype = 56 desttype = 56
16:25:19.779172 tds_willconvert()
16:25:19.779265 tds_willconvert() 56 56 1
16:25:19.779359 dbbind() column = 5 8 0
16:25:19.779454 dbbind() srctype = 56 desttype = 56
16:25:19.779548 tds_willconvert()
16:25:19.779641 tds_willconvert() 56 56 1
16:25:19.779736 dbbind() column = 6 10 0
16:25:19.779831 dbbind() srctype = 59 desttype = 59
16:25:19.779925 tds_willconvert()
16:25:19.780146 tds_willconvert() 59 59 1
16:25:19.780242 dbbind() column = 7 8 0
16:25:19.780337 dbbind() srctype = 56 desttype = 56
16:25:19.780448 tds_willconvert()
16:25:19.780541 tds_willconvert() 56 56 1
16:25:19.780636 dbbind() column = 8 1 0
16:25:19.780731 dbbind() srctype = 39 desttype = 47
16:25:19.780825 tds_willconvert()
16:25:19.780917 tds_willconvert() 39 47 1
16:25:19.781012 dbbind() column = 9 1 0
16:25:19.781106 dbbind() srctype = 39 desttype = 47
16:25:19.781200 tds_willconvert()
16:25:19.781293 tds_willconvert() 39 47 1
16:25:19.781387 dbbind() column = 10 1 0
16:25:19.781482 dbbind() srctype = 39 desttype = 47
16:25:19.781576 tds_willconvert()
16:25:19.781668 tds_willconvert() 39 47 1
16:25:19.781763 dbbind() column = 11 1 0
16:25:19.781857 dbbind() srctype = 39 desttype = 47
16:25:19.781952 tds_willconvert()
16:25:19.782044 tds_willconvert() 39 47 1
16:25:19.782138 dbbind() column = 12 1 0
16:25:19.782233 dbbind() srctype = 39 desttype = 47
16:25:19.782327 tds_willconvert()
16:25:19.782419 tds_willconvert() 39 47 1
16:25:19.782514 dbbind() column = 13 0 0
16:25:19.782608 dbbind() srctype = 39 desttype = 47
16:25:19.782703 tds_willconvert()
16:25:19.782811 tds_willconvert() 39 47 1
16:25:19.783019 dbnextrow()
16:25:19.783117 processing row tokens. marker is d1(ROW)
16:25:19.783214 processing row. column is 0 varint size = 1
16:25:19.783309 processing row. column size is 4
16:25:19.783404 clearing column 0 NULL bit
16:25:19.783499 processing row. column is 1 varint size = 1
16:25:19.783594 processing row. column size is 4
16:25:19.783688 clearing column 1 NULL bit
16:25:19.783782 processing row. column is 2 varint size = 1
16:25:19.783877 processing row. column size is 4
16:25:19.783971 clearing column 2 NULL bit
16:25:19.784066 processing row. column is 3 varint size = 1
16:25:19.784161 processing row. column size is 4
16:25:19.784255 clearing column 3 NULL bit
16:25:19.784349 processing row. column is 4 varint size = 1
16:25:19.784444 processing row. column size is 4
16:25:19.784538 clearing column 4 NULL bit
16:25:19.784632 processing row. column is 5 varint size = 1
16:25:19.784727 processing row. column size is 4
16:25:19.784839 clearing column 5 NULL bit
16:25:19.784934 processing row. column is 6 varint size = 1
16:25:19.785029 processing row. column size is 4
16:25:19.785123 clearing column 6 NULL bit
16:25:19.785217 processing row. column is 7 varint size = 1
16:25:19.785312 processing row. column size is 0
16:25:19.785407 setting column 7 NULL bit
16:25:19.785501 processing row. column is 8 varint size = 1
16:25:19.785596 processing row. column size is 0
16:25:19.785690 setting column 8 NULL bit
16:25:19.785784 processing row. column is 9 varint size = 1
16:25:19.785878 processing row. column size is 0
16:25:19.785972 setting column 9 NULL bit
16:25:19.786066 processing row. column is 10 varint size = 1
16:25:19.786161 processing row. column size is 0
16:25:19.786255 setting column 10 NULL bit
16:25:19.786349 processing row. column is 11 varint size = 1
16:25:19.786444 processing row. column size is 3
16:25:19.786538 clearing column 11 NULL bit
tds_get_char_data: reading 3 on wire for 0 to client
16:25:19.786682 processing row. column is 12 varint size = 1
16:25:19.786778 processing row. column size is 1
16:25:19.786872 clearing column 12 NULL bit
tds_get_char_data: reading 1 on wire for 0 to client
16:25:19.786978 dbconvert() srctype = 56 desttype = 56
16:25:19.787074 dbconvert() srctype == desttype
16:25:19.787168 dbconvert() srctype = 56 desttype = 56
16:25:19.787263 dbconvert() srctype == desttype
16:25:19.787356 dbconvert() srctype = 56 desttype = 56
16:25:19.787450 dbconvert() srctype == desttype
16:25:19.787544 dbconvert() srctype = 56 desttype = 56
16:25:19.787638 dbconvert() srctype == desttype
16:25:19.787732 dbconvert() srctype = 56 desttype = 56
16:25:19.787826 dbconvert() srctype == desttype
16:25:19.787920 dbconvert() srctype = 59 desttype = 59
16:25:19.788014 dbconvert() srctype == desttype
16:25:19.788108 dbconvert() srctype = 56 desttype = 56
16:25:19.788202 dbconvert() srctype == desttype
16:25:19.788297 dbconvert() srctype = 39 desttype = 47
16:25:19.788392 dbconvert() calling tds_convert
16:25:19.788528 dbconvert() called tds_convert returned 3
16:25:19.788624 dbconvert() outputting 3 bytes character data destlen = -2
16:25:19.788721 dbconvert() srctype = 39 desttype = 47
16:25:19.788816 dbconvert() calling tds_convert
16:25:19.788909 dbconvert() called tds_convert returned 1
16:25:19.789004 dbconvert() outputting 1 bytes character data destlen = -1
16:25:19.789100 leaving dbnextrow() returning -1
16:25:19.789196 dbconvert() srctype = 56 desttype = 47
16:25:19.789292 dbconvert() calling tds_convert
16:25:19.789388 dbconvert() called tds_convert returned 6
16:25:19.789483 dbconvert() outputting 6 bytes character data destlen = 256
16:25:19.789598 dbconvert() srctype = 56 desttype = 47
16:25:19.789694 dbconvert() calling tds_convert
16:25:19.789790 dbconvert() called tds_convert returned 6
16:25:19.789885 dbconvert() outputting 6 bytes character data destlen = 256
16:25:19.789986 dbconvert() srctype = 56 desttype = 47
16:25:19.790142 dbconvert() calling tds_convert
16:25:19.790255 dbconvert() called tds_convert returned 1
16:25:19.790351 dbconvert() outputting 1 bytes character data destlen = 256
16:25:19.790451 dbconvert() srctype = 56 desttype = 47
16:25:19.790547 dbconvert() calling tds_convert
16:25:19.790642 dbconvert() called tds_convert returned 1
16:25:19.790737 dbconvert() outputting 1 bytes character data destlen = 256
16:25:19.790838 dbconvert() srctype = 56 desttype = 47
16:25:19.790933 dbconvert() calling tds_convert
16:25:19.791029 dbconvert() called tds_convert returned 4
16:25:19.791124 dbconvert() outputting 4 bytes character data destlen = 256
16:25:19.791225 dbconvert() srctype = 59 desttype = 47
16:25:19.791320 dbconvert() calling tds_convert
16:25:19.791465 dbconvert() called tds_convert returned 2
16:25:19.791562 dbconvert() outputting 2 bytes character data destlen = 256
16:25:19.791663 dbconvert() srctype = 56 desttype = 47
16:25:19.791758 dbconvert() calling tds_convert
16:25:19.791854 dbconvert() called tds_convert returned 1
16:25:19.791948 dbconvert() outputting 1 bytes character data destlen = 256
16:25:19.792072 dbconvert() srctype = 39 desttype = 47
16:25:19.792170 dbconvert() srctype = 39 desttype = 47
16:25:19.792269 dbnextrow()
16:25:19.792362 processing row tokens. marker is fd(DONE)
16:25:19.792458 tds_process_end() more_results = 0, was_cancelled = 0
16:25:19.792554 leaving dbnextrow() returning -2




Archive powered by MHonArc 2.6.24.

Top of Page