aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/tpcc/tpcc-load.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-19 01:53:40 +0100
committereunhhu <[email protected]>2026-10-19 01:53:40 +0100
commitdefb2cf06a9b5db9429ca368d8c2af127a5c9c3d (patch)
treeb13c94eb334ce2a5055854791900f8702ba9fc3b /benchmarks/tpcc/tpcc-load.c
parent809a83a5764ec0f0c84b96c43a20cfb906eee031 (diff)
downloadpure-defb2cf06a9b5db9429ca368d8c2af127a5c9c3d.tar.gz
pure-defb2cf06a9b5db9429ca368d8c2af127a5c9c3d.zip
027's 5c: money as i64 minor units shown by .Nd: NUM_TEXT's decimal form takes digits (bits 20-24 as FIXED's), an integer's last N digits written after a point (1234 at two is 12.34, -5 -0.05, 0 0.00; width and zeros after the sign), verification allowing digits on FIXED and DECIMAL alone; unit test: ten rows of formats_and_held (-2^63 at two, 25 digits, a number's whole 1234, its 12.5 a limit); TPC-C's money i64 cents and its rates ten-thousandths (tables, messages, load, the transactions), SQLite's INTEGER columns and int64 bindings alike, the comparison now exact (no 1e-9 tolerance): after 20,000 transactions every row of every table the same (grouped SQLite too) and 3.3.2 holding on both; counts: b45 against b44 BFS without batches +0.09%, the rest within 0.001%; the bank's queries (s44 and s45 in turns, six each) in_credit -0.59%, per_branch -0.34%, ranks -0.20%, the rest within 0.01%, the seven answers the same bytes; 008 (NUM_TEXT's digits, a message row's i64 cells), 027 and 092
Diffstat (limited to 'benchmarks/tpcc/tpcc-load.c')
-rw-r--r--benchmarks/tpcc/tpcc-load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/benchmarks/tpcc/tpcc-load.c b/benchmarks/tpcc/tpcc-load.c
index 176ec1e..d3cee99 100644
--- a/benchmarks/tpcc/tpcc-load.c
+++ b/benchmarks/tpcc/tpcc-load.c
@@ -118,8 +118,8 @@ static void prepare(Connection *c) {
do cw = uniform(r, 1, warehouses); while (cw == w);
cd = uniform(r, 1, 10);
}
- double amount = uniform(r, 100, 500000) / 100.0;
- length = snprintf(body, sizeof(body), "{\"w\":%d,\"d\":%d,\"cw\":%d,\"cd\":%d,\"c\":%d,\"amount\":%.2f}", w, d, cw,
+ int amount = uniform(r, 100, 500000); /* cents */
+ length = snprintf(body, sizeof(body), "{\"w\":%d,\"d\":%d,\"cw\":%d,\"cd\":%d,\"c\":%d,\"amount\":%d}", w, d, cw,
cd, customer, amount);
path = "/inputs/payment";
} else if (c->kind == DELIVERY) {