mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-02 14:48:22 +00:00
[mod_mariadb] Fix autocommit not flipping back to on when a transaction ends in mod_mariadb causing switch_cache_db_test_reactive() to fail.
This commit is contained in:
parent
3d650f4f69
commit
88f1a03cad
@ -854,14 +854,15 @@ switch_status_t database_commit(switch_database_interface_handle_t *dih)
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
result = mariadb_SQLEndTran(handle, SWITCH_TRUE);
|
result = mariadb_SQLEndTran(handle, SWITCH_TRUE);
|
||||||
result = result && database_SQLSetAutoCommitAttr(dih, SWITCH_TRUE);
|
result = database_SQLSetAutoCommitAttr(dih, SWITCH_TRUE) && result;
|
||||||
result = result && mariadb_finish_results(handle);
|
result = mariadb_finish_results(handle) && result;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_status_t database_rollback(switch_database_interface_handle_t *dih)
|
switch_status_t database_rollback(switch_database_interface_handle_t *dih)
|
||||||
{
|
{
|
||||||
|
switch_status_t result;
|
||||||
mariadb_handle_t *handle;
|
mariadb_handle_t *handle;
|
||||||
|
|
||||||
if (!dih) {
|
if (!dih) {
|
||||||
@ -874,9 +875,11 @@ switch_status_t database_rollback(switch_database_interface_handle_t *dih)
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mariadb_SQLEndTran(handle, SWITCH_FALSE);
|
result = mariadb_SQLEndTran(handle, SWITCH_FALSE);
|
||||||
|
result = database_SQLSetAutoCommitAttr(dih, SWITCH_TRUE) && result;
|
||||||
|
result = mariadb_finish_results(handle) && result;
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_status_t mariadb_handle_callback_exec_detailed(const char *file, const char *func, int line,
|
switch_status_t mariadb_handle_callback_exec_detailed(const char *file, const char *func, int line,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user