mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-13 04:07:20 -04:00
- fixed SQL function truncation of trailing underscores
[ticket:996]
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user