Created attachment 633939 [details] suggested patch Description of problem: I have a problem using python-sybase with a MS-SQL Server data base (TDS 7.1). cursor.execute() aborts with the error message "sp_cursoropen: The value of the parameter 'scrollopt' is invalid.". Version-Release number of selected component (if applicable): python-sybase-0.39-8.fc17 freetds-0.91-3.fc17 How reproducible: always Steps to Reproduce: 1. setup a connection to MS SQL server (TDS version 7.1) 2. use tsql to make sure freetds basic access workd 3. try to access with python-sybase db=Sybase.connect("ServerName", "UID", "PWD") c=db.cursor() c.execute("SELECT ...") Actual results: "sp_cursoropen: The value of the parameter 'scrollopt' is invalid.". Expected results: SELECT works Additional info: I sent the attached patch to freetds.org. The same problem has been reported a long time ago already: https://sourceforge.net/mailarchive/forum.php?thread_name=5c06fa770907291200w5e7aeb3akaba12ab95d419785%40mail.gmail.com&forum_name=python-sybase-misc As correctly stated there, the problem occurs with python-sybase v0.39 and later only. This is due to the fact that python-sybase started to use the ct_cursor() API in 0.39. But that's not a bug of python-sybase. I analyzed the problem and I found that FreeTDS ctlib code sends a value of 0 for cursor->type and cursor->concurrency to the server, which is invalid. It appears that these two fields are never properly initialized in ctlib. The ODBC code (odbc.c) has code that initializes these fields.
> I sent the attached patch to freetds.org. http://lists.ibiblio.org/pipermail/freetds/2012q4/028125.html Well, lets wait for upstream decision. Please, inform us if upstream apply this patch (or perform some another fixing of the issue), either in its testing or "freetds-patched" branch...
Upstream has accepted the patch: http://lists.ibiblio.org/pipermail/freetds/2012q4/028126.html http://lists.ibiblio.org/pipermail/freetds/2012q4/028127.html
Fine. Lets wait for actual appearing in CVS for 0.91
FreeTDS doesn't use CVS any more. Here are the upstream commits: http://gitorious.org/freetds/freetds/commit/8bd39e7360fc70b89191df69f137297ee3578ab3 (HEAD) http://gitorious.org/freetds/freetds/commit/f3ae29d975f3de4a2034d8ab7d340a308dce3c06 (0.91)
freetds-0.91-5.gitf3ae29d.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/freetds-0.91-5.gitf3ae29d.fc18
freetds-0.91-5.gitf3ae29d.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/freetds-0.91-5.gitf3ae29d.fc17
Package freetds-0.91-5.gitf3ae29d.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing freetds-0.91-5.gitf3ae29d.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-17776/freetds-0.91-5.gitf3ae29d.fc17 then log in and leave karma (feedback).
freetds-0.91-5.gitf3ae29d.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.