summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-23 06:35:27 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-23 06:35:27 +0000
commit26ec8e13fa80f23e5ad8ee3a84065bc5f50d057f (patch)
tree171986f6810baf486980bbb33bcf4f3fd6fa0116
parent05e5405051fed09597ec7ab9f41bc14aecdc4839 (diff)
downloadsqlalchemy-26ec8e13fa80f23e5ad8ee3a84065bc5f50d057f.tar.gz
added oracle8 test target, sets use_ansi to false
got mapper, objectstore, inheritance unittest working with oracle8, tweaks to join syntax
-rw-r--r--lib/sqlalchemy/databases/oracle.py13
-rw-r--r--test/inheritance.py2
-rw-r--r--test/testbase.py9
3 files changed, 11 insertions, 13 deletions
diff --git a/lib/sqlalchemy/databases/oracle.py b/lib/sqlalchemy/databases/oracle.py
index 68e6ea175..4736a2dda 100644
--- a/lib/sqlalchemy/databases/oracle.py
+++ b/lib/sqlalchemy/databases/oracle.py
@@ -233,14 +233,13 @@ class OracleCompiler(ansisql.ANSICompiler):
if join.isouter:
# if outer join, push on the right side table as the current "outertable"
- outertable = self._outertable
self._outertable = join.right
# now re-visit the onclause, which will be used as a where clause
# (the first visit occured via the Join object itself right before it called visit_join())
join.onclause.accept_visitor(self)
- self._outertable = outertable
+ self._outertable = None
self.visit_compound(self.wheres[join])
@@ -250,13 +249,9 @@ class OracleCompiler(ansisql.ANSICompiler):
self.strings[alias] = self.get_str(alias.original)
def visit_column(self, column):
- if self._use_ansi:
- return ansisql.ANSICompiler.visit_column(self, column)
-
- if column.table is self._outertable:
- self.strings[column] = "%s.%s(+)" % (column.table.name, column.name)
- else:
- self.strings[column] = "%s.%s" % (column.table.name, column.name)
+ ansisql.ANSICompiler.visit_column(self, column)
+ if not self._use_ansi and self._outertable is not None and column.table is self._outertable:
+ self.strings[column] = self.strings[column] + "(+)"
def visit_insert(self, insert):
"""inserts are required to have the primary keys be explicitly present.
diff --git a/test/inheritance.py b/test/inheritance.py
index 657af8a27..3202c3417 100644
--- a/test/inheritance.py
+++ b/test/inheritance.py
@@ -95,7 +95,7 @@ class InheritTest2(testbase.AssertMixin):
engine = testbase.db
global foo, bar, foo_bar
foo = Table('foo', engine,
- Column('id', Integer, primary_key=True),
+ Column('id', Integer, Sequence('foo_id_seq'), primary_key=True),
Column('data', String(20)),
).create()
diff --git a/test/testbase.py b/test/testbase.py
index f10cce681..f3dfac15b 100644
--- a/test/testbase.py
+++ b/test/testbase.py
@@ -25,7 +25,7 @@ def parse_argv():
elif sys.argv[1] == '--db':
(param, DBTYPE) = (sys.argv.pop(1), sys.argv.pop(1))
-
+ opts = {}
if (None == db_uri):
p = DBTYPE.split('.')
if len(p) > 1:
@@ -43,15 +43,18 @@ def parse_argv():
db_uri = 'mysql://database=test&host=127.0.0.1&user=scott&password=tiger'
elif DBTYPE == 'oracle':
db_uri = 'oracle://user=scott&password=tiger'
+ elif DBTYPE == 'oracle8':
+ db_uri = 'oracle://user=scott&password=tiger'
+ opts = {'use_ansi':False}
if not db_uri:
raise "Could not create engine. specify --db <sqlite|sqlite_file|postgres|mysql|oracle> to test runner."
if PROXY:
- db = proxy.ProxyEngine(echo=echo, default_ordering=True)
+ db = proxy.ProxyEngine(echo=echo, default_ordering=True, **opts)
db.connect(db_uri)
else:
- db = engine.create_engine(db_uri, echo=echo, default_ordering=True)
+ db = engine.create_engine(db_uri, echo=echo, default_ordering=True, **opts)
db = EngineAssert(db)
class PersistTest(unittest.TestCase):