summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index dacfc7d9ac5..cb1d88a30d4 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1357,14 +1357,12 @@ int ha_create_table_from_engine(THD* thd,
HA_CREATE_INFO create_info;
TABLE table;
DBUG_ENTER("ha_create_table_from_engine");
- DBUG_PRINT("enter", ("name '%s'.'%s'",
- db, name));
+ DBUG_PRINT("enter", ("name '%s'.'%s'", db, name));
bzero((char*) &create_info,sizeof(create_info));
-
- if(error= ha_discover(thd, db, name, &frmblob, &frmlen))
+ if ((error= ha_discover(thd, db, name, &frmblob, &frmlen)))
{
- // Table could not be discovered and thus not created
+ /* Table could not be discovered and thus not created */
DBUG_RETURN(error);
}
@@ -1375,11 +1373,10 @@ int ha_create_table_from_engine(THD* thd,
(void)strxnmov(path,FN_REFLEN,mysql_data_home,"/",db,"/",name,NullS);
// Save the frm file
- if (writefrm(path, frmblob, frmlen))
- {
- my_free((char*) frmblob, MYF(MY_ALLOW_ZERO_PTR));
+ error= writefrm(path, frmblob, frmlen);
+ my_free((char*) frmblob, MYF(0));
+ if (error)
DBUG_RETURN(2);
- }
if (openfrm(path,"",0,(uint) READ_ALL, 0, &table))
DBUG_RETURN(3);
@@ -1395,7 +1392,6 @@ int ha_create_table_from_engine(THD* thd,
}
error=table.file->create(path,&table,&create_info);
VOID(closefrm(&table));
- my_free((char*) frmblob, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(error != 0);
}