From: Pat Buxton Date: Mon, 16 Apr 2018 14:06:13 +0000 (-0400) Subject: Fix - Order of records is not guaranteed X-Git-Tag: rel_1_3_0b1~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d5b9fe63d6d416bf21969bd1c27c1e1a754a2d3;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix - Order of records is not guaranteed * 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 --- diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index c00e046573..f464d47ebd 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -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)