Skip to Content.
Sympa Menu

freetds - Re: [freetds] MS SQL Server 2008 R2 and freetds 0.82

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Doug <duckdoug AT yahoo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] MS SQL Server 2008 R2 and freetds 0.82
  • Date: Thu, 24 Feb 2011 14:23:35 -0800 (PST)

Hi,

Have been using freetds 0.64 on 64-bit red hat linux for a long time to
connect to MS SQL Server 2000 and MS SQL Server 2005 and it worked fine. 

Recently tried to use it on MS SQL 2008 and SQL 2008 R2 server running
Window Server 2008 R2 Enterprise (64 bit).  The SQL servers do not have
encryption turned on.   In both cases, it was able to connect and could do
simple short queries.  However when tried to run a long running query (a
simple update), the query would start and after a while, it would return an
error stating "read from server failed" and the connection is dropped.  Tried
that with freetds version 0.82 and compiled with TDS version 8.0 and ran into
the same issue. 


Any help is greatly appreciated!    Thanks.

Doug
   


--------------------------
Below is the configuration and tdsdump output.
>
>                
>      Version: freetds v0.82
>          
>    freetds.conf directory: ...
>      MS db-lib source compatibility:
> no
>         Sybase binary compatibility:
> no
>                
>       Thread safety: yes
>                
>       iconv library: yes
>                
>         TDS version: 8.0
>                
>               iODBC: no
>                
>            unixodbc: no
>
>
>
> >>>>>update .....    (the query
> would start working and after a while)
>
> >>>>Msg 20004, Level 9, State -1, Server
> OpenClient, Line -1
> Read from the server failed
>
>
> --------------------------
> excerpt from TDSdump
>
> og.c:190:Starting log file for FreeTDS 0.82
>         on 2011-02-24 16:59:06 with
> debug flags 0x4fff.
> iconv.c:197:names for ISO-8859-1: ISO-8859-1
> iconv.c:197:names for UTF-8: UTF-8
> iconv.c:197:names for UCS-2LE: UCS-2LE
> iconv.c:197:names for UCS-2BE: UCS-2BE
> iconv.c:363:iconv to convert client-side data to the
> "UTF-8" character set
> iconv.c:516:tds_iconv_info_init: converting
> "UTF-8"->"UCS-2LE"
> iconv.c:516:tds_iconv_info_init: converting
> "ISO-8859-1"->"UCS-2LE"
> net.c:210:Connecting to 10.5.1.219 port 1500 (TDS version
> 8.0)
> net.c:264:tds_open_socket: connect(2) returned "Operation
> now in progress"
> net.c:303:tds_open_socket() succeeded
> util.c:162:Changed query state from DEAD to IDLE
> login.c:735:quietly sending TDS 7+ login packet
> token.c:312:tds_process_login_tokens()
> net.c:592:Received header
> 0000 04 01 01 87 00 37 01 00-       
>                
> |.....7..|
>
> net.c:671:Received packet
> ....
> 0090 08 00 07 05 09 04 d0 00-34 00 e3 17 00 02 0a 75
> |........ 4......u|
> 00a0 00 73 00 5f 00 65 00 6e-00 67 00 6c 00 69 00 73
> |.s._.e.n .g.l.i.s|
> 00b0 00 68 00 00 ab 72 00 47-16 00 00 01 00 27 00 43
> |.h...r.G .....'.C|
> 00c0 00 68 00 61 00 6e 00 67-00 65 00 64 00 20 00 6c
> |.h.a.n.g .e.d. .l|
> 00d0 00 61 00 6e 00 67 00 75-00 61 00 67 00 65 00 20
> |.a.n.g.u .a.g.e. |
> 00e0 00 73 00 65 00 74 00 74-00 69 00 6e 00 67 00 20
> |.s.e.t.t .i.n.g. |
> 00f0 00 74 00 6f 00 20 00 75-00 73 00 5f 00 65 00 6e |.t.o.
> .u .s._.e.n|
> 0100 00 67 00 6c 00 69 00 73-00 68 00 2e 00 0c 4d 00
> |.g.l.i.s .h....M.|
> 0110 4f 00 4f 00 4e 00 53 00-51 00 4c 00 30 00 34 00
> |O.O.N.S. Q.L.0.4.|
> 0120 5c 00 52 00 32 00 00 01-00 ad 36 00 01 71 00 00
> |\.R.2... ..6..q..|
> 0130 01 16 4d 00 69 00 63 00-72 00 6f 00 73 00 6f 00
> |..M.i.c. r.o.s.o.|
> 0140 66 00 74 00 20 00 53 00-51 00 4c 00 20 00 53 00 |f.t.
> .S. Q.L. .S.|
> 0150 65 00 72 00 76 00 65 00-72 00 00 00 00 00 0a 32
> |e.r.v.e. r......2|
> 0160 06 40 e3 11 00 04 03 35-00 31 00 32 00 04 34 00
> |.@.....5 .1.2..4.|
> 0170 30 00 39 00 36 00 fd 00-00 00 00 00 00 00 00 
>   |0.9.6... .......|
>
> token.c:316:looking for login token, got 
> e3(ENVCHANGE)
> token.c:108:tds_process_default_tokens() marker is
> e3(ENVCHANGE)
> token.c:316:looking for login token, got  ab(INFO)
> token.c:108:tds_process_default_tokens() marker is
> ab(INFO)
> token.c:2451:tds_process_msg() reading message from server
> token.c:2516:tds_process_msg() calling client msg handler
> token.c:2529:tds_process_msg() returning TDS_SUCCEED
> token.c:316:looking for login token, got 
> e3(ENVCHANGE)
> token.c:108:tds_process_default_tokens() marker is
> e3(ENVCHANGE)
> token.c:2281:tds_process_env_chg(): 5 bytes of collation
> data received
> token.c:2282:tds->collation was
> 0000 00 00 00 00 00     
>    -           
>             |.....|
>
> iconv.c:985:setting server single-byte charset to "CP1252"
> iconv.c:516:tds_iconv_info_init: converting
> "UTF-8"->"CP1252"
> token.c:2292:tds->collation now
> 0000 09 04 d0 00 34     
>    -           
>             |....4|
>
> token.c:316:looking for login token, got 
> e3(ENVCHANGE)
> token.c:108:tds_process_default_tokens() marker is
> e3(ENVCHANGE)
> token.c:316:looking for login token, got  ab(INFO)
> token.c:108:tds_process_default_tokens() marker is
> ab(INFO)
> token.c:2451:tds_process_msg() reading message from server
> token.c:2516:tds_process_msg() calling client msg handler
> token.c:2529:tds_process_msg() returning TDS_SUCCEED
> token.c:316:looking for login token, got 
> ad(LOGINACK)
> token.c:316:looking for login token, got 
> e3(ENVCHANGE)
> token.c:108:tds_process_default_tokens() marker is
> e3(ENVCHANGE)
> token.c:316:looking for login token, got  fd(DONE)
> token.c:108:tds_process_default_tokens() marker is
> fd(DONE)
> token.c:2201:tds_process_end: more_results = 0
>                
> was_cancelled = 0
>                
> error = 0
>                
> done_count_valid = 0
> token.c:2217:tds_process_end() state set to TDS_IDLE
> token.c:2232:           
>     rows_affected = 0
> token.c:393:leaving tds_process_login_tokens() returning 1
> mem.c:563:tds_free_all_results()
> util.c:162:Changed query state from IDLE to QUERYING
> write.c:136:tds_put_string converting 19 bytes of "set
> textsize 64512 "
> write.c:164:tds_put_string wrote 38 bytes
> util.c:162:Changed query state from QUERYING to PENDING
> et.c:779:Sending packet
> 0000 01 01 00 2e 00 00 00 00-73 00 65 00 74 00 20 00
> |........ s.e.t. .|
> 0010 74 00 65 00 78 00 74 00-73 00 69 00 7a 00 65 00
> |t.e.x.t. s.i.z.e.|
> 0020 20 00 36 00 34 00 35 00-31 00 32 00 20 00   
>    | .6.4.5. 1.2. .|
>
> token.c:495:tds_process_tokens(0x538360, 0x7fbfffe870,
> 0x7fbfffe874, 0x100)
> util.c:162:Changed query state from PENDING to READING
> net.c:592:Received header
> 0000 04 01 00 11 00 37 01 00-       
>                
> |.....7..|
>
> net.c:671:Received packet
> 0000 fd 00 00 be 00 00 00 00-00       
>               |........
> .|
>
> token.c:510:processing result tokens.  marker is 
> fd(DONE)
> token.c:2201:tds_process_end: more_results = 0
>                
> was_cancelled = 0
>                
> error = 0
>                
> done_count_valid = 0
> token.c:2217:tds_process_end() state set to TDS_IDLE
> util.c:162:Changed query state from READING to IDLE
> token.c:2232:           
>     rows_affected = 0
> util.c:110:logic error: cannot change query state from IDLE
> to PENDING
> token.c:495:tds_process_tokens(0x538360, 0x7fbfffe870,
> 0x7fbfffe874, 0x100)
> token.c:498:tds_process_tokens() state is COMPLETED
> mem.c:563:tds_free_all_results()
> util.c:162:Changed query state from IDLE to QUERYING
> ....
> write.c:136:tds_put_string converting 161 bytes of "update
> supress_estim
> set detailestimate_id=b.detailestimate_id
> from  supress_estim a, detailed_estimates b
> where a.detailestimate_id_str=b.detailestimate_id_str
> "
> write.c:136:tds_put_string converting 33 bytes of
> "e_id_str=b.detailestimate_id_str
> "
> write.c:164:tds_put_string wrote 322 bytes
> util.c:162:Changed query state from QUERYING to PENDING
> net.c:779:Sending packet
> 0000 01 01 01 4a 00 00 01 00-75 00 70 00 64 00 61 00
> |...J.... u.p.d.a.|
> 0010 74 00 65 00 20 00 73 00-75 00 70 00 72 00 65 00 |t.e.
> .s. u.p.r.e.|
> 0020 73 00 73 00 5f 00 65 00-73 00 74 00 69 00 6d 00
> |s.s._.e. s.t.i.m.|
> 0030 0a 00 73 00 65 00 74 00-20 00 64 00 65 00 74 00
> |..s.e.t.  .d.e.t.|
> 0040 61 00 69 00 6c 00 65 00-73 00 74 00 69 00 6d 00
> |a.i.l.e. s.t.i.m.|
> 0050 61 00 74 00 65 00 5f 00-69 00 64 00 3d 00 62 00
> |a.t.e._. i.d.=.b.|
> 0060 2e 00 64 00 65 00 74 00-61 00 69 00 6c 00 65 00
> |..d.e.t. a.i.l.e.|
> 0070 73 00 74 00 69 00 6d 00-61 00 74 00 65 00 5f 00
> |s.t.i.m. a.t.e._.|
> 0080 69 00 64 00 0a 00 66 00-72 00 6f 00 6d 00 20 00
> |i.d...f. r.o.m. .|
> 0090 20 00 73 00 75 00 70 00-72 00 65 00 73 00 73 00 |
> .s.u.p. r.e.s.s.|
> 00a0 5f 00 65 00 73 00 74 00-69 00 6d 00 20 00 61 00
> |_.e.s.t. i.m. .a.|
> 00b0 2c 00 20 00 64 00 65 00-74 00 61 00 69 00 6c 00 |,.
> .d.e. t.a.i.l.|
> 00c0 65 00 64 00 5f 00 65 00-73 00 74 00 69 00 6d 00
> |e.d._.e. s.t.i.m.|
> 00d0 61 00 74 00 65 00 73 00-20 00 62 00 0a 00 77 00
> |a.t.e.s.  .b...w.|
> 00e0 68 00 65 00 72 00 65 00-20 00 61 00 2e 00 64 00
> |h.e.r.e.  .a...d.|
> 00f0 65 00 74 00 61 00 69 00-6c 00 65 00 73 00 74 00
> |e.t.a.i. l.e.s.t.|
> 0100 69 00 6d 00 61 00 74 00-65 00 5f 00 69 00 64 00
> |i.m.a.t. e._.i.d.|
> 0110 5f 00 73 00 74 00 72 00-3d 00 62 00 2e 00 64 00
> |_.s.t.r. =.b...d.|
> 0120 65 00 74 00 61 00 69 00-6c 00 65 00 73 00 74 00
> |e.t.a.i. l.e.s.t.|
> 0130 69 00 6d 00 61 00 74 00-65 00 5f 00 69 00 64 00
> |i.m.a.t. e._.i.d.|
> 0140 5f 00 73 00 74 00 72 00-0a 00     
>          
>    |_.s.t.r. ..|
>
> token.c:495:tds_process_tokens(0x538360, 0x7fbfffed90,
> (nil), 0x6914)
> util.c:162:Changed query state from PENDING to READING
> util.c:334:tdserror(0x537120, 0x538360, 20004, 104)
> util.c:368:tdserror: client library returned
> TDS_INT_CANCEL(2)
> util.c:389:tdserror: returning TDS_INT_CANCEL(2)
> util.c:162:Changed query state from READING to DEAD
> token.c:510:processing result tokens.  marker is 
> 0()
> token.c:108:tds_process_default_tokens() marker is 0()
> token.c:111:leaving tds_process_default_tokens() connection
> dead
> util.c:110:logic error: cannot change query state from DEAD
> to PENDING
> mem.c:563:tds_free_all_results()
>








Archive powered by MHonArc 2.6.24.

Top of Page