|
|
|
@ -94,24 +94,18 @@ dfield_data_is_binary_equal( |
|
|
|
} |
|
|
|
|
|
|
|
/**************************************************************** |
|
|
|
Returns TRUE if lengths of two dtuples are equal and respective data fields |
|
|
|
in them are equal when compared with collation in char fields (not as binary |
|
|
|
strings). */ |
|
|
|
Compare two data tuples, respecting the collation of character fields. */ |
|
|
|
|
|
|
|
ibool |
|
|
|
dtuple_datas_are_ordering_equal( |
|
|
|
/*============================*/ |
|
|
|
/* out: TRUE if length and fieds are equal |
|
|
|
when compared with cmp_data_data: |
|
|
|
NOTE: in character type fields some letters |
|
|
|
are identified with others! (collation) */ |
|
|
|
int |
|
|
|
dtuple_coll_cmp( |
|
|
|
/*============*/ |
|
|
|
/* out: 1, 0 , -1 if tuple1 is greater, equal, |
|
|
|
less, respectively, than tuple2 */ |
|
|
|
const dtuple_t* tuple1, /* in: tuple 1 */ |
|
|
|
const dtuple_t* tuple2) /* in: tuple 2 */ |
|
|
|
{ |
|
|
|
const dfield_t* field1; |
|
|
|
const dfield_t* field2; |
|
|
|
ulint n_fields; |
|
|
|
ulint i; |
|
|
|
ulint n_fields; |
|
|
|
ulint i; |
|
|
|
|
|
|
|
ut_ad(tuple1 && tuple2); |
|
|
|
ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N); |
|
|
|
@ -123,21 +117,22 @@ dtuple_datas_are_ordering_equal( |
|
|
|
|
|
|
|
if (n_fields != dtuple_get_n_fields(tuple2)) { |
|
|
|
|
|
|
|
return(FALSE); |
|
|
|
return(n_fields < dtuple_get_n_fields(tuple2) ? -1 : 1); |
|
|
|
} |
|
|
|
|
|
|
|
for (i = 0; i < n_fields; i++) { |
|
|
|
int cmp; |
|
|
|
const dfield_t* field1 = dtuple_get_nth_field(tuple1, i); |
|
|
|
const dfield_t* field2 = dtuple_get_nth_field(tuple2, i); |
|
|
|
|
|
|
|
field1 = dtuple_get_nth_field(tuple1, i); |
|
|
|
field2 = dtuple_get_nth_field(tuple2, i); |
|
|
|
|
|
|
|
if (0 != cmp_dfield_dfield(field1, field2)) { |
|
|
|
cmp = cmp_dfield_dfield(field1, field2); |
|
|
|
|
|
|
|
return(FALSE); |
|
|
|
if (cmp) { |
|
|
|
return(cmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return(TRUE); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
|
|
|
|
/************************************************************************* |
|
|
|
|