fixed issue 1405, ORDERBY and mssql, thanks Niphlod

This commit is contained in:
mdipierro
2013-03-28 15:18:44 -05:00
parent 9d5e0b24f7
commit 8438a432e9
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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