Re: FW: 01000 (20017) [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
2010/4/25 Mark Norman <[email protected]>:
>
> 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: [email protected]
>

freddy77
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.