Hide Forgot
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.
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)
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.
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
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
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
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
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
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
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
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
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.
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.