Commit b149310 1 parent e2c7184 commit b149310 Copy full SHA for b149310
File tree 2 files changed +7
-7
lines changed
components/cop_datatype/src/def
src/coprocessor/dag/rpn_expr
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,11 @@ pub trait FieldTypeAccessor {
193
193
fn is_non_binary_string_like ( & self ) -> bool {
194
194
self . collation ( ) != Collation :: Binary && self . is_string_like ( )
195
195
}
196
+
197
+ /// Whether the flag contains `FieldTypeFlag::UNSIGNED`
198
+ fn is_unsigned ( & self ) -> bool {
199
+ self . flag ( ) . contains ( FieldTypeFlag :: UNSIGNED )
200
+ }
196
201
}
197
202
198
203
impl FieldTypeAccessor for FieldType {
Original file line number Diff line number Diff line change 3
3
use std:: convert:: TryFrom ;
4
4
5
5
use cop_codegen:: rpn_fn;
6
- use cop_datatype:: { EvalType , FieldTypeAccessor , FieldTypeFlag } ;
6
+ use cop_datatype:: { EvalType , FieldTypeAccessor } ;
7
7
use tipb:: expression:: FieldType ;
8
8
9
9
use crate :: coprocessor:: codec:: data_type:: * ;
@@ -23,7 +23,7 @@ pub fn get_cast_fn_rpn_node(
23
23
let to = box_try ! ( EvalType :: try_from( to_field_type. tp( ) ) ) ;
24
24
let func_meta = match ( from, to) {
25
25
( EvalType :: Int , EvalType :: Decimal ) => {
26
- if !is_unsigned ( from_field_type ) && !is_unsigned ( & to_field_type ) {
26
+ if !from_field_type . is_unsigned ( ) && !to_field_type . is_unsigned ( ) {
27
27
cast_int_as_decimal_fn_meta ( )
28
28
} else {
29
29
cast_uint_as_decimal_fn_meta ( )
@@ -47,11 +47,6 @@ pub fn get_cast_fn_rpn_node(
47
47
} )
48
48
}
49
49
50
- #[ inline]
51
- fn is_unsigned ( ft : & FieldType ) -> bool {
52
- ft. as_accessor ( ) . flag ( ) . contains ( FieldTypeFlag :: UNSIGNED )
53
- }
54
-
55
50
fn produce_dec_with_specified_tp (
56
51
ctx : & mut EvalContext ,
57
52
dec : Decimal ,
You can’t perform that action at this time.
0 commit comments