From 0d4a363a0caff6a094de674ffb92ce41f26801e8 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 17 Apr 2012 09:55:50 -0500 Subject: [PATCH] LENGTH fixed in MSSQL, thanks Denes --- VERSION | 2 +- gluon/dal.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c89b58c8..f07a6194 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-04-16 08:15:36) dev +Version 1.99.7 (2012-04-17 09:54:49) dev diff --git a/gluon/dal.py b/gluon/dal.py index 9e9d09ea..a03c2007 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -2535,6 +2535,11 @@ class MSSQLAdapter(BaseAdapter): def PRIMARY_KEY(self,key): return 'PRIMARY KEY CLUSTERED (%s)' % key + def AGGREGATE(self, first, what): + if what == 'LENGTH': + what = 'LEN' + return "%s(%s)" % (what, self.expand(first)) + def select_limitby(self, sql_s, sql_f, sql_t, sql_w, sql_o, limitby): if limitby: (lmin, lmax) = limitby