@@ -387,13 +387,27 @@ mod tests {
387
387
// so we need to check that limbo and sqlite return the same results when the ordering is reversed.
388
388
// because we are generally using LIMIT (to make the test complete faster), we need to rerun the query
389
389
// without limit and then check that the results are the same if reversed.
390
- let query_no_limit =
391
- format ! ( "SELECT * FROM t {} {} {}" , where_clause, order_by, "" ) ;
392
- let limbo_no_limit = limbo_exec_rows ( & dbs[ i] , & limbo_conns[ i] , & query_no_limit) ;
393
- let sqlite_no_limit = sqlite_exec_rows ( & sqlite_conn, & query_no_limit) ;
394
- let limbo_rev = limbo_no_limit. iter ( ) . cloned ( ) . rev ( ) . collect :: < Vec < _ > > ( ) ;
395
- if limbo_rev == sqlite_no_limit {
396
- continue ;
390
+ let order_by_only_equalities = !order_by_components. is_empty ( )
391
+ && order_by_components. iter ( ) . all ( |o : & String | {
392
+ if o. starts_with ( "x " ) {
393
+ comp1. map_or ( false , |c| c == "=" )
394
+ } else if o. starts_with ( "y " ) {
395
+ comp2. map_or ( false , |c| c == "=" )
396
+ } else {
397
+ comp3. map_or ( false , |c| c == "=" )
398
+ }
399
+ } ) ;
400
+
401
+ if order_by_only_equalities {
402
+ let query_no_limit =
403
+ format ! ( "SELECT * FROM t {} {} {}" , where_clause, order_by, "" ) ;
404
+ let limbo_no_limit =
405
+ limbo_exec_rows ( & dbs[ i] , & limbo_conns[ i] , & query_no_limit) ;
406
+ let sqlite_no_limit = sqlite_exec_rows ( & sqlite_conn, & query_no_limit) ;
407
+ let limbo_rev = limbo_no_limit. iter ( ) . cloned ( ) . rev ( ) . collect :: < Vec < _ > > ( ) ;
408
+ if limbo_rev == sqlite_no_limit {
409
+ continue ;
410
+ }
397
411
}
398
412
panic ! (
399
413
"limbo: {:?}, sqlite: {:?}, seed: {}, query: {}" ,
0 commit comments