summaryrefslogtreecommitdiff
path: root/sql
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
commitbeedf6b261b243ec0a2332162bface6ec7d58dd0 (patch)
tree86868d0d8268b65cd2a903f192c0044e3f8221d1 /sql
parent138df47b4988aa59ddf3be74710c1537240b1ccc (diff)
downloadmariadb-git-beedf6b261b243ec0a2332162bface6ec7d58dd0.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')
-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,