Add oltp_delete_inserts flag to oltp.lua
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysbench |
New
|
Undecided
|
Unassigned |
Bug Description
To increase the ability to customize the types of "writes" in a test, I am requesting that a new flag "oltp_delete_
Current code:
i = sb_rand(1, oltp_table_size)
rs = db_query("DELETE FROM " .. table_name .. " WHERE id=" .. i)
c_val = sb_rand_str([[
#######
pad_val = sb_rand_str([[
#######
rs = db_query("INSERT INTO " .. table_name .. " (id, k, c, pad) VALUES " .. string.format("(%d, %d, '%s', '%s')",i, sb_rand(1, oltp_table_size) , c_val
, pad_val))
Modified Code:
for i=1, oltp_delete_inserts do
i = sb_rand(1, oltp_table_size)
rs = db_query("DELETE FROM " .. table_name .. " WHERE id=" .. i)
c_val = sb_rand_str([[
#######
pad_val = sb_rand_str([[
#######
rs = db_query("INSERT INTO " .. table_name .. " (id, k, c, pad) VALUES " .. string.format("(%d, %d, '%s', '%s')",i, sb_rand(1, oltp_table_size) , c_val
, pad_val))
end