From: Mike Bayer Date: Thu, 4 Feb 2016 01:37:42 +0000 (-0500) Subject: - more oracle fixes X-Git-Tag: rel_1_1_0b1~98^2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93c5328e66d8491e73027f6e789df2255c4fa767;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - more oracle fixes --- diff --git a/lib/sqlalchemy/testing/provision.py b/lib/sqlalchemy/testing/provision.py index 555a75b533..0feb419873 100644 --- a/lib/sqlalchemy/testing/provision.py +++ b/lib/sqlalchemy/testing/provision.py @@ -237,12 +237,17 @@ def _mysql_drop_db(cfg, eng, ident): @_create_db.for_db("oracle") def _oracle_create_db(cfg, eng, ident): + # NOTE: make sure you've run "ALTER DATABASE default tablespace users" or + # similar, so that the default tablespace is not "system"; reflection will + # fail otherwise with eng.connect() as conn: conn.execute("create user %s identified by xe" % ident) conn.execute("create user %s_ts1 identified by xe" % ident) conn.execute("create user %s_ts2 identified by xe" % ident) conn.execute("grant dba to %s" % (ident, )) - + conn.execute("grant unlimited tablespace to %s" % ident) + conn.execute("grant unlimited tablespace to %s_ts1" % ident) + conn.execute("grant unlimited tablespace to %s_ts2" % ident) @_configure_follower.for_db("oracle") def _oracle_configure_follower(config, ident): @@ -253,9 +258,9 @@ def _oracle_configure_follower(config, ident): @_drop_db.for_db("oracle") def _oracle_drop_db(cfg, eng, ident): with eng.connect() as conn: - conn.execute("drop user %s" % ident) - conn.execute("drop user %s_ts1" % ident) - conn.execute("drop user %s_ts2" % ident) + conn.execute("drop user %s cascade" % ident) + conn.execute("drop user %s_ts1 cascade" % ident) + conn.execute("drop user %s_ts2 cascade" % ident) @_follower_url_from_main.for_db("oracle") diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index 0457b2e26b..1874f6210e 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -113,7 +113,7 @@ class ComponentReflectionTest(fixtures.TablesTest): # temp table fixture if testing.against("oracle"): kw = { - 'prefixes': ["TEMPORARY", "GLOBAL"], + 'prefixes': ["GLOBAL TEMPORARY"], 'oracle_on_commit': 'PRESERVE ROWS' } else: