diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-02-13 21:25:21 -0800 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-02-13 21:25:21 -0800 |
commit | 9134815951c8dd6abfe254d270d401434ad82fd6 (patch) | |
tree | ceafdfe839ed2369d2c3059426ac4ba97f44b713 /test/engine/test_execute.py | |
parent | 036cb93abfb44f4ab7fdb125eaaf2597a95a0187 (diff) | |
download | sqlalchemy-pr/71.tar.gz |
Take a stab at implementing nextsetpr/71
for multiple result sets
Diffstat (limited to 'test/engine/test_execute.py')
-rw-r--r-- | test/engine/test_execute.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index d3bd3c2cd..6e15b3d3c 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -59,6 +59,24 @@ class ExecuteTest(fixtures.TestBase): scalar(stmt) eq_(result, '%') + @testing.fails_on_everything_except('mssql+pymssql') + def test_nextset(self): + conn = testing.db.connect() + test_data = ((1, 'jack'), (2, 'fred'), (3, 'ed'), + (4, 'horse'), (5, 'barney'), (6, 'donkey')) + for user_id, user_name in test_data: + conn.execute('insert into users (user_id, user_name) ' + 'values (%s, %s)', user_id, user_name) + res = conn.execute( + """select * from users where user_id in (1, 3, 5) order by user_id + select * from users where user_id in (2, 4, 6) order by user_id + """) + rows = res.fetchall(close=False) + assert rows == [(1, 'jack'), (3, 'ed'), (5, 'barney')] + res.nextset() + rows = res.fetchall() + assert rows == [(2, 'fred'), (4, 'horse'), (6, 'donkey')] + @testing.fails_on_everything_except('firebird', 'sqlite', '+pyodbc', '+mxodbc', '+zxjdbc', 'mysql+oursql') |