1
/*****************************************************************************
3
Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/*******************************************************************//**
20
@file include/rem0cmp.ic
1
/***********************************************************************
21
2
Comparison services for records
4
(c) 1994-1996 Innobase Oy
23
6
Created 7/1/1994 Heikki Tuuri
24
7
************************************************************************/
26
/*************************************************************//**
9
/*****************************************************************
27
10
This function is used to compare two data fields for which we know the
29
@return 1, 0, -1, if data1 is greater, equal, less than data2, respectively */
34
ulint mtype, /*!< in: main type */
35
ulint prtype, /*!< in: precise type */
36
const byte* data1, /*!< in: data field (== a pointer to a memory
38
ulint len1, /*!< in: data field length or UNIV_SQL_NULL */
39
const byte* data2, /*!< in: data field (== a pointer to a memory
41
ulint len2) /*!< in: data field length or UNIV_SQL_NULL */
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
const byte* data1, /* in: data field (== a pointer to a memory
22
ulint len1, /* in: data field length or UNIV_SQL_NULL */
23
const byte* data2, /* in: data field (== a pointer to a memory
25
ulint len2) /* in: data field length or UNIV_SQL_NULL */
43
27
return(cmp_data_data_slow(mtype, prtype, data1, len1, data2, len2));
46
/*************************************************************//**
30
/*****************************************************************
47
31
This function is used to compare two dfields where at least the first
48
has its data type field set.
49
@return 1, 0, -1, if dfield1 is greater, equal, less than dfield2,
32
has its data type field set. */
55
const dfield_t* dfield1,/*!< in: data field; must have type field set */
56
const dfield_t* dfield2)/*!< in: data field */
37
/* out: 1, 0, -1, if dfield1 is greater, equal,
38
less than dfield2, respectively */
39
const dfield_t* dfield1,/* in: data field; must have type field set */
40
const dfield_t* dfield2)/* in: data field */
58
42
const dtype_t* type;
68
52
dfield_get_len(dfield2)));
71
/*************************************************************//**
55
/*****************************************************************
72
56
This function is used to compare two physical records. Only the common
73
first fields are compared.
74
@return 1, 0 , -1 if rec1 is greater, equal, less, respectively, than
75
rec2; only the common first fields are compared */
57
first fields are compared. */
80
const rec_t* rec1, /*!< in: physical record */
81
const rec_t* rec2, /*!< in: physical record */
82
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, index) */
83
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, index) */
84
dict_index_t* index) /*!< in: data dictionary index */
62
/* out: 1, 0 , -1 if rec1 is greater, equal,
63
less, respectively, than rec2; only the common
64
first fields are compared */
65
const rec_t* rec1, /* in: physical record */
66
const 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 */