Bug 670346 - Queries >= 505 bytes result in error: Unexpected EOF from the server
Summary: Queries >= 505 bytes result in error: Unexpected EOF from the server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: freetds
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Dmitry Butskoy
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-17 23:28 UTC by Kieron Briggs
Modified: 2011-03-19 10:29 UTC (History)
1 user (show)

Fixed In Version: freetds-0.82.1-0.3.20110306dev.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-19 05:47:51 UTC


Attachments (Terms of Use)
Test program demonstrating the error (3.13 KB, text/plain)
2011-01-17 23:28 UTC, Kieron Briggs
no flags Details
Proposed patch against freetds-0.82 (306 bytes, patch)
2011-01-17 23:32 UTC, Kieron Briggs
no flags Details | Diff

Description Kieron Briggs 2011-01-17 23:28:27 UTC
Created attachment 473945 [details]
Test program demonstrating the error

Description of problem:

Executing a parameterless ODBC prepared statement which is >= 505 bytes long against SQL Server results in a protocol error that causes SQL Server to drop the connection, which causes freetds to report "Unexpected EOF from the server".


Version-Release number of selected component (if applicable):

freetds-0.82 as packaged with Fedora 11+


How reproducible:

Always


Steps to Reproduce:
1. SQL[Driver]Connect() to a SQL Server database
2. SQLPrepare() a query >= 505 bytes long
3. SQLExecute()

See attached test program.

  
Actual results:

Error: [FreeTDS][SQL Server]Unexpected EOF from the server


Expected results:

Query executes successfully


Additional info:

This seems to be the result of the freetds 0.82 package shipped with all current Fedora releases not including a change that was checked into the upstream repository over two years ago: See http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/src/tds/query.c?view=log&pathrev=BRANCH0_82;
the current packages appear to contain revision 1.217.2.1; the change in question is revision 1.217.2.3 "fix tds_send_emulated_execute if no parameters".

Applying this simple, one-line change allows long queries to be executed successfully.

Comment 1 Kieron Briggs 2011-01-17 23:32:36 UTC
Created attachment 473946 [details]
Proposed patch against freetds-0.82

Proposed patch (taken from http://freetds.cvs.sourceforge.net/viewvc/freetds/freetds/src/tds/query.c?r1=1.217.2.2&r2=1.217.2.3&pathrev=BRANCH0_82)

Comment 2 Kieron Briggs 2011-01-19 04:50:57 UTC
It seems that the error can be avoided if the TDS_Version parameter is included in the connection string and set to either 7.0 or 8.0 (assuming, of course, that the server supports these versions). This is because a slightly different path is taken through the statement execution code which avoids the problematic line.

Comment 3 Fedora Update System 2011-02-10 18:53:19 UTC
freetds-0.82.1-0.1.20100810dev.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.1.20100810dev.fc14

Comment 4 Fedora Update System 2011-02-10 18:54:01 UTC
freetds-0.82.1-0.1.20100810dev.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.1.20100810dev.fc13

Comment 5 Fedora Update System 2011-02-13 08:50:28 UTC
freetds-0.82.1-0.1.20100810dev.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update freetds'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/freetds-0.82.1-0.1.20100810dev.fc14

Comment 6 Fedora Update System 2011-02-14 16:12:04 UTC
freetds-0.82.1-0.2.20100810dev.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.2.20100810dev.fc15

Comment 7 Fedora Update System 2011-02-14 16:13:52 UTC
freetds-0.82.1-0.2.20100810dev.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.2.20100810dev.fc14

Comment 8 Fedora Update System 2011-02-14 16:15:00 UTC
freetds-0.82.1-0.2.20100810dev.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.2.20100810dev.fc13

Comment 9 Fedora Update System 2011-03-09 19:00:48 UTC
freetds-0.82.1-0.3.20110306dev.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.3.20110306dev.fc15

Comment 10 Fedora Update System 2011-03-09 19:01:41 UTC
freetds-0.82.1-0.3.20110306dev.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/freetds-0.82.1-0.3.20110306dev.fc14

Comment 11 Fedora Update System 2011-03-19 05:47:47 UTC
freetds-0.82.1-0.3.20110306dev.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2011-03-19 10:29:39 UTC
freetds-0.82.1-0.3.20110306dev.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.