Hello:
I found two problems with SQLBuilder's .orderBy() routine:
1. Multiple values are sorted incorrectly one is negative and the other
positive.
2. Multiple negatives make a positive, yielding incorrect results.
Consider:
Res1 = TableNameHere.select(TableNameHere.q.fieldNameHere ==
False).orderBy("field1, field2") # correct results
Res2 = TableNameHere.select(TableNameHere.q.fieldNameHere ==
False).orderBy("-field1, field2") # same as 3
Res3 = TableNameHere.select(TableNameHere.q.fieldNameHere ==
False).orderBy("field1, -field2") # same as 2
Res4 = TableNameHere.select(TableNameHere.q.fieldNameHere ==
False).orderBy("-field1, -field2") # same as 1
Res5 = TableNameHere.select(TableNameHere.q.fieldNameHere == False,
orderBy=[TableNameHere.q.field1, -TableNameHere.q.field2])) #OK
If this is hard to parse / fix, fine.
I thought at least someone should know about it.
-- Kevin Rice
___________________________________
Kevin J. Rice
Senior Software Engineer, Textura LLC
51-K Sherwood Terrace, Lake Bluff IL
(847) 235-8437 (spells VISAFLUIDS)
(847) 845-7423 (845-RICE, cellphone)
___________________________________
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss