Hello,

The new CRUD facilities in 1.56.3 are very nice to have, but they call
the select function in the gluon/sql.py file with a attribute
dictionary containing an empty entry 'limitby'==None.

This function expects for the msswl/mssql2 driver  that this attribute
is either valid, a tuple (start,end) or non existent. The current
version cannot handle the None and failes with a ticket-error.

I've made a quick patch see below and will sent my patched sql.py by
mail.

As a sidenote: I noticed that the 'end' parameter is ignored. Is this
intentional? I will test my own suggestion in the comment of the patch
at a later date.

Nico de Groot


*** sql-org.py  2009-02-15 08:12:00.000000000 +0100
--- sql.py      2009-02-19 14:21:32.327744400 +0100
***************
*** 1869,1875 ****
              key = self._db._uri + '/' + query
              r = cache_model(key, lambda : response(query),
time_expire)
          if self._db._dbname == 'mssql' or self._db._dbname ==
'mssql2':
!             r = r[attributes.get('limitby', (0, ))[0]:]
          return SQLRows(self._db, r, *self.colnames)

      def _count(self):
--- 1869,1883 ----
              key = self._db._uri + '/' + query
              r = cache_model(key, lambda : response(query),
time_expire)
          if self._db._dbname == 'mssql' or self._db._dbname ==
'mssql2':
!             # patch NCdG
!             attrlimitby=attributes.get('limitby', None )
!             if attrlimitby==None:
!                 r=r[0:]
!             else:
!                 r = r[attrlimitby[0]:]
! # original function ignores the end parameter in (begin,end) change
to?
! #               r = r[attrlimitby[0]:attrlimitby[1]]
!             # /patch NCdG
          return SQLRows(self._db, r, *self.colnames)

      def _count(self):

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to