Skip to content

Commit 6b15c0e

Browse files
committed
Added check 7
1 parent 9d6070a commit 6b15c0e

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 pass7 = 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, order_line%d WHERE o_id=ol_o_id AND o_d_id=ol_d_id AND ol_w_id=o_w_id AND o_w_id=%d AND ((ol_delivery_d IS NULL and o_carrier_id IS NOT NULL) or (o_carrier_id IS NULL and ol_delivery_d 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+
pass7=0
127+
end
128+
end
129+
end
130+
131+
if pass7 == 1 then
132+
print(string.format("Check 7, warehouse: %d PASSED", warehouse_num))
133+
else
134+
print(string.format("Check 7, warehouse: %d FAILED!!!", warehouse_num))
135+
end
136+
117137
local pass8 = 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)