From 93c5328e66d8491e73027f6e789df2255c4fa767 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 3 Feb 2016 20:37:42 -0500 Subject: [PATCH] - more oracle fixes --- lib/sqlalchemy/testing/provision.py | 13 +++++++++---- lib/sqlalchemy/testing/suite/test_reflection.py | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) 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: -- 2.47.2