diff --git a/src/lua/oltp_common.lua b/src/lua/oltp_common.lua index fdc5c83ed..7ae36dc57 100644 --- a/src/lua/oltp_common.lua +++ b/src/lua/oltp_common.lua @@ -287,6 +287,10 @@ function prepare_commit() end function prepare_for_each_table(key) + if drv:name() == "mysql" + then + con:query("SET autocommit=0, unique_checks=0, foreign_key_checks=0") + end for t = 1, sysbench.opt.tables do stmt[t][key] = con:prepare(string.format(stmt_defs[key][1], t)) @@ -316,6 +320,10 @@ function prepare_for_each_table(key) stmt[t][key]:bind_param(unpack(param[t][key])) end end + if drv:name() == "mysql" + then + con:query("SET autocommit=1, unique_checks=1, foreign_key_checks=1") + end end function prepare_point_selects()