summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-10-15 00:18:48 +0300
committerMichael Widenius <monty@askmonty.org>2013-10-15 00:18:48 +0300
commitfcaf1e6a82e2a9f6914b72ea9307c7d91d194150 (patch)
tree9aa096038fc10bf4e61714bd0d3e5af502fdc40e /sql/sp.cc
parent5748eb3ec63adee035ec5305796bdbc67a654158 (diff)
downloadmariadb-git-fcaf1e6a82e2a9f6914b72ea9307c7d91d194150.tar.gz
Flush the proc file after every modifications. This will avoid errors of type "Table './mysql/proc' is marked as crashed and should be repaired"
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index 56565f1d11e..f60ca49ca7b 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1167,6 +1167,9 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp)
ret= SP_OK;
if (table->file->ha_write_row(table->record[0]))
ret= SP_WRITE_ROW_FAILED;
+ /* Make change permanent and avoid 'table is marked as crashed' errors */
+ table->file->extra(HA_EXTRA_FLUSH);
+
if (ret == SP_OK)
sp_cache_invalidate();
@@ -1256,6 +1259,8 @@ sp_drop_routine(THD *thd, stored_procedure_type type, sp_name *name)
{
if (table->file->ha_delete_row(table->record[0]))
ret= SP_DELETE_ROW_FAILED;
+ /* Make change permanent and avoid 'table is marked as crashed' errors */
+ table->file->extra(HA_EXTRA_FLUSH);
}
if (ret == SP_OK)
@@ -1366,6 +1371,8 @@ sp_update_routine(THD *thd, stored_procedure_type type, sp_name *name,
ret= SP_WRITE_ROW_FAILED;
else
ret= 0;
+ /* Make change permanent and avoid 'table is marked as crashed' errors */
+ table->file->extra(HA_EXTRA_FLUSH);
}
if (ret == SP_OK)
@@ -1540,7 +1547,11 @@ sp_drop_db_routines(THD *thd, char *db)
if (nxtres != HA_ERR_END_OF_FILE)
ret= SP_KEY_NOT_FOUND;
if (deleted)
+ {
sp_cache_invalidate();
+ /* Make change permanent and avoid 'table is marked as crashed' errors */
+ table->file->extra(HA_EXTRA_FLUSH);
+ }
}
table->file->ha_index_end();