summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authoristruewing@chilla.local <>2007-05-10 17:30:50 +0200
committeristruewing@chilla.local <>2007-05-10 17:30:50 +0200
commite2fa2becfc2733324ac88c3105b6aaae433fc9cb (patch)
treeead056dae5707ac88057e9cfc5c3eef52c74058d /storage
parent10ecf5855bc5754a296796ab14bb20a80cc19067 (diff)
parent942cd7d42448e9ad0128fb99ac1267638511899d (diff)
downloadmariadb-git-e2fa2becfc2733324ac88c3105b6aaae433fc9cb.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into chilla.local:/home/mydev/mysql-5.1-bug17332
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/ha_myisam.cc2
-rw-r--r--storage/myisam/mi_preload.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 298e3e6c433..ee9ecd96dc9 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1263,6 +1263,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
my_bool ignore_leaves= table_list->ignore_leaves;
+ char buf[ERRMSGSIZE+20];
DBUG_ENTER("ha_myisam::preload_keys");
@@ -1294,7 +1295,6 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
errmsg= "Failed to allocate buffer";
break;
default:
- char buf[ERRMSGSIZE+20];
my_snprintf(buf, ERRMSGSIZE,
"Failed to read from index file (errno: %d)", my_errno);
errmsg= buf;
diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c
index 78729f18424..06c66c06bf4 100644
--- a/storage/myisam/mi_preload.c
+++ b/storage/myisam/mi_preload.c
@@ -55,12 +55,17 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
block_length= keyinfo[0].block_length;
- /* Check whether all indexes use the same block size */
- for (i= 1 ; i < keys ; i++)
+ if (ignore_leaves)
{
- if (keyinfo[i].block_length != block_length)
- DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
+ /* Check whether all indexes use the same block size */
+ for (i= 1 ; i < keys ; i++)
+ {
+ if (keyinfo[i].block_length != block_length)
+ DBUG_RETURN(my_errno= HA_ERR_NON_UNIQUE_BLOCK_SIZE);
+ }
}
+ else
+ block_length= share->key_cache->key_cache_block_size;
length= info->preload_buff_size/block_length * block_length;
set_if_bigger(length, block_length);