@@ -2908,12 +2908,25 @@ impl ScalarType {
29082908 self . eq_inner ( other, false )
29092909 }
29102910
2911- // Determines equality among scalar types that ignores any custom OIDs or
2912- // embedded values.
2911+ /// Determines equality among scalar types that ignores any custom OIDs or
2912+ /// embedded values.
29132913 pub fn structural_eq ( & self , other : & ScalarType ) -> bool {
29142914 self . eq_inner ( other, true )
29152915 }
29162916
2917+ /// //////////// todo: comment
2918+ pub fn physical_eq ( & self , other : & ScalarType ) -> bool {
2919+ use ScalarType :: * ;
2920+ if self . base_eq ( other) {
2921+ return true ;
2922+ }
2923+ match ( self , other) {
2924+ ( String , VarChar { max_length : None } ) => true ,
2925+ ( VarChar { max_length : None } , String ) => true ,
2926+ _ => false ,
2927+ }
2928+ }
2929+
29172930 pub fn eq_inner ( & self , other : & ScalarType , structure_only : bool ) -> bool {
29182931 use ScalarType :: * ;
29192932 match ( self , other) {
@@ -2961,9 +2974,6 @@ impl ScalarType {
29612974 && a. 1 . scalar_type . eq_inner ( & b. 1 . scalar_type , structure_only)
29622975 } )
29632976 }
2964- //////////////// todo: comment
2965- ( String , VarChar { max_length : None } ) => true ,
2966- ( VarChar { max_length : None } , String ) => true ,
29672977 ( s, o) => ScalarBaseType :: from ( s) == ScalarBaseType :: from ( o) ,
29682978 }
29692979 }
0 commit comments