diff options
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index ad7e1ecfa80..17a92b00b4f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -992,7 +992,7 @@ int ha_prepare(THD *thd) THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; Ha_trx_info *ha_info= trans->ha_list; DBUG_ENTER("ha_prepare"); -#ifdef USING_TRANSACTIONS + if (ha_info) { for (; ha_info; ha_info= ha_info->next()) @@ -1018,7 +1018,7 @@ int ha_prepare(THD *thd) } } } -#endif /* USING_TRANSACTIONS */ + DBUG_RETURN(error); } @@ -1146,7 +1146,7 @@ int ha_commit_trans(THD *thd, bool all) my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(2); } -#ifdef USING_TRANSACTIONS + if (ha_info) { uint rw_ha_count; @@ -1227,7 +1227,6 @@ end: /* Free resources and perform other cleanup even for 'empty' transactions. */ else if (is_real_trans) thd->transaction.cleanup(); -#endif /* USING_TRANSACTIONS */ DBUG_RETURN(error); } @@ -1249,7 +1248,7 @@ int ha_commit_one_phase(THD *thd, bool all) bool is_real_trans=all || thd->transaction.all.ha_list == 0; Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; DBUG_ENTER("ha_commit_one_phase"); -#ifdef USING_TRANSACTIONS + if (ha_info) { for (; ha_info; ha_info= ha_info_next) @@ -1279,7 +1278,7 @@ int ha_commit_one_phase(THD *thd, bool all) /* Free resources and perform other cleanup even for 'empty' transactions. */ if (is_real_trans) thd->transaction.cleanup(); -#endif /* USING_TRANSACTIONS */ + DBUG_RETURN(error); } @@ -1319,7 +1318,7 @@ int ha_rollback_trans(THD *thd, bool all) my_error(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0)); DBUG_RETURN(1); } -#ifdef USING_TRANSACTIONS + if (ha_info) { /* Close all cursors that can not survive ROLLBACK */ @@ -1350,7 +1349,6 @@ int ha_rollback_trans(THD *thd, bool all) /* Always cleanup. Even if there nht==0. There may be savepoints. */ if (is_real_trans) thd->transaction.cleanup(); -#endif /* USING_TRANSACTIONS */ if (all) thd->transaction_rollback_request= FALSE; @@ -1386,7 +1384,7 @@ int ha_rollback_trans(THD *thd, bool all) int ha_autocommit_or_rollback(THD *thd, int error) { DBUG_ENTER("ha_autocommit_or_rollback"); -#ifdef USING_TRANSACTIONS + if (thd->transaction.stmt.ha_list) { if (!error) @@ -1404,7 +1402,6 @@ int ha_autocommit_or_rollback(THD *thd, int error) thd->variables.tx_isolation=thd->session_tx_isolation; } else -#endif { if (!error) RUN_HOOK(transaction, after_commit, (thd, FALSE)); @@ -1812,7 +1809,7 @@ int ha_savepoint(THD *thd, SAVEPOINT *sv) &thd->transaction.all); Ha_trx_info *ha_info= trans->ha_list; DBUG_ENTER("ha_savepoint"); -#ifdef USING_TRANSACTIONS + for (; ha_info; ha_info= ha_info->next()) { int err; @@ -1836,7 +1833,7 @@ int ha_savepoint(THD *thd, SAVEPOINT *sv) engines are prepended to the beginning of the list. */ sv->ha_list= trans->ha_list; -#endif /* USING_TRANSACTIONS */ + DBUG_RETURN(error); } @@ -3017,7 +3014,7 @@ static bool update_frm_version(TABLE *table) } err: if (file >= 0) - VOID(my_close(file,MYF(MY_WME))); + (void) my_close(file,MYF(MY_WME)); DBUG_RETURN(result); } @@ -3650,7 +3647,7 @@ int ha_create_table(THD *thd, const char *path, name= get_canonical_filename(table.file, share.path.str, name_buff); error= table.file->ha_create(name, &table, create_info); - VOID(closefrm(&table, 0)); + (void) closefrm(&table, 0); if (error) { strxmov(name_buff, db, ".", table_name, NullS); @@ -3721,7 +3718,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) get_canonical_filename(table.file, path, path); error=table.file->ha_create(path, &table, &create_info); - VOID(closefrm(&table, 1)); + (void) closefrm(&table, 1); DBUG_RETURN(error != 0); } |