Skip to content

Commit 7049143

Browse files
committed
Added check 5
1 parent 6b15c0e commit 7049143

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tpcc_check.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ function check_tables(drv, con, warehouse_num)
114114
print(string.format("Check 4, warehouse: %d FAILED!!!", warehouse_num))
115115
end
116116

117+
local pass5 = 1
118+
for table_num = 1, sysbench.opt.tables do
119+
-- print(string.format("Checking tables: %d for warehouse: %d\n", table_num, warehouse_num))
120+
rs = con:query(string.format("SELECT count(*) FROM orders%d LEFT JOIN new_orders%d ON (no_w_id=o_w_id AND o_d_id=no_d_id AND o_id=no_o_id) where o_w_id=%d and ((o_carrier_id IS NULL and no_o_id IS NULL) OR (o_carrier_id IS NOT NULL and no_o_id IS NOT NULL )) ",table_num, table_num, warehouse_num))
121+
122+
for i = 1, rs.nrows do
123+
row = rs:fetch_row()
124+
local d1 = tonumber(row[1])
125+
if d1 ~= 0 then
126+
pass5=0
127+
end
128+
end
129+
end
130+
131+
if pass5 == 1 then
132+
print(string.format("Check 5, warehouse: %d PASSED", warehouse_num))
133+
else
134+
print(string.format("Check 5, warehouse: %d FAILED!!!", warehouse_num))
135+
end
136+
117137
local pass7 = 1
118138
for table_num = 1, sysbench.opt.tables do
119139
-- print(string.format("Checking tables: %d for warehouse: %d\n", table_num, warehouse_num))

0 commit comments

Comments
 (0)