- fixed SQL function truncation of trailing underscores

[ticket:996]
This commit is contained in:
Mike Bayer
2008-03-25 17:25:20 +00:00
parent 92a5df7753
commit fc2cf22038
3 changed files with 9 additions and 3 deletions
+4 -1
View File
@@ -20,7 +20,10 @@ CHANGES
- Fixed bug which was preventing synonym() attributes from
being used with inheritance
- fixed SQL function truncation of trailing underscores
[ticket:996]
- Session.execute can now find binds from metadata
- adjusted the definition of "self-referential" to be
+1 -1
View File
@@ -777,7 +777,7 @@ class _FunctionGenerator(object):
except KeyError:
raise AttributeError(name)
elif name.startswith('_'):
elif name.endswith('_'):
name = name[0:-1]
f = _FunctionGenerator(**self.opts)
f.__names = list(self.__names) + [name]
+4 -1
View File
@@ -32,7 +32,10 @@ class CompileTest(TestBase, AssertsCompiledSQL):
else:
self.assert_compile(func.nosuchfunction(), "nosuchfunction()", dialect=dialect)
self.assert_compile(func.char_length('foo'), "char_length(%s)" % bindtemplate % {'name':'param_1', 'position':1}, dialect=dialect)
def test_underscores(self):
self.assert_compile(func.if_(), "if()")
def test_generic_now(self):
assert isinstance(func.now().type, sqltypes.DateTime)