summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2008-11-21 17:38:42 +0400
committerAlexey Botchkov <holyfoot@mysql.com>2008-11-21 17:38:42 +0400
commit52989c445f51f981e8d28842a022e82ac5faab8b (patch)
tree0ee040b7dd3afd19bf08093c172f7445efa8e238 /myisam
parent240d0633b39563ac86aa1beecbdebb02e0aeef13 (diff)
downloadmariadb-git-52989c445f51f981e8d28842a022e82ac5faab8b.tar.gz
Bug#25058 ignored return codes in memory allocation functions
memory allocation error checks added for functions calling insert_dynamic() per-file messages: myisam/mi_delete.c Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled myisam/mi_write.c Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled server-tools/instance-manager/instance_options.cc Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/slave.cc Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sp_head.cc Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sp_head.h Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sp_pcontext.cc Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sp_pcontext.h Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sql_select.cc Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled sql/sql_yacc.yy Bug#25058 ignored return codes in memory allocation functions out-of-memory errors handled
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_delete.c6
-rw-r--r--myisam/mi_write.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c
index ca8a537b322..e08e5097e33 100644
--- a/myisam/mi_delete.c
+++ b/myisam/mi_delete.c
@@ -250,7 +250,11 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (info->ft1_to_ft2)
{
/* we're in ft1->ft2 conversion mode. Saving key data */
- insert_dynamic(info->ft1_to_ft2, (char*) (lastkey+off));
+ if (insert_dynamic(info->ft1_to_ft2, (char*) (lastkey+off)))
+ {
+ DBUG_PRINT("error",("Out of memory"));
+ DBUG_RETURN(-1);
+ }
}
else
{
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index 4f11fc78ccf..b4843a748dd 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -550,7 +550,14 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
we cannot easily dispatch an empty page here */
b+=blen+ft2len+2;
for (a=anc_buff+a_length ; b < a ; b+=ft2len+2)
- insert_dynamic(info->ft1_to_ft2, (char*) b);
+ {
+ if (insert_dynamic(info->ft1_to_ft2, (char*) b))
+ {
+ mi_print_error(info->s, HA_ERR_OUT_OF_MEM);
+ my_errno= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(-1);
+ }
+ }
/* fixing the page's length - it contains only one key now */
mi_putint(anc_buff,2+blen+ft2len+2,0);