]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
for this test, apparently we don't handle sets as unordered since neither does
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Jul 2013 00:35:01 +0000 (20:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Jul 2013 00:36:23 +0000 (20:36 -0400)
MySQL.  for some reason set ordering was constant when testing mysqldb, but not
so with oursql.

test/dialect/mysql/test_types.py

index fb1de72df95324c38854778bf7e034858dd4c2be..b918abe25645d3645809f8cc021528c9d1dd6c84 100644 (file)
@@ -511,9 +511,15 @@ class TypesTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
         set_table.insert().execute({'s3': set(['5'])},
                 {'s3': set(['5', '7'])}, {'s3': set(['5', '7', '9'])},
                 {'s3': set(['7', '9'])})
-        rows = select([set_table.c.s3], set_table.c.s3.in_([set(['5'
-                      ]), set(['5', '7']), set(['7', '5'
-                      ])])).execute().fetchall()
+
+        # NOTE: the string sent to MySQL here is sensitive to ordering.
+        # for some reason the set ordering is always "5, 7" when we test on
+        # MySQLdb but in Py3K this is not guaranteed.   So basically our
+        # SET type doesn't do ordering correctly (not sure how it can,
+        # as we don't know how the SET was configured in the first place.)
+        rows = select([set_table.c.s3],
+                    set_table.c.s3.in_([set(['5']), ['5', '7']])
+                        ).execute().fetchall()
         found = set([frozenset(row[0]) for row in rows])
         eq_(found, set([frozenset(['5']), frozenset(['5', '7'])]))