Commit ac2a265b authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi

ha_innobase.cc Impove ref length estimate in a handle to eliminate a warning in filesort

parent fdb26b53
...@@ -821,10 +821,6 @@ ha_innobase::open( ...@@ -821,10 +821,6 @@ ha_innobase::open(
DBUG_RETURN(1); DBUG_RETURN(1);
} }
/* MySQL allocates the buffer for ref */
ref_length = buff_len;
/* Get pointer to a table object in InnoDB dictionary cache */ /* Get pointer to a table object in InnoDB dictionary cache */
if (NULL == (ib_table = dict_table_get(norm_name, NULL))) { if (NULL == (ib_table = dict_table_get(norm_name, NULL))) {
...@@ -861,10 +857,20 @@ ha_innobase::open( ...@@ -861,10 +857,20 @@ ha_innobase::open(
primary_key = 0; primary_key = 0;
key_used_on_scan = 0; key_used_on_scan = 0;
/* MySQL allocates the buffer for ref */
ref_length = table->key_info->key_length
+ table->key_info->key_parts + 10;
/* One byte per key field is consumed to the SQL NULL
info of the field; we add also 10 bytes of safety margin */
} else { } else {
((row_prebuilt_t*)innobase_prebuilt) ((row_prebuilt_t*)innobase_prebuilt)
->clust_index_was_generated = TRUE; ->clust_index_was_generated = TRUE;
ref_length = DATA_ROW_ID_LEN + 10;
dbug_assert(key_used_on_scan == MAX_KEY); dbug_assert(key_used_on_scan == MAX_KEY);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment