Hi *, I recently inherited maintenance of the storm package in Fedora, and I'm having the exact same problem as Markus: I need to use sys.maxint - 1 as the limit when only offset is set. If I use sys.maxint, no result is returned. I'll add a patch in the RPM, in the meantime it'd be nice to know why this happens (compilation option in sqlite?). And maybe you could just use sys.maxint-1 for every platform? That wouldn't cause much harm I guess.
Thanks, and sorry for not catching that before 0.20 was released. Aurélien 2013/6/28 Free Ekanayaka <[email protected]> > Hi Markus, > > On Thu, Jun 27, 2013 at 4:47 PM, Markus Kemmerling > <[email protected]> wrote: > > Hi Free, > > > > when running Storm tests under OS X (10.8.4, Python 2.6.8, SQLite > 3.7.17) I also noticed that the following two tests fail: > > > > FAIL: test_result_set_count_sliced (tests.sqlobject.SQLObjectTest) > > ---------------------------------------------------------------------- > > Traceback (most recent call last): > > File "/Users/markus/Desktop/storm-0.19/tests/mocker.py", line 102, in > test_method_wrapper > > result = test_method() > > File "/Users/markus/Desktop/storm-0.19/tests/sqlobject.py", line 755, > in test_result_set_count_sliced > > self.assertEquals(len(list(sliced_result)), 1) > > AssertionError: 0 != 1 > > > > ====================================================================== > > FAIL: test_find_slice_offset (tests.store.sqlite.SQLiteStoreTest) > > ---------------------------------------------------------------------- > > Traceback (most recent call last): > > File "/Users/markus/Desktop/storm-0.19/tests/mocker.py", line 102, in > test_method_wrapper > > result = test_method() > > File "/Users/markus/Desktop/storm-0.19/tests/store/base.py", line 754, > in test_find_slice_offset > > (10, "Title 30")]) > > AssertionError: [] != [(20, 'Title 20'), (10, 'Title 30')] > > > > These tests create a SELECT statement with LIMIT set to sys.maxint. > Reducing sys.maxint by 1 in storm.databases.sqlite.compile_select_sqlite > makes these tests pass again: > > > > --- storm/databases/sqlite.py.orig 2013-06-09 12:35:28.000000000 > +0200 > > +++ storm/databases/sqlite.py 2013-06-09 12:35:28.000000000 +0200 > > @@ -48,7 +48,7 @@ > > @compile.when(Select) > > def compile_select_sqlite(compile, select, state): > > if select.offset is not Undef and select.limit is Undef: > > - select.limit = sys.maxint > > + select.limit = sys.maxint - 1 > > statement = compile_select(compile, select, state) > > if state.context is SELECT: > > # SQLite breaks with (SELECT ...) UNION (SELECT ...), so we > > Thanks. I commited your patch, just changing it slightly to only apply > if sys.platform is "darwin". > > Cheers, > > Free > > -- > storm mailing list > [email protected] > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/storm >
-- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
