4795 magnus.blaudd@stripped 2012-12-17 [merge]
Merge
modified:
sql/ha_ndb_index_stat.cc
sql/ha_ndbcluster.cc
sql/ha_ndbcluster_cond.cc
sql/ha_ndbcluster_push.cc
sql/opt_range.cc
4794 Bill Qu 2012-12-17 [merge]
Null merge from mysql-5.5
=== modified file 'sql/ha_ndb_index_stat.cc'
--- a/sql/ha_ndb_index_stat.cc 2011-09-02 09:01:29 +0000
+++ b/sql/ha_ndb_index_stat.cc 2012-12-17 15:17:27 +0000
@@ -2133,7 +2133,7 @@ ha_ndbcluster::ndb_index_stat_set_rpk(ui
if (err == 0)
{
uint k;
- for (k= 0; k < key_info->key_parts; k++)
+ for (k= 0; k < key_info->user_defined_key_parts; k++)
{
double rpk= -1.0;
NdbIndexStat::get_rpk(stat, k, &rpk);
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2012-10-31 06:26:56 +0000
+++ b/sql/ha_ndbcluster.cc 2012-12-17 15:17:27 +0000
@@ -1434,7 +1434,7 @@ void ha_ndbcluster::set_rec_per_key()
// set rows per key to 1 for complete key given for unique/primary index
if (is_unique_index)
{
- key_info->rec_per_key[key_info->key_parts-1]= 1;
+ key_info->rec_per_key[key_info->user_defined_key_parts-1]= 1;
}
}
DBUG_VOID_RETURN;
@@ -2389,8 +2389,8 @@ static int fix_unique_index_attr_order(N
}
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
- DBUG_ASSERT(key_info->key_parts == sz);
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
+ DBUG_ASSERT(key_info->user_defined_key_parts == sz);
for (unsigned i= 0; key_part != end; key_part++, i++)
{
const char *field_name= key_part->field->field_name;
@@ -2670,7 +2670,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
NdbRecord *rec;
Uint32 offset= 0;
- for (uint i= 0; i < key_info->key_parts; i++)
+ for (uint i= 0; i < key_info->user_defined_key_parts; i++)
{
KEY_PART_INFO *kp= &key_info->key_part[i];
@@ -2702,7 +2702,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
length used by Ndb kernel.
*/
rec= dict->createRecord(m_index[index_no].index, m_table,
- spec, key_info->key_parts, sizeof(spec[0]),
+ spec, key_info->user_defined_key_parts, sizeof(spec[0]),
( NdbDictionary::RecMysqldShrinkVarchar |
NdbDictionary::RecMysqldBitfield ));
if (! rec)
@@ -2715,7 +2715,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
if (m_index[index_no].unique_index)
{
rec= dict->createRecord(m_index[index_no].unique_index, m_table,
- spec, key_info->key_parts, sizeof(spec[0]),
+ spec, key_info->user_defined_key_parts, sizeof(spec[0]),
( NdbDictionary::RecMysqldShrinkVarchar |
NdbDictionary::RecMysqldBitfield ));
if (! rec)
@@ -2726,7 +2726,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
{
/* The primary key is special, there is no explicit NDB index associated. */
rec= dict->createRecord(m_table,
- spec, key_info->key_parts, sizeof(spec[0]),
+ spec, key_info->user_defined_key_parts, sizeof(spec[0]),
( NdbDictionary::RecMysqldShrinkVarchar |
NdbDictionary::RecMysqldBitfield ));
if (! rec)
@@ -2737,7 +2737,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
m_index[index_no].ndb_unique_record_key= NULL;
/* Now do the same, but this time with offsets from Field, for row access. */
- for (uint i= 0; i < key_info->key_parts; i++)
+ for (uint i= 0; i < key_info->user_defined_key_parts; i++)
{
const KEY_PART_INFO *kp= &key_info->key_part[i];
@@ -2759,7 +2759,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
if (m_index[index_no].unique_index)
{
rec= dict->createRecord(m_index[index_no].unique_index, m_table,
- spec, key_info->key_parts, sizeof(spec[0]),
+ spec, key_info->user_defined_key_parts, sizeof(spec[0]),
NdbDictionary::RecMysqldBitfield);
if (! rec)
ERR_RETURN(dict->getNdbError());
@@ -2768,7 +2768,7 @@ ha_ndbcluster::add_index_ndb_record(NDBD
else if (index_no == table_share->primary_key)
{
rec= dict->createRecord(m_table,
- spec, key_info->key_parts, sizeof(spec[0]),
+ spec, key_info->user_defined_key_parts, sizeof(spec[0]),
NdbDictionary::RecMysqldBitfield);
if (! rec)
ERR_RETURN(dict->getNdbError());
@@ -2953,7 +2953,7 @@ NDB_INDEX_TYPE ha_ndbcluster::get_index_
bool ha_ndbcluster::check_index_fields_not_null(KEY* key_info)
{
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
DBUG_ENTER("ha_ndbcluster::check_index_fields_not_null");
for (; key_part != end; key_part++)
@@ -3129,7 +3129,7 @@ bool ha_ndbcluster::check_index_fields_i
{
KEY* key_info= table->key_info + keyno;
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
uint i;
DBUG_ENTER("check_index_fields_in_write_set");
@@ -3423,7 +3423,7 @@ check_null_in_record(const KEY* key_info
{
KEY_PART_INFO *curr_part, *end_part;
curr_part= key_info->key_part;
- end_part= curr_part + key_info->key_parts;
+ end_part= curr_part + key_info->user_defined_key_parts;
while (curr_part != end_part)
{
@@ -4025,13 +4025,13 @@ ha_ndbcluster::pk_unique_index_read_key_
uint i;
Uint32 offset= 0;
NdbQueryParamValue paramValues[ndb_pushed_join::MAX_KEY_PART];
- DBUG_ASSERT(key_def->key_parts <= ndb_pushed_join::MAX_KEY_PART);
+ DBUG_ASSERT(key_def->user_defined_key_parts <= ndb_pushed_join::MAX_KEY_PART);
uint map[ndb_pushed_join::MAX_KEY_PART];
ndbcluster_build_key_map(m_table, m_index[idx], &table->key_info[idx], map);
// Bind key values defining root of pushed join
- for (i = 0, key_part= key_def->key_part; i < key_def->key_parts; i++, key_part++)
+ for (i = 0, key_part= key_def->key_part; i < key_def->user_defined_key_parts; i++, key_part++)
{
bool shrinkVarChar= is_shrinked_varchar(key_part->field);
@@ -4049,7 +4049,7 @@ ha_ndbcluster::pk_unique_index_read_key_
offset+= key_part->store_length;
}
- const int ret= create_pushed_join(paramValues, key_def->key_parts);
+ const int ret= create_pushed_join(paramValues, key_def->user_defined_key_parts);
DBUG_RETURN(ret);
}
@@ -4060,7 +4060,7 @@ static uint
count_key_columns(const KEY *key_info, const key_range *key)
{
KEY_PART_INFO *first_key_part= key_info->key_part;
- KEY_PART_INFO *key_part_end= first_key_part + key_info->key_parts;
+ KEY_PART_INFO *key_part_end= first_key_part + key_info->user_defined_key_parts;
KEY_PART_INFO *key_part;
uint length= 0;
for(key_part= first_key_part; key_part < key_part_end; key_part++)
@@ -4085,7 +4085,7 @@ compute_index_bounds(NdbIndexScanOperati
#ifndef DBUG_OFF
DBUG_PRINT("info", ("key parts: %u length: %u",
- key_info->key_parts, key_info->key_length));
+ key_info->user_defined_key_parts, key_info->key_length));
{
for (uint j= 0; j <= 1; j++)
{
@@ -5254,7 +5254,7 @@ int ha_ndbcluster::primary_key_cmp(const
{
uint keynr= table_share->primary_key;
KEY_PART_INFO *key_part=table->key_info[keynr].key_part;
- KEY_PART_INFO *end=key_part+table->key_info[keynr].key_parts;
+ KEY_PART_INFO *end=key_part+table->key_info[keynr].user_defined_key_parts;
for (; key_part != end ; key_part++)
{
@@ -6378,7 +6378,7 @@ check_null_in_key(const KEY* key_info, c
KEY_PART_INFO *curr_part, *end_part;
const uchar* end_ptr= key + key_len;
curr_part= key_info->key_part;
- end_part= curr_part + key_info->key_parts;
+ end_part= curr_part + key_info->user_defined_key_parts;
for (; curr_part != end_part && key < end_ptr; curr_part++)
{
@@ -6817,7 +6817,7 @@ void ha_ndbcluster::position(const uchar
key_length= ref_length;
key_info= table->key_info + table_share->primary_key;
key_part= key_info->key_part;
- end= key_part + key_info->key_parts;
+ end= key_part + key_info->user_defined_key_parts;
buff= ref;
for (; key_part != end; key_part++)
@@ -6899,7 +6899,7 @@ ha_ndbcluster::cmp_ref(const uchar * ref
{
KEY *key_info= table->key_info + table_share->primary_key;
KEY_PART_INFO *key_part= key_info->key_part;
- KEY_PART_INFO *end= key_part + key_info->key_parts;
+ KEY_PART_INFO *end= key_part + key_info->user_defined_key_parts;
for (; key_part != end; key_part++)
{
@@ -9423,7 +9423,7 @@ int ha_ndbcluster::create(const char *na
for (i= 0, key_info= form->key_info; i < form->s->keys; i++, key_info++)
{
KEY_PART_INFO *key_part= key_info->key_part;
- KEY_PART_INFO *end= key_part + key_info->key_parts;
+ KEY_PART_INFO *end= key_part + key_info->user_defined_key_parts;
for (; key_part != end; key_part++)
{
#ifndef NDB_WITHOUT_COLUMN_FORMAT
@@ -9850,7 +9850,7 @@ int ha_ndbcluster::create_ndb_index(THD
Ndb *ndb= get_ndb(thd);
NdbDictionary::Dictionary *dict= ndb->getDictionary();
KEY_PART_INFO *key_part= key_info->key_part;
- KEY_PART_INFO *end= key_part + key_info->key_parts;
+ KEY_PART_INFO *end= key_part + key_info->user_defined_key_parts;
DBUG_ENTER("ha_ndbcluster::create_index");
DBUG_PRINT("enter", ("name: %s ", name));
@@ -9920,7 +9920,7 @@ int ha_ndbcluster::add_index_impl(THD *t
{
KEY *key= key_info + idx;
KEY_PART_INFO *key_part= key->key_part;
- KEY_PART_INFO *end= key_part + key->key_parts;
+ KEY_PART_INFO *end= key_part + key->user_defined_key_parts;
NDB_INDEX_TYPE idx_type= get_index_type_from_key(idx, key_info, false);
DBUG_PRINT("info", ("Adding index: '%s'", key_info[idx].name));
// Add fields to key_part struct
@@ -10631,7 +10631,7 @@ int ha_ndbcluster::open(const char *name
{
key= table->key_info + i;
key_part_info= key->key_part;
- key_parts= key->key_parts;
+ key_parts= key->user_defined_key_parts;
for (j= 0; j < key_parts; j++, key_part_info++)
bitmap_set_bit(m_key_fields[i], key_part_info->fieldnr-1);
}
@@ -12253,7 +12253,7 @@ ha_ndbcluster::records_in_range(uint inx
uint eq_bound_offs= 0;
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
for (; key_part != end; key_part++)
{
uint part_length= key_part->store_length;
@@ -15553,7 +15553,7 @@ int ha_ndbcluster::check_if_supported_al
{
KEY* key_info= table->key_info + j;
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
for (; key_part != end; key_part++)
{
if (key_part->field->field_index == i)
@@ -15571,7 +15571,7 @@ int ha_ndbcluster::check_if_supported_al
{
KEY* key_info= altered_table->key_info + j;
KEY_PART_INFO* key_part= key_info->key_part;
- KEY_PART_INFO* end= key_part+key_info->key_parts;
+ KEY_PART_INFO* end= key_part+key_info->user_defined_key_parts;
for (; key_part != end; key_part++)
{
if (key_part->field->field_index == i)
@@ -15724,7 +15724,7 @@ int ha_ndbcluster::alter_table_phase1(TH
/* Copy the KEY struct. */
*key= alter_info->key_info_buffer[*idx_p];
/* Fix the key parts. */
- part_end= key->key_part + key->key_parts;
+ part_end= key->key_part + key->user_defined_key_parts;
for (key_part= key->key_part; key_part < part_end; key_part++)
key_part->field= table->field[key_part->fieldnr];
}
=== modified file 'sql/ha_ndbcluster_cond.cc'
--- a/sql/ha_ndbcluster_cond.cc 2012-06-01 17:27:57 +0000
+++ b/sql/ha_ndbcluster_cond.cc 2012-12-17 15:17:27 +0000
@@ -1620,7 +1620,7 @@ int ha_ndbcluster_cond::generate_scan_fi
#ifndef DBUG_OFF
{
DBUG_PRINT("info", ("key parts:%u length:%u",
- key_info->key_parts, key_info->key_length));
+ key_info->user_defined_key_parts, key_info->key_length));
const key_range* keylist[2]={ start_key, end_key };
for (uint j=0; j <= 1; j++)
{
@@ -1635,7 +1635,7 @@ int ha_ndbcluster_cond::generate_scan_fi
sprintf(buf, "key range %u: flag:%u part", j, key->flag);
const KEY_PART_INFO* key_part=key_info->key_part;
const uchar* ptr=key->key;
- for (uint i=0; i < key_info->key_parts; i++)
+ for (uint i=0; i < key_info->user_defined_key_parts; i++)
{
sprintf(buf+strlen(buf), " %u:", i);
for (uint k=0; k < key_part->store_length; k++)
@@ -1674,7 +1674,7 @@ int ha_ndbcluster_cond::generate_scan_fi
if (start_key != 0 &&
start_key->flag == HA_READ_AFTER_KEY &&
end_key == 0 &&
- key_info->key_parts == 1)
+ key_info->user_defined_key_parts == 1)
{
const KEY_PART_INFO* key_part=key_info->key_part;
if (key_part->null_bit != 0) // nullable (must be)
@@ -1708,7 +1708,7 @@ int ha_ndbcluster_cond::generate_scan_fi
{
const KEY_PART_INFO* key_part=key_info->key_part;
const uchar* ptr=start_key->key;
- for (uint i=0; i < key_info->key_parts; i++)
+ for (uint i=0; i < key_info->user_defined_key_parts; i++)
{
const Field* field=key_part->field;
if (key_part->null_bit) // nullable
=== modified file 'sql/ha_ndbcluster_push.cc'
--- a/sql/ha_ndbcluster_push.cc 2011-09-30 10:24:10 +0000
+++ b/sql/ha_ndbcluster_push.cc 2012-12-17 15:17:27 +0000
@@ -1205,7 +1205,7 @@ ndb_pushed_builder_ctx::build_key(const
{
if (ndbcluster_is_lookup_operation(table->get_access_type()))
{
- for (uint i= 0; i < key->key_parts; i++)
+ for (uint i= 0; i < key->user_defined_key_parts; i++)
{
op_key[i]= m_builder->paramValue();
if (unlikely(op_key[i] == NULL))
@@ -1213,13 +1213,13 @@ ndb_pushed_builder_ctx::build_key(const
DBUG_RETURN(-1);
}
}
- op_key[key->key_parts]= NULL;
+ op_key[key->user_defined_key_parts]= NULL;
}
}
else
{
const uint key_fields= table->get_no_of_key_fields();
- DBUG_ASSERT(key_fields > 0 && key_fields <= key->key_parts);
+ DBUG_ASSERT(key_fields > 0 && key_fields <= key->user_defined_key_parts);
uint map[ndb_pushed_join::MAX_LINKED_KEYS+1];
if (ndbcluster_is_lookup_operation(table->get_access_type()))
@@ -1447,7 +1447,7 @@ ndbcluster_build_key_map(const NDBTAB* t
if (index.unique_index_attrid_map) // UNIQUE_ORDERED_INDEX or UNIQUE_INDEX
{
- for (ix = 0; ix < key_def->key_parts; ix++)
+ for (ix = 0; ix < key_def->user_defined_key_parts; ix++)
{
ix_map[ix]= index.unique_index_attrid_map[ix];
}
@@ -1459,7 +1459,7 @@ ndbcluster_build_key_map(const NDBTAB* t
int columnnr= 0;
assert (index.type == PRIMARY_KEY_ORDERED_INDEX || index.type == PRIMARY_KEY_INDEX);
- for (ix = 0, key_part= key_def->key_part; ix < key_def->key_parts; ix++, key_part++)
+ for (ix = 0, key_part= key_def->key_part; ix < key_def->user_defined_key_parts; ix++, key_part++)
{
// As NdbColumnImpl::m_keyInfoPos isn't available through
// NDB API we have to calculate it ourself, else we could:
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2012-11-30 15:07:51 +0000
+++ b/sql/opt_range.cc 2012-12-17 15:17:27 +0000
@@ -9699,7 +9699,7 @@ key_has_nulls(const KEY* key_info, const
KEY_PART_INFO *curr_part, *end_part;
const uchar* end_ptr= key + key_len;
curr_part= key_info->key_part;
- end_part= curr_part + key_info->key_parts;
+ end_part= curr_part + key_info->user_defined_key_parts;
for (; curr_part != end_part && key < end_ptr; curr_part++)
{
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.6 branch (magnus.blaudd:4794 to 4795) | magnus.blaudd | 18 Dec |