mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix for BUG#37873 "Client gets ok from INSERT VALUES before commit record is on disk":
this was true also for INSERT SELECT, UPDATE, DELETE. This fix will be removed when Maria supports COMMIT/ROLLBACK
("Maria 2.0"), because then Maria will trans_register_ha() and so participate in ha_commit_trans().
Without the fix, the assertion added to ha_maria::external_lock() fires many times in *maria*.test.
sql/sql_parse.cc:
Before sending OK to client, commit transaction in Maria.
storage/maria/ha_maria.cc:
Assertion added to external_lock() when committing: OK should not have been sent yet (ACI*D*).
In ha_maria::implicit_commit(), possibility to not create a new transaction, this is used
before net_end_statement(), when the next step is close_thread_tables();
in this use case, ha_maria::implicit_commit() should not commit if under LOCK TABLES.
storage/maria/ha_maria.h:
new prototype
This commit is contained in:
@@ -127,7 +127,7 @@ bool end_active_trans(THD *thd)
|
||||
if (ha_commit(thd))
|
||||
error=1;
|
||||
#ifdef WITH_MARIA_STORAGE_ENGINE
|
||||
ha_maria::implicit_commit(thd);
|
||||
ha_maria::implicit_commit(thd, TRUE);
|
||||
#endif
|
||||
}
|
||||
thd->options&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
|
||||
@@ -1132,6 +1132,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
{
|
||||
char *beginning_of_next_stmt= (char*) end_of_stmt;
|
||||
|
||||
#ifdef WITH_MARIA_STORAGE_ENGINE
|
||||
ha_maria::implicit_commit(thd, FALSE);
|
||||
#endif
|
||||
|
||||
net_end_statement(thd);
|
||||
query_cache_end_of_result(thd);
|
||||
/*
|
||||
@@ -1496,6 +1500,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
thd->mysys_var->abort= 0;
|
||||
}
|
||||
|
||||
#ifdef WITH_MARIA_STORAGE_ENGINE
|
||||
ha_maria::implicit_commit(thd, FALSE);
|
||||
#endif
|
||||
|
||||
net_end_statement(thd);
|
||||
query_cache_end_of_result(thd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user