diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 5206a759740..cfcfd51dac7 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -280,8 +280,8 @@ static int bad_ptr(const char *where, void *ptr) magicend[2] != MAGICEND2 || magicend[3] != MAGICEND3) { - warn("Error: %s overrun buffer", where); - fprintf(stderr, ", allocated at "); + warn("Error: %s overrun buffer ", where); + fprintf(stderr, "Allocated at "); print_stack(irem->frame); return 1; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 22c32085785..e7abef13c75 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1454,11 +1454,6 @@ void close_thread_tables(THD *thd) TABLE *table; DBUG_ENTER("close_thread_tables"); -#ifdef WITH_ARIA_STORAGE_ENGINE - if (!thd->in_sub_stmt) - ha_maria::implicit_commit(thd, FALSE); -#endif - #ifdef EXTRA_DEBUG DBUG_PRINT("tcache", ("open tables:")); for (table= thd->open_tables; table; table= table->next) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 719fcad5883..ee2998e6e5e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1052,10 +1052,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ! thd->is_error()) { /* - Multiple queries exits, execute them individually + Multiple queries exist, execute them individually */ char *beginning_of_next_stmt= (char*) parser_state.m_lip.found_semicolon; +#ifdef WITH_ARIA_STORAGE_ENGINE + ha_maria::implicit_commit(thd, FALSE); +#endif + /* Finalize server status flags after executing a statement. */ thd->update_server_status(); thd->protocol->end_statement(); @@ -4473,6 +4477,9 @@ finish: trans_commit_stmt(thd); thd->stmt_da->can_overwrite_status= FALSE; } +#ifdef WITH_ARIA_STORAGE_ENGINE + ha_maria::implicit_commit(thd, FALSE); +#endif } lex->unit.cleanup();