diff --git a/sqlor/mysqlor.py b/sqlor/mysqlor.py index c31237e..53bd9d5 100755 --- a/sqlor/mysqlor.py +++ b/sqlor/mysqlor.py @@ -72,7 +72,8 @@ class MySqlor(SQLor): return tuple(d) def pagingSQLmodel(self): - return u"""select * from (%s) A order by $[sort]$ + return """select * row_number() over(order by $[sort]$) as row_num_ from (%s) A limit $[from_line]$, $[rows]$""" + return """select * from (%s) A order by $[sort]$ limit $[from_line]$,$[rows]$""" def tablesSQL(self): diff --git a/sqlor/sor.py b/sqlor/sor.py index 299dabd..23808b3 100755 --- a/sqlor/sor.py +++ b/sqlor/sor.py @@ -144,7 +144,7 @@ class SQLor(object): return name=='sqlor' def pagingSQLmodel(self): - return u"" + return "" def placeHolder(self,varname,pos=None): if varname=='__mainsql__' : @@ -194,8 +194,7 @@ class SQLor(object): 'from_line':from_line, 'end_line':end_line, 'rows':rows, - 'sort':sort, - 'order':'', + 'sort':sort } ac = ArgsConvert('$[',']$') psql = ac.convert(psql,ns) @@ -415,8 +414,7 @@ class SQLor(object): "paging":{ "rowsname":"rows", "pagename":"page", - "sortname":"sort", - "ordername":"order" + "sortname":"sort" } }) if desc.get('sortfield',False):