summaryrefslogtreecommitdiff
path: root/test/dialect/firebird.py
diff options
context:
space:
mode:
authorLele Gaifax <lele@metapensiero.it>2007-12-13 15:53:35 +0000
committerLele Gaifax <lele@metapensiero.it>2007-12-13 15:53:35 +0000
commit2c3c081fb0f481f665f38435586790fc70945b97 (patch)
tree880eb79b32978fb30b62ac1173bb6054c0ebd625 /test/dialect/firebird.py
parent8128a6378affeff76b573b1b4ca1e05e7d00b021 (diff)
downloadsqlalchemy-2c3c081fb0f481f665f38435586790fc70945b97.tar.gz
Use the external strlen UDF for func.length() under Firebird
Diffstat (limited to 'test/dialect/firebird.py')
-rw-r--r--test/dialect/firebird.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/dialect/firebird.py b/test/dialect/firebird.py
index de1f92793..f14422eb0 100644
--- a/test/dialect/firebird.py
+++ b/test/dialect/firebird.py
@@ -73,5 +73,27 @@ class CompileTest(SQLCompileTest):
self.assert_compile(select([func.max(t.c.col1)]), "SELECT max(sometable.col1) FROM sometable")
+class StrLenTest(PersistTest):
+ # On FB the length() function is implemented by an external UDF,
+ # strlen(). Various SA tests fail because they pass a parameter
+ # to it, and that does not work (it always results the maximum
+ # string length the UDF was declared to accept).
+ # This test checks that at least it works ok in other cases.
+
+ def test_strlen(self):
+ meta = MetaData(testbase.db)
+ t = Table('t1', meta,
+ Column('id', Integer, Sequence('t1idseq'), primary_key=True),
+ Column('name', String(10))
+ )
+ meta.create_all()
+ try:
+ t.insert(values=dict(name='dante')).execute()
+ t.insert(values=dict(name='alighieri')).execute()
+ select([func.count(t.c.id)],func.length(t.c.name)==5).execute().fetchone()[0] == 1
+ finally:
+ meta.drop_all()
+
+
if __name__ == '__main__':
testbase.main()