nextresult method in _mssql connect always returns True, and never points to next result set if there is any more
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pymssql (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Dear Maintainer,
I am struggling with a strange issue concerning python-pymssql package, which may be related to bux #463830 The problem questions the usability of the module. It occurs when importing and using the native _mssql module from the up-to-date (python-pymssql 1.0.2+dfsg-1) version of the package.
Problems:
* It seems that only the first result set of a query is retrievable,
* The nextresult() method of the connection will always return True and will not point to the next result set if any.
System:
$ lsb_release -rd
Description: Ubuntu 10.04.1 LTS
Release: 10.04
$ apt-cache policy python-pymssql
python-pymssql:
Installed: 1.0.2+dfsg-1
Candidate: 1.0.2+dfsg-1
Version table:
*** 1.0.2+dfsg-1 0
500 http://
100 /var/lib/
Note, I tried to compile the new version of python-pymssql from http://
The sequence of commands to generate erronous behaviour:
#######
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _mssql
>>> C=_mssql.
>>> C.execute_
...
{0: 'd2ruser'}
>>> C.nextresult()
1
>>> for r in C: print r
...
>>> C.nextresult()
1
>>> C.nextresult()
1
>>>
#######
As a comparison the same command set works in debian lenny (with python-pymssql 1.0.1+dfsg-1):
#######
$ python
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import _mssql
>>> C=_mssql.
>>> C.execute_
>>> for r in C: print r
...
{0: 'd2ruser'}
>>> C.nextresult()
1
>>>
>>> for r in C: print r
...
{0: datetime.
>>> C.nextresult()
>>> print C.nextresult()
None
>>>
#######
Please consider packaging a newer version of the sources.
Thanks. Kind regards,
S.J.
I found a binary package that was required to successfully compile the up-to-date pymssql sources. /launchpad. net/ubuntu/ +source/ cython/ 0.12.1- 1.1/+build/ 1723320/ +files/ cython_ 0.12.1- 1.1_amd64. deb)
(https:/
Now in pymssql-1.9.908 this issue is not there any more, nextresult() operates as expected, and one can perfectly iterate over all result sets.
So presumably re-packaging python-pymssql will solve this sort of bug.
Kind regards,
S.J.