Temporary solution: http://code.google.com/p/web2py/issues/detail?id=354 ; todor's version is better than mine (also see my comment #4 in that thread)
Haven't yet tested it with 1.99 dal, but it should work as it is not very dependent on implementation details.

