#include "univ.i"
#include "data0data.h"
#include "data0type.h"
#include "dict0dict.h"
#include "rem0rec.h"
Go to the source code of this file.
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_INLINE int | cmp_dfield_dfield (const dfield_t *dfield1, const dfield_t *dfield2) |
UNIV_INTERN int | cmp_dtuple_rec_with_match (const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets, 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, ibool *null_eq) |
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 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.
Returns TRUE if two columns are equal for comparison purposes.
col1 | in: column 1 |
col2 | in: column 2 |
check_charsets | in: whether to check charsets |
Definition at line 112 of file rem0cmp.cc.
References dtype_get_charset_coll(), dtype_is_binary_string_type(), dtype_is_non_binary_string_type(), dict_col_struct::len, dict_col_struct::mtype, and dict_col_struct::prtype.
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.
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) |
Referenced by dict_load_foreigns().
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.
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 |
Definition at line 292 of file rem0cmp.cc.
References dtype_get_charset_coll(), and dtype_get_pad_char().
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 |
Referenced by dtuple_coll_cmp(), and eval_cmp().
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.
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 |
offsets | in: array returned by rec_get_offsets() |
Definition at line 662 of file rem0cmp.cc.
References cmp_dtuple_rec_with_match(), dfield_get_len(), dtuple_get_n_fields(), rec_offs_n_fields(), rec_offs_validate(), and ut_ad.
Referenced by row_search_for_mysql().
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.
Compares a data tuple to a physical record.
dtuple | in: data tuple |
rec | in: physical record |
offsets | in: array returned by rec_get_offsets() |
Definition at line 642 of file rem0cmp.cc.
References cmp_dtuple_rec_with_match(), rec_offs_validate(), and ut_ad.
Referenced by btr_page_split_and_insert(), btr_pcur_restore_position_func(), row_ins_check_foreign_constraint(), row_search_for_mysql(), and row_vers_impl_x_locked_off_kernel().
UNIV_INTERN int cmp_dtuple_rec_with_match | ( | const dtuple_t * | dtuple, |
const rec_t * | rec, | ||
const ulint * | offsets, | ||
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 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.
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 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() |
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 |
Definition at line 411 of file rem0cmp.cc.
References dfield_get_len(), dtuple_check_typed(), dtuple_get_info_bits(), dtuple_get_n_fields_cmp(), dtype_get_charset_coll(), dtype_get_pad_char(), dtype_struct::mtype, dtype_struct::prtype, rec_get_info_bits(), rec_offs_comp(), rec_offs_n_fields(), rec_offs_nth_extern(), rec_offs_validate(), and ut_ad.
Referenced by cmp_dtuple_is_prefix_of_rec(), cmp_dtuple_rec(), page_cur_search_with_match(), and row_check_index_for_mysql().
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.
rec1 | in: physical record |
rec2 | in: physical record |
offsets1 | in: rec_get_offsets(rec1, index) |
offsets2 | in: rec_get_offsets(rec2, index) |
Referenced by btr_pcur_restore_position_func(), and page_validate().
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, | ||
ibool * | null_eq | ||
) |
Compare two physical records that contain the same number of columns, none of which are stored externally.
Compare two physical records that contain the same number of columns, none of which are stored externally.
< length of current field in rec1
< pointer to the current byte
in rec1 field
< value of current byte to be
compared in rec1
< length of current field in rec2
< pointer to the current byte
in rec2 field
< value of current byte to be
compared in rec2
< current field number
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 |
null_eq | out: set to TRUE if found matching null values |
Definition at line 702 of file rem0cmp.cc.
References dict_index_get_n_unique(), dict_index_get_nth_col(), dtype_get_charset_coll(), dtype_get_pad_char(), dict_col_struct::mtype, dict_col_struct::prtype, rec_offs_comp(), rec_offs_n_fields(), rec_offs_nth_extern(), and ut_ad.
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.
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 |
matched_bytes | in/out: number of already matched bytes within the first field not completely matched; when the function returns, contains the value for the current comparison |
Definition at line 857 of file rem0cmp.cc.
References dict_index_get_nth_col(), DICT_UNIVERSAL, dtype_get_charset_coll(), dtype_get_pad_char(), dict_col_struct::mtype, dict_col_struct::prtype, rec_get_info_bits(), rec_offs_comp(), rec_offs_n_fields(), rec_offs_nth_extern(), rec_offs_validate(), dict_index_struct::type, and ut_ad.
Referenced by btr_estimate_number_of_different_key_vals().