Skip to content

Commit 3e6b860

Browse files
committed
fixes
1 parent cd72544 commit 3e6b860

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tpcc_check.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function check_tables(drv, con, warehouse_num)
117117
local pass8 = 1
118118
for table_num = 1, sysbench.opt.tables do
119119
-- print(string.format("Checking tables: %d for warehouse: %d\n", table_num, warehouse_num))
120-
rs = con:query(string.format("SELECT count(*) cn FROM (SELECT w_id,w_ytd,SUM(h_amount) sm FROM history%d,warehouse%d WHERE h_w_id=w_id GROUP BY w_id) t1 WHERE w_ytd<>sm",table_num, table_num))
120+
rs = con:query(string.format("SELECT count(*) cn FROM (SELECT w_id,w_ytd,SUM(h_amount) sm FROM history%d,warehouse%d WHERE h_w_id=w_id and w_id=%d GROUP BY w_id) t1 WHERE w_ytd<>sm",table_num, table_num, warehouse_num))
121121

122122
for i = 1, rs.nrows do
123123
row = rs:fetch_row()
@@ -137,7 +137,7 @@ function check_tables(drv, con, warehouse_num)
137137
local pass9 = 1
138138
for table_num = 1, sysbench.opt.tables do
139139
-- print(string.format("Checking tables: %d for warehouse: %d\n", table_num, warehouse_num))
140-
rs = con:query(string.format("SELECT COUNT(*) FROM (select d_id,d_w_id,sum(d_ytd) s1 from district%d group by d_id,d_w_id) d,(select h_d_id,h_w_id,sum(h_amount) s2 from history%d group by h_d_id, h_w_id) h WHERE h_d_id=d_id AND d_w_id=h_w_id and s1<>s2",table_num, table_num))
140+
rs = con:query(string.format("SELECT COUNT(*) FROM (select d_id,d_w_id,sum(d_ytd) s1 from district%d group by d_id,d_w_id) d,(select h_d_id,h_w_id,sum(h_amount) s2 from history%d group by h_d_id, h_w_id) h WHERE h_d_id=d_id AND d_w_id=h_w_id and d_w_id=%d and s1<>s2",table_num, table_num, warehouse_num))
141141

142142
for i = 1, rs.nrows do
143143
row = rs:fetch_row()

tpcc_common.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ sysbench.cmdline.options = {
4141
use_fk =
4242
{"Use foreign keys", 1},
4343
mysql_storage_engine =
44-
{"Storage engine, if MySQL is used", "innodb"}
44+
{"Storage engine, if MySQL is used", "innodb"},
45+
mysql_table_options =
46+
{"Extra table options, if MySQL is used. e.g. 'COLLATE latin1_bin'", ""}
4547
}
4648

4749
function sleep(n)
@@ -104,6 +106,7 @@ function create_tables(drv, con, table_num)
104106
drv:name() == "drizzle"
105107
then
106108
engine_def = "/*! ENGINE = " .. sysbench.opt.mysql_storage_engine .. " */"
109+
extra_table_options = sysbench.opt.mysql_table_options or ""
107110
end
108111

109112

@@ -278,8 +281,8 @@ function create_tables(drv, con, table_num)
278281
i_price decimal(5,2),
279282
i_data varchar(50),
280283
PRIMARY KEY(i_id)
281-
) %s ]],
282-
i, engine_def)
284+
) %s %s]],
285+
i, engine_def, extra_table_options)
283286

284287
con:query(query)
285288

tpcc_run.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ function delivery()
638638
-- SET ol_delivery_d = :datetime
639639
-- WHERE ol_o_id = :no_o_id AND ol_d_id = :d_id AND
640640
-- ol_w_id = :w_id;*/
641-
print("Update ol_delivery_d"..table_num.." no_o_id: "..no_o_id )
642641
con:query(string.format([[UPDATE order_line%d SET ol_delivery_d = NOW()
643642
WHERE ol_o_id = %d AND ol_d_id = %d AND ol_w_id = %d]],
644643
table_num, no_o_id, d_id, w_id))

0 commit comments

Comments
 (0)