]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix - Order of records is not guaranteed
authorPat Buxton <patrick.buxton@tartansolutions.com>
Mon, 16 Apr 2018 14:06:13 +0000 (10:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Apr 2018 14:06:13 +0000 (10:06 -0400)
 * Causes intermittent failure against Greenplum cluster
 * Tested using Greenplum dialact:
     https://github.com/PlaidCloud/sqlalchemy-greenplum

Change-Id: I6387e98f17a3667612fdaaadb27a08f79ec46398
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/440

lib/sqlalchemy/testing/suite/test_results.py

index c00e0465733aabde7a53c06212d85542b67342d9..f464d47ebde36487c9f2ab5f83002fcc5b31a394 100644 (file)
@@ -355,13 +355,13 @@ class ServerSideCursorsTest(fixtures.TestBase, testing.AssertsExecutionResults):
         test_table.create(checkfirst=True)
         test_table.insert().execute(data='data1')
         test_table.insert().execute(data='data2')
-        eq_(test_table.select().execute().fetchall(), [(1, 'data1'
-                                                        ), (2, 'data2')])
+        eq_(test_table.select().order_by(test_table.c.id).execute().fetchall(),
+            [(1, 'data1'), (2, 'data2')])
         test_table.update().where(
             test_table.c.id == 2).values(
             data=test_table.c.data +
             ' updated').execute()
-        eq_(test_table.select().execute().fetchall(),
+        eq_(test_table.select().order_by(test_table.c.id).execute().fetchall(),
             [(1, 'data1'), (2, 'data2 updated')])
         test_table.delete().execute()
         eq_(select([func.count('*')]).select_from(test_table).scalar(), 0)