1
/***********************************************************************
2
Comparison services for records
4
(c) 1994-1996 Innobase Oy
6
Created 7/1/1994 Heikki Tuuri
7
************************************************************************/
9
/*****************************************************************
10
This function is used to compare two data fields for which we know the
16
/* out: 1, 0, -1, if data1 is greater, equal,
17
less than data2, respectively */
18
ulint mtype, /* in: main type */
19
ulint prtype, /* in: precise type */
20
byte* data1, /* in: data field (== a pointer to a memory
22
ulint len1, /* in: data field length or UNIV_SQL_NULL */
23
byte* data2, /* in: data field (== a pointer to a memory
25
ulint len2) /* in: data field length or UNIV_SQL_NULL */
27
return(cmp_data_data_slow(mtype, prtype, data1, len1, data2, len2));
30
/*****************************************************************
31
This function is used to compare two dfields where at least the first
32
has its data type field set. */
37
/* out: 1, 0, -1, if dfield1 is greater, equal,
38
less than dfield2, respectively */
39
dfield_t* dfield1,/* in: data field; must have type field set */
40
dfield_t* dfield2)/* in: data field */
44
ut_ad(dfield_check_typed(dfield1));
46
type = dfield_get_type(dfield1);
48
return(cmp_data_data(type->mtype, type->prtype,
49
dfield_get_data(dfield1),
50
dfield_get_len(dfield1),
51
dfield_get_data(dfield2),
52
dfield_get_len(dfield2)));
55
/*****************************************************************
56
This function is used to compare two physical records. Only the common
57
first fields are compared. */
62
/* out: 1, 0 , -1 if rec1 is greater, equal,
63
less, respectively, than rec2; only the common
64
first fields are compared */
65
rec_t* rec1, /* in: physical record */
66
rec_t* rec2, /* in: physical record */
67
const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */
68
const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */
69
dict_index_t* index) /* in: data dictionary index */
74
return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index,