@@ -53,9 +53,9 @@ use crate::{
53
53
} ;
54
54
use crate :: { resolve_ext_path, Connection , Result , TransactionState , DATABASE_VERSION } ;
55
55
use insn:: {
56
- exec_add, exec_and, exec_bit_and, exec_bit_not, exec_bit_or, exec_boolean_not , exec_concat ,
57
- exec_divide , exec_multiply , exec_or , exec_remainder , exec_shift_left , exec_shift_right ,
58
- exec_subtract, Cookie ,
56
+ cast_text_to_numerical , exec_add, exec_and, exec_bit_and, exec_bit_not, exec_bit_or,
57
+ exec_boolean_not , exec_concat , exec_divide , exec_multiply , exec_or , exec_remainder ,
58
+ exec_shift_left , exec_shift_right , exec_subtract, Cookie ,
59
59
} ;
60
60
use likeop:: { construct_like_escape_arg, exec_glob, exec_like_with_escape} ;
61
61
use rand:: distributions:: { Distribution , Uniform } ;
@@ -3583,11 +3583,7 @@ fn exec_cast(value: &OwnedValue, datatype: &str) -> OwnedValue {
3583
3583
OwnedValue :: Text ( t) => {
3584
3584
let text = t. as_str ( ) ;
3585
3585
// Looks like a float
3586
- if text. contains ( '.' ) || text. contains ( 'e' ) || text. contains ( 'E' ) {
3587
- cast_text_to_real ( text)
3588
- } else {
3589
- cast_text_to_integer ( text)
3590
- }
3586
+ cast_text_to_numerical ( text)
3591
3587
}
3592
3588
OwnedValue :: Integer ( i) => OwnedValue :: Integer ( * i) ,
3593
3589
OwnedValue :: Float ( f) => OwnedValue :: Float ( * f) ,
0 commit comments