diff --git a/VERSION b/VERSION index cc7a7841..71da9f7c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.5-stable+timestamp.2013.03.28.14.58.27 +Version 2.4.5-stable+timestamp.2013.03.28.15.17.58 diff --git a/gluon/dal.py b/gluon/dal.py index 58eac01e..02315140 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -3111,7 +3111,9 @@ class MSSQLAdapter(BaseAdapter): (lmin, lmax) = limitby sql_s += ' TOP %i' % lmax if 'GROUP BY' in sql_o: - sql_o = sql_o[:sql_o.find('ORDER BY ')] + orderfound = sql_o.find('ORDER BY ') + if orderfound >= 0: + sql_o = sql_o[:orderfound] return 'SELECT %s %s FROM %s%s%s;' % (sql_s, sql_f, sql_t, sql_w, sql_o) TRUE = 1