Merge mysql-5.1 to mysql-5.5.

This commit is contained in:
Marko Mäkelä 2011-09-12 10:25:17 +03:00
commit 54714b382c

View file

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1997, 2010, Innobase Oy. All Rights Reserved. Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
@ -105,14 +105,22 @@ row_sel_sec_rec_is_for_blob(
ulint clust_len, /*!< in: length of clust_field */ ulint clust_len, /*!< in: length of clust_field */
const byte* sec_field, /*!< in: column in secondary index */ const byte* sec_field, /*!< in: column in secondary index */
ulint sec_len, /*!< in: length of sec_field */ ulint sec_len, /*!< in: length of sec_field */
ulint prefix_len, /*!< in: index column prefix length
in bytes */
dict_table_t* table) /*!< in: table */ dict_table_t* table) /*!< in: table */
{ {
ulint len; ulint len;
byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN]; byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN];
ulint zip_size = dict_table_flags_to_zip_size(table->flags); ulint zip_size = dict_table_flags_to_zip_size(table->flags);
ulint max_prefix_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
/* This function should never be invoked on an Antelope format
table, because they should always contain enough prefix in the
clustered index record. */
ut_ad(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP);
ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE); ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE);
ut_ad(prefix_len >= sec_len);
ut_ad(prefix_len > 0);
ut_a(prefix_len <= sizeof buf);
if (UNIV_UNLIKELY if (UNIV_UNLIKELY
(!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE, (!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE,
@ -124,7 +132,7 @@ row_sel_sec_rec_is_for_blob(
return(FALSE); return(FALSE);
} }
len = btr_copy_externally_stored_field_prefix(buf, max_prefix_len, len = btr_copy_externally_stored_field_prefix(buf, prefix_len,
zip_size, zip_size,
clust_field, clust_len); clust_field, clust_len);
@ -138,7 +146,7 @@ row_sel_sec_rec_is_for_blob(
} }
len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen, len = dtype_get_at_most_n_mbchars(prtype, mbminmaxlen,
sec_len, len, (const char*) buf); prefix_len, len, (const char*) buf);
return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len)); return(!cmp_data_data(mtype, prtype, buf, len, sec_field, sec_len));
} }
@ -230,6 +238,7 @@ row_sel_sec_rec_is_for_clust_rec(
col->mbminmaxlen, col->mbminmaxlen,
clust_field, clust_len, clust_field, clust_len,
sec_field, sec_len, sec_field, sec_len,
ifield->prefix_len,
clust_index->table)) { clust_index->table)) {
goto inequal; goto inequal;
} }