mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
fix: cmp integer/float
This commit is contained in:
@@ -92,7 +92,7 @@ impl PartialOrd<OwnedValue> for OwnedValue {
|
||||
int_left.partial_cmp(int_right)
|
||||
}
|
||||
(OwnedValue::Integer(int_left), OwnedValue::Float(float_right)) => {
|
||||
float_right.partial_cmp(&(*int_left as f64))
|
||||
(*int_left as f64).partial_cmp(float_right)
|
||||
}
|
||||
(OwnedValue::Float(float_left), OwnedValue::Integer(int_right)) => {
|
||||
float_left.partial_cmp(&(*int_right as f64))
|
||||
|
||||
@@ -295,6 +295,18 @@ do_execsql_test max-str {
|
||||
select max('b','a','z')
|
||||
} {z}
|
||||
|
||||
do_execsql_test min-int-float {
|
||||
select min(1,5.0)
|
||||
} {1}
|
||||
|
||||
do_execsql_test max-int-float {
|
||||
select max(1,5.0)
|
||||
} {5.0}
|
||||
|
||||
do_execsql_test min-float-int {
|
||||
select min(5.0,1)
|
||||
} {1}
|
||||
|
||||
do_execsql_test max-null {
|
||||
select max(null,null)
|
||||
} {}
|
||||
|
||||
Reference in New Issue
Block a user