~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/rem0cmp.ic

  • Committer: Brian Aker
  • Date: 2009-01-07 09:27:07 UTC
  • Revision ID: brian@tangent.org-20090107092707-bn67qpdllfcyh3j9
Removing dead field translator code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
4
 
 
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.
8
 
 
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.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/*******************************************************************//**
20
 
@file include/rem0cmp.ic
 
1
/***********************************************************************
21
2
Comparison services for records
22
3
 
 
4
(c) 1994-1996 Innobase Oy
 
5
 
23
6
Created 7/1/1994 Heikki Tuuri
24
7
************************************************************************/
25
8
 
26
 
/*************************************************************//**
 
9
/*****************************************************************
27
10
This function is used to compare two data fields for which we know the
28
 
data type.
29
 
@return 1, 0, -1, if data1 is greater, equal, less than data2, respectively */
 
11
data type. */
30
12
UNIV_INLINE
31
13
int
32
14
cmp_data_data(
33
15
/*==========*/
34
 
        ulint           mtype,  /*!< in: main type */
35
 
        ulint           prtype, /*!< in: precise type */
36
 
        const byte*     data1,  /*!< in: data field (== a pointer to a memory
37
 
                                buffer) */
38
 
        ulint           len1,   /*!< in: data field length or UNIV_SQL_NULL */
39
 
        const byte*     data2,  /*!< in: data field (== a pointer to a memory
40
 
                                buffer) */
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
 
21
                                buffer) */
 
22
        ulint           len1,   /* in: data field length or UNIV_SQL_NULL */
 
23
        const byte*     data2,  /* in: data field (== a pointer to a memory
 
24
                                buffer) */
 
25
        ulint           len2)   /* in: data field length or UNIV_SQL_NULL */
42
26
{
43
27
        return(cmp_data_data_slow(mtype, prtype, data1, len1, data2, len2));
44
28
}
45
29
 
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,
50
 
respectively */
 
32
has its data type field set. */
51
33
UNIV_INLINE
52
34
int
53
35
cmp_dfield_dfield(
54
36
/*==============*/
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 */
57
41
{
58
42
        const dtype_t*  type;
59
43
 
68
52
                             dfield_get_len(dfield2)));
69
53
}
70
54
 
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. */
76
58
UNIV_INLINE
77
59
int
78
60
cmp_rec_rec(
79
61
/*========*/
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 */
85
70
{
86
71
        ulint   match_f         = 0;
87
72
        ulint   match_b         = 0;