fixed issue 1397, fixed CHAR_LENGTH in Firebird thanks Villas
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.4.5-stable+timestamp.2013.03.21.11.20.48
|
Version 2.4.5-stable+timestamp.2013.03.21.11.29.00
|
||||||
|
|||||||
+8
-1
@@ -1126,6 +1126,9 @@ class BaseAdapter(ConnectionPool):
|
|||||||
def EPOCH(self, first):
|
def EPOCH(self, first):
|
||||||
return self.EXTRACT(first, 'epoch')
|
return self.EXTRACT(first, 'epoch')
|
||||||
|
|
||||||
|
def LENGTH(self, first):
|
||||||
|
return "LENGTH(%s)" % self.expand(first)
|
||||||
|
|
||||||
def AGGREGATE(self, first, what):
|
def AGGREGATE(self, first, what):
|
||||||
return "%s(%s)" % (what, self.expand(first))
|
return "%s(%s)" % (what, self.expand(first))
|
||||||
|
|
||||||
@@ -3448,6 +3451,9 @@ class FireBirdAdapter(BaseAdapter):
|
|||||||
def SUBSTRING(self,field,parameters):
|
def SUBSTRING(self,field,parameters):
|
||||||
return 'SUBSTRING(%s from %s for %s)' % (self.expand(field), parameters[0], parameters[1])
|
return 'SUBSTRING(%s from %s for %s)' % (self.expand(field), parameters[0], parameters[1])
|
||||||
|
|
||||||
|
def LENGTH(self, first):
|
||||||
|
return "CHAR_LENGTH(%s)" % self.expand(first)
|
||||||
|
|
||||||
def CONTAINING(self,first,second):
|
def CONTAINING(self,first,second):
|
||||||
"case in-sensitive like operator"
|
"case in-sensitive like operator"
|
||||||
return '(%s CONTAINING %s)' % (self.expand(first),
|
return '(%s CONTAINING %s)' % (self.expand(first),
|
||||||
@@ -4422,6 +4428,7 @@ class NoSQLAdapter(BaseAdapter):
|
|||||||
def LOWER(self,first): raise SyntaxError("Not supported")
|
def LOWER(self,first): raise SyntaxError("Not supported")
|
||||||
def UPPER(self,first): raise SyntaxError("Not supported")
|
def UPPER(self,first): raise SyntaxError("Not supported")
|
||||||
def EXTRACT(self,first,what): raise SyntaxError("Not supported")
|
def EXTRACT(self,first,what): raise SyntaxError("Not supported")
|
||||||
|
def LENGTH(self, first): raise SyntaxError("Not supported")
|
||||||
def AGGREGATE(self,first,what): raise SyntaxError("Not supported")
|
def AGGREGATE(self,first,what): raise SyntaxError("Not supported")
|
||||||
def LEFT_JOIN(self): raise SyntaxError("Not supported")
|
def LEFT_JOIN(self): raise SyntaxError("Not supported")
|
||||||
def RANDOM(self): raise SyntaxError("Not supported")
|
def RANDOM(self): raise SyntaxError("Not supported")
|
||||||
@@ -8746,7 +8753,7 @@ class Expression(object):
|
|||||||
|
|
||||||
def len(self):
|
def len(self):
|
||||||
db = self.db
|
db = self.db
|
||||||
return Expression(db, db._adapter.AGGREGATE, self, 'LENGTH', 'integer')
|
return Expression(db, db._adapter.LENGTH, self, None, 'integer')
|
||||||
|
|
||||||
def avg(self):
|
def avg(self):
|
||||||
db = self.db
|
db = self.db
|
||||||
|
|||||||
Reference in New Issue
Block a user