freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] FW: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server
- From: Frediano Ziglio <freddy77 AT gmail.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] FW: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server
- Date: Mon, 26 Apr 2010 15:35:06 +0200
2010/4/25 Mark Norman <mnorman AT lyris.com>:
>
> I have a Ruby program that is accessing a Microsoft SQL Server 2005
> database using odbc and dbi.
> I have verified that connectivity via ODBC is working by using isql
> The Ruby program is, I think, ok, because it works on my Windows XP system.
>
> When I send a SQL query which is greater than or equal to 505 bytes long, I
> get the error
> 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server
>
> When the query is less than 505 bytes, it works - no error.
> It doesn't matter what is in the query or how much data it returns, it is
> just the length of the query string.
>
> Excerpt from my Ruby program:
> $lhq_db = DBI.connect("DBI:ODBC:LHQDB", "mark", "<password>")
> ...
> query = "Select SI.url, O.displayName
> FROM Person P, Organization O, OrganizationPersonAccount OPA,
> ServiceAccount SA, ServiceInstance SI
> where P.login = '#{@user_login}' and
> P.id = OPA.person_id and
> P.id = SA.person_id and
> OPA.organization_id = O.id and
> SA.organization_id = O.id and
> SA.service_id = SI.id and "
>
> query << servers_part_of_query(@el_servers)
> query << " order by SI.url, O.displayName"
> stmt = $lhq_db.prepare(query)
> stmt.execute()
>
> @server_org_hash = {}
> prev_url=""
> orgs = Array.new
> while (row=stmt.fetch)
> url,org = row
> #printf("%s => %s\n", url, org)
> if (prev_url != url)
> if (prev_url != "")
> @server_org_hash[prev_url] = orgs
> orgs = Array.new
> end
> prev_url = url
> end
> #puts "adding #{org}"
> orgs << org
> end
>
> if prev_url != ""
> @server_org_hash[prev_url] = orgs
> end
>
> stmt.finish
>
>
> My setup:
>
> Ubuntu 2.6.28-11-server #42-Ubuntu
> I am using 0.82 feetds
>
> /etc/odbc.ini
>
> [LHQDB]
> Driver = FreeTDS
> Description = LHQ QA database
> Trace = No
> Server = 10.2.7.211
> Port = 1433
> TDS Version = 8.0
I thinkg the problem is here, should be TDS_Version = 8.0 (note
underscore). 504 + 8 (header) = 512 which is protocol 4.2 packet
setting. Usually protocol 7+ use 4096 as packet size. Well... should
work even on 4.2 but this can be a cause.
> Database = LHQ
>
> /etc/odbcinst.ini
>
> [FreeTDS]
> Description = v8.0
> Driver = /usr/lib/odbc/libtdsodbc.so
> UsageCount = 1
>
>
> Thanks!!!
>
> Mark Norman
> QA Engineer, Lyris Inc.
> Tel: (408) 844-2939
> Cell: (408) 772-6267
> Email: mnorman AT lyris.com
>
freddy77
-
[freetds] FW: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server,
Mark Norman, 04/24/2010
- Re: [freetds] FW: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server, Frediano Ziglio, 04/26/2010
Archive powered by MHonArc 2.6.24.