Skip to Content.
Sympa Menu

freetds - [freetds] Segmentation Falt when Retrieving datetime Columns from MS SQL 7.0 SP4 Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ben Gribaudo <me AT bengribaudo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Segmentation Falt when Retrieving datetime Columns from MS SQL 7.0 SP4 Server
  • Date: Fri, 29 Jul 2005 10:32:48 -0500

Hello,

I am attempting to use FreeTDS on a Debian 3.1 box which has libct1 version 0.61-6.2 installed along with sqlrelay-freetds (0.35-10). When I attempt to retrieve datetime columns, I receive a segmentation falt. However, if I cast the datetime column to a char, the query works. The database server is MS SQL 7.0 SP4. freetds.conf is set to use tds version 7.0 for this server. Examples and data below. Also, see atached log.

Do you have any ideas as to how I could fix this probelm?

Thank you,
Ben Gribaudo

=============================
All examples are using the default Microsoft pubs database.

In SQSH:
| 1> select * from sales
| 2> go
|
| Program received signal SIGSEGV, Segmentation fault.
| 0x40400f64 in strftime () from /lib/tls/libc.so.6
(additional info above from dbg)

This works fine:
| 1> select stor_id, ord_num, cast(ord_date as char), qty, payterms, title_id from sales
| 2> go
| (results...)

I don't know if this is related but this doesn't work, either:
| 1> use pubs
| 2> select * from pub_info;
| 3> go
| (column names, dashes)
| error_handler: Data-conversion resulted in overflow.


## TDSDUMP log from running
## "select * from sales"
## "go"
## in gdb sqsh

...
Received packet @ 2005-07-29 10:21:54.164618
...

2005-07-29 10:21:54.165756 processing result tokens. marker is
81(TDS7_RESULT)
2005-07-29 10:21:54.165822 tds7_get_data_info:1083:
type = 47 (char)
column_varint_size = 2
colname = stor_id
colnamelen = 7
2005-07-29 10:21:54.165865 tds7_get_data_info:1083:
type = 39 (varchar)
column_varint_size = 2
colname = ord_num
colnamelen = 7
2005-07-29 10:21:54.165906 tds7_get_data_info:1083:
type = 61 (datetime)
column_varint_size = 0
colname = ord_date
colnamelen = 8
2005-07-29 10:21:54.165945 tds7_get_data_info:1083:
type = 52 (smallint)
column_varint_size = 0
colname = qty
colnamelen = 3
2005-07-29 10:21:54.165984 tds7_get_data_info:1083:
type = 39 (varchar)
column_varint_size = 2
colname = payterms
colnamelen = 8
2005-07-29 10:21:54.166023 tds7_get_data_info:1083:
type = 39 (varchar)
column_varint_size = 2
colname = title_id
colnamelen = 8
2005-07-29 10:21:54.166061 inside ct_results() process_result_tokens returned
1 (type 4049)
2005-07-29 10:21:54.166094 processing result tokens. marker is d1(ROW)
2005-07-29 10:21:54.166130 inside ct_results() process_result_tokens returned
1 (type 4040)
2005-07-29 10:21:54.166169 inside ct_res_info()
2005-07-29 10:21:54.166196 ct_res_info(): Number of columns is 6
2005-07-29 10:21:54.166235 inside ct_describe()
2005-07-29 10:21:54.166265 inside _ct_get_client_type(type 47, size 4)
2005-07-29 10:21:54.166295 inside ct_describe() datafmt->datatype = 1 server
type 47
2005-07-29 10:21:54.166331 inside ct_bind()
2005-07-29 10:21:54.166359 inside ct_bind() item = 1 datafmt->datatype = 1
2005-07-29 10:21:54.166388 inside ct_describe()
2005-07-29 10:21:54.166415 inside _ct_get_client_type(type 39, size 20)
2005-07-29 10:21:54.166444 inside ct_describe() datafmt->datatype = 1 server
type 39
2005-07-29 10:21:54.166476 inside ct_bind()
2005-07-29 10:21:54.166502 inside ct_bind() item = 2 datafmt->datatype = 1
2005-07-29 10:21:54.166531 inside ct_describe()
2005-07-29 10:21:54.166558 inside _ct_get_client_type(type 61, size 8)
2005-07-29 10:21:54.166587 inside ct_describe() datafmt->datatype = 6 server
type 61
2005-07-29 10:21:54.166627 inside cs_convert()
2005-07-29 10:21:54.166656 inside _ct_get_server_type(1)
2005-07-29 10:21:54.166685 inside _ct_get_server_type(6)
2005-07-29 10:21:54.166713 inside cs_convert() srctype = 47 (24) desttype =
61 (8)
2005-07-29 10:21:54.166744 inside cs_convert() calling tds_convert
2005-07-29 10:21:54.166836 inside store_time() millisecs = 123
2005-07-29 10:21:54.166870 inside cs_convert() tds_convert returned 8
2005-07-29 10:21:54.166900 inside cs_convert() returning 1
2005-07-29 10:21:54.166929 inside cs_convert()
2005-07-29 10:21:54.166955 inside _ct_get_server_type(6)
2005-07-29 10:21:54.166982 inside _ct_get_server_type(1)
2005-07-29 10:21:54.167009 inside cs_convert() srctype = 61 (8) desttype = 47
(257)
2005-07-29 10:21:54.167040 inside cs_convert() calling tds_convert
2005-07-29 10:21:54.167106 inside cs_convert() tds_convert returned 38
2005-07-29 10:21:54.167137 inside cs_convert() FMT_NULLTERM
2005-07-29 10:21:54.167165 inside cs_convert() returning 1
2005-07-29 10:21:54.167242 inside cs_convert()
2005-07-29 10:21:54.167270 inside _ct_get_server_type(1)
2005-07-29 10:21:54.167297 inside _ct_get_server_type(6)
2005-07-29 10:21:54.167325 inside cs_convert() srctype = 47 (24) desttype =
61 (8)
2005-07-29 10:21:54.167356 inside cs_convert() calling tds_convert
2005-07-29 10:21:54.167391 inside store_time() millisecs = 123
2005-07-29 10:21:54.167422 inside cs_convert() tds_convert returned 8
2005-07-29 10:21:54.167451 inside cs_convert() returning 1
2005-07-29 10:21:54.167479 inside cs_convert()
2005-07-29 10:21:54.167505 inside _ct_get_server_type(6)
2005-07-29 10:21:54.167532 inside _ct_get_server_type(1)
2005-07-29 10:21:54.167560 inside cs_convert() srctype = 61 (8) desttype = 47
(257)
2005-07-29 10:21:54.167590 inside cs_convert() calling tds_convert



Archive powered by MHonArc 2.6.24.

Top of Page