diff options
author | unknown <heikki@donna.mysql.fi> | 2001-08-17 21:19:10 +0300 |
---|---|---|
committer | unknown <heikki@donna.mysql.fi> | 2001-08-17 21:19:10 +0300 |
commit | 57b1a50c811964b9cf772e070b5e813347ab74b1 (patch) | |
tree | d8f33216c04fbd878968215cf8ff17615ece8ccd /sql/ha_innobase.cc | |
parent | 0855ce419c44598348474c93d4b36bdc0050a023 (diff) | |
download | mariadb-git-57b1a50c811964b9cf772e070b5e813347ab74b1.tar.gz |
ha_innobase.cc Impove ref length estimate in a handle to eliminate a warning in filesort
sql/ha_innobase.cc:
Impove ref length estimate in a handle to eliminate a warning in filesort
Diffstat (limited to 'sql/ha_innobase.cc')
-rw-r--r-- | sql/ha_innobase.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index d0cb8af906a..babe281bd4e 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -821,10 +821,6 @@ ha_innobase::open( DBUG_RETURN(1); } - /* MySQL allocates the buffer for ref */ - - ref_length = buff_len; - /* Get pointer to a table object in InnoDB dictionary cache */ if (NULL == (ib_table = dict_table_get(norm_name, NULL))) { @@ -861,10 +857,20 @@ ha_innobase::open( primary_key = 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 { ((row_prebuilt_t*)innobase_prebuilt) ->clust_index_was_generated = TRUE; + ref_length = DATA_ROW_ID_LEN + 10; + dbug_assert(key_used_on_scan == MAX_KEY); } |