Commits

Mike Bayer committed 9677f0b

repaired FB functions, [ticket:862]

Comments (0)

Files changed (2)

lib/sqlalchemy/databases/firebird.py

         else:
             return self.process(alias.original, **kwargs)
 
-    def visit_function(self, func):
+    def apply_function_parens(self, func):
         if func.clauses:
-            return super(FBCompiler, self).visit_function(func)
+            return super(FBCompiler, self).apply_function_parens(func)
         else:
-            return func.name
+            return False
 
     def default_from(self):
         return " FROM rdb$database"

test/dialect/firebird.py

         s = select([t.alias()])
         self.assert_compile(s, "SELECT sometable_1.col1, sometable_1.col2 FROM sometable sometable_1")
 
-
+    def test_function(self):
+        self.assert_compile(func.foo(1, 2), "foo(:foo, :foo_1)")
+        self.assert_compile(func.current_time(), "current_time")
+        self.assert_compile(func.foo(), "foo")
+        t = table('sometable', column('col1'), column('col2'))
+        self.assert_compile(select([func.max(t.c.col1)]), "SELECT max(sometable.col1) FROM sometable")
+        
 if __name__ == '__main__':
     testbase.main()