]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added oracle8 test target, sets use_ansi to false
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Mar 2006 06:35:27 +0000 (06:35 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Mar 2006 06:35:27 +0000 (06:35 +0000)
got mapper, objectstore, inheritance unittest working with oracle8, tweaks to join syntax

lib/sqlalchemy/databases/oracle.py
test/inheritance.py
test/testbase.py

index 68e6ea17543777eb6112d89a66be256ef64bb387..4736a2dda1f62f10b6cc17e85cab1c806752816a 100644 (file)
@@ -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.
index 657af8a27023cd298c74b357c13ebc9bc35ffc1e..3202c34178af977b4b970de4a5903fefcdeeb3fe 100644 (file)
@@ -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()
 
index f10cce681acbf2ca4d1a9544cb9c790f6a23b099..f3dfac15bca772572a5d8484e913a33189e40c45 100644 (file)
@@ -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):