InnoDB Plugin
1.0
|
#include "univ.i"
#include "data0data.h"
#include "data0type.h"
#include "dict0dict.h"
#include "rem0rec.h"
#include "rem0cmp.ic"
Go to the source code of this file.
Macros | |
#define | cmp_dtuple_rec_with_match(tuple, rec, offsets, fields, bytes) |
Functions | |
UNIV_INTERN ibool | cmp_cols_are_equal (const dict_col_t *col1, const dict_col_t *col2, ibool check_charsets) |
UNIV_INLINE int | cmp_data_data (ulint mtype, ulint prtype, const byte *data1, ulint len1, const byte *data2, ulint len2) |
UNIV_INTERN int | cmp_data_data_slow (ulint mtype, ulint prtype, const byte *data1, ulint len1, const byte *data2, ulint len2) |
UNIV_INTERN int | cmp_data_data_slow_varchar (const byte *lhs, ulint lhs_len, const byte *rhs, ulint rhs_len) |
UNIV_INTERN int | cmp_data_data_slow_like_prefix (const byte *data1, ulint len1, const byte *data2, ulint len2) |
UNIV_INTERN int | cmp_data_data_slow_like_suffix (const byte *data1, ulint len1, const byte *data2, ulint len2) |
UNIV_INTERN int | cmp_data_data_slow_like_substr (const byte *data1, ulint len1, const byte *data2, ulint len2) |
UNIV_INLINE int | cmp_dfield_dfield (const dfield_t *dfield1, const dfield_t *dfield2) |
UNIV_INTERN int | cmp_dtuple_rec_with_match_low (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets, ulint n_cmp, ulint *matched_fields, ulint *matched_bytes)) |
UNIV_INTERN int | cmp_dtuple_rec (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets) |
UNIV_INTERN ibool | cmp_dtuple_is_prefix_of_rec (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets) |
UNIV_INTERN int | cmp_rec_rec_simple (const rec_t *rec1, const rec_t *rec2, const ulint *offsets1, const ulint *offsets2, const dict_index_t *index, struct TABLE *table) |
UNIV_INTERN int | cmp_rec_rec_with_match (const rec_t *rec1, const rec_t *rec2, const ulint *offsets1, const ulint *offsets2, dict_index_t *index, ibool nulls_unequal, ulint *matched_fields, ulint *matched_bytes) |
UNIV_INLINE int | cmp_rec_rec (const rec_t *rec1, const rec_t *rec2, const ulint *offsets1, const ulint *offsets2, dict_index_t *index) |
UNIV_INTERN int | cmp_dfield_dfield_like_prefix (dfield_t *dfield1, dfield_t *dfield2) |
UNIV_INLINE int | cmp_dfield_dfield_like_substr (dfield_t *dfield1, dfield_t *dfield2) |
UNIV_INLINE int | cmp_dfield_dfield_like_suffix (dfield_t *dfield1, dfield_t *dfield2) |
Variables | |
UNIV_INTERN int | warn_unused_result |
Comparison services for records
Created 7/1/1994 Heikki Tuuri
#define cmp_dtuple_rec_with_match | ( | tuple, | |
rec, | |||
offsets, | |||
fields, | |||
bytes | |||
) |
UNIV_INTERN ibool cmp_cols_are_equal | ( | const dict_col_t * | col1, |
const dict_col_t * | col2, | ||
ibool | check_charsets | ||
) |
Returns TRUE if two columns are equal for comparison purposes.
col1 | in: column 1 |
col2 | in: column 2 |
UNIV_INLINE int cmp_data_data | ( | ulint | mtype, |
ulint | prtype, | ||
const byte * | data1, | ||
ulint | len1, | ||
const byte * | data2, | ||
ulint | len2 | ||
) |
This function is used to compare two data fields for which we know the data type.
This function is used to compare two data fields for which we know the data type.
mtype | in: main type |
prtype | in: precise type |
data1 | in: data field (== a pointer to a memory buffer) |
len1 | in: data field length or UNIV_SQL_NULL |
data2 | in: data field (== a pointer to a memory buffer) |
len2 | in: data field length or UNIV_SQL_NULL |
UNIV_INTERN int cmp_data_data_slow | ( | ulint | mtype, |
ulint | prtype, | ||
const byte * | data1, | ||
ulint | len1, | ||
const byte * | data2, | ||
ulint | len2 | ||
) |
This function is used to compare two data fields for which we know the data type.
mtype | in: main type |
prtype | in: precise type |
data1 | in: data field (== a pointer to a memory buffer) |
len1 | in: data field length or UNIV_SQL_NULL |
data2 | in: data field (== a pointer to a memory buffer) |
This function is used to compare two dfields where at least the first has its data type field set.
This function is used to compare two dfields where at least the first has its data type field set.
dfield1 | in: data field; must have type field set |
dfield2 | in: data field |
UNIV_INTERN ibool cmp_dtuple_is_prefix_of_rec | ( | const dtuple_t * | dtuple, |
const rec_t * | rec, | ||
const ulint * | offsets | ||
) |
Checks if a dtuple is a prefix of a record. The last field in dtuple is allowed to be a prefix of the corresponding field in the record.
dtuple | in: data tuple |
rec | in: physical record |
UNIV_INTERN int cmp_dtuple_rec | ( | const dtuple_t * | dtuple, |
const rec_t * | rec, | ||
const ulint * | offsets | ||
) |
Compares a data tuple to a physical record.
dtuple | in: data tuple |
rec | in: physical record |
UNIV_INTERN int cmp_dtuple_rec_with_match_low | ( | const dtuple_t * | dtuple, |
const rec_t * | rec, | ||
const ulint * | offsets, | ||
ulint | n_cmp, | ||
ulint * | matched_fields, | ||
ulint * | matched_bytes | ||
) |
This function is used to compare a data tuple to a physical record. Only dtuple->n_fields_cmp first fields are taken into account for the data tuple! If we denote by n = n_fields_cmp, then rec must have either m >= n fields, or it must differ from dtuple in some of the m fields rec has. If rec has an externally stored field we do not compare it but return with value 0 if such a comparison should be made.
dtuple | in: data tuple |
rec | in: physical record which differs from dtuple in some of the common fields, or which has an equal number or more fields than dtuple |
offsets | in: array returned by rec_get_offsets() |
n_cmp | in: number of fields to compare |
matched_fields | in/out: number of already completely matched fields; when function returns, contains the value for current comparison |
matched_bytes | in/out: number of already matched bytes within the first field not completely matched; when function returns, contains the value for current comparison |
UNIV_INLINE int cmp_rec_rec | ( | const rec_t * | rec1, |
const rec_t * | rec2, | ||
const ulint * | offsets1, | ||
const ulint * | offsets2, | ||
dict_index_t * | index | ||
) |
This function is used to compare two physical records. Only the common first fields are compared.
This function is used to compare two physical records. Only the common first fields are compared.
rec1 | in: physical record |
rec2 | in: physical record |
offsets1 | in: rec_get_offsets(rec1, index) |
offsets2 | in: rec_get_offsets(rec2, index) |
index | in: data dictionary index |
UNIV_INTERN int cmp_rec_rec_simple | ( | const rec_t * | rec1, |
const rec_t * | rec2, | ||
const ulint * | offsets1, | ||
const ulint * | offsets2, | ||
const dict_index_t * | index, | ||
struct TABLE * | table | ||
) |
Compare two physical records that contain the same number of columns, none of which are stored externally.
1 | if rec1 (including non-ordering columns) is greater than rec2 |
-1 | if rec1 (including non-ordering columns) is less than rec2 |
0 | if rec1 is a duplicate of rec2 |
rec1 | in: physical record |
rec2 | in: physical record |
offsets1 | in: rec_get_offsets(rec1, ...) |
offsets2 | in: rec_get_offsets(rec2, ...) |
index | in: data dictionary index |
table | in: MySQL table, for reporting duplicate key value if applicable, or NULL |
UNIV_INTERN int cmp_rec_rec_with_match | ( | const rec_t * | rec1, |
const rec_t * | rec2, | ||
const ulint * | offsets1, | ||
const ulint * | offsets2, | ||
dict_index_t * | index, | ||
ibool | nulls_unequal, | ||
ulint * | matched_fields, | ||
ulint * | matched_bytes | ||
) |
This function is used to compare two physical records. Only the common first fields are compared, and if an externally stored field is encountered, then 0 is returned.
rec1 | in: physical record |
rec2 | in: physical record |
offsets1 | in: rec_get_offsets(rec1, index) |
offsets2 | in: rec_get_offsets(rec2, index) |
index | in: data dictionary index |
matched_fields | in/out: number of already completely matched fields; when the function returns, contains the value the for current comparison |