summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-12-12 14:07:02 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-12-12 14:07:02 +0100
commitba8c33f5ecc6e9465f0ac86858a0827028d37324 (patch)
tree86868d0d8268b65cd2a903f192c0044e3f8221d1 /sql/sql_table.cc
parentb079cea72e5625bcd3b550c17337470f5f2211ae (diff)
downloadmariadb-git-ba8c33f5ecc6e9465f0ac86858a0827028d37324.tar.gz
Bug#12361113: CRASH WHEN "LOAD INDEX INTO CACHE" WITH TOO
SMALL KEY CACHE The server crashed on division by zero because the key cache was not initialized and the block length was 0 which was used in a division. The fix was to not allow CACHE INDEX if the key cache was not initiallized. Thus never try LOAD INDEX INTO CACHE for an uninitialized key cache. Also added some windows files/directories to .bzrignore.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4320cef2c49..2bb758f8b86 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2680,6 +2680,11 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
DBUG_RETURN(TRUE);
}
pthread_mutex_unlock(&LOCK_global_system_variables);
+ if (!key_cache->key_cache_inited)
+ {
+ my_error(ER_UNKNOWN_KEY_CACHE, MYF(0), key_cache_name->str);
+ DBUG_RETURN(TRUE);
+ }
check_opt.key_cache= key_cache;
DBUG_RETURN(mysql_admin_table(thd, tables, &check_opt,
"assign_to_keycache", TL_READ_NO_INSERT, 0, 0,