Public bug reported:

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://hu.archive.ubuntu.com/ubuntu/ lucid/universe Packages
        100 /var/lib/dpkg/status

Note, I tried to compile the new version of python-pymssql from
http://code.google.com/p/pymssql/downloads/detail?name=pymssql-1.9.908.tar.gz&can=2&q=
but the cython package required and available in the distribution
conflicts in version.

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.connect(user='d2ruser', password='XXX', server='XXX', 
>>> database='XXX')
>>> C.execute_query('SELECT current_user; SELECT GETDATE();')>>> for r in C: 
>>> print r
...
{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.connect(user='d2ruser', password='XXX', server='XXX', 
>>> database='XXX')
>>> C.execute_query('SELECT current_user; SELECT GETDATE();')
>>> for r in C: print r
...
{0: 'd2ruser'}
>>> C.nextresult()
1
>>>
>>> for r in C: print r
...
{0: datetime.datetime(2010, 9, 9, 9, 50, 47, 27000)}
>>> C.nextresult()
>>> print C.nextresult()
None
>>>
#####################################################

Please consider packaging a newer version of the sources.

Thanks. Kind regards,
 S.J.

** Affects: pymssql (Ubuntu)
     Importance: Undecided
         Status: New

-- 
nextresult method in _mssql connect always returns True, and never points to 
next result set if there is any more
https://bugs.launchpad.net/bugs/633882
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to