summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-06-09 15:31:22 +0000
committerTomas Vondra2017-06-09 15:31:22 +0000
commit12d2aa66055138da4f4cc67f7f032fc4dda776d9 (patch)
tree255bba54a9ddde7199146c3bf5e8041424ac58f3
parent42cc79c34b228da47c45c479f629c7d2035783d2 (diff)
Fix minor issues in the tpcb-like pgbench script
The tpcb-like built-in script in pgbench contained two simple bugs. It was still using the old \setrandom command to generate the delta value, instead of the new \set delta random(-5000, 5000) This is mostly an omission in 32d57848458595a487d251b37c2872d86de439ef. There was also a missing semicolon at the end of one of the commands, causing cryptic syntax errors.
-rw-r--r--src/bin/pgbench/pgbench.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 364b91ce31..0b7cd4eaa8 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -347,10 +347,10 @@ static const BuiltinScript builtin_script[] =
"\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n"
"\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n"
"\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n"
- "\\setrandom delta -5000 5000\n"
+ "\\set delta random(-5000, 5000)\n"
"BEGIN;\n"
"UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid AND bid = :bid;\n"
- "SELECT abalance FROM pgbench_accounts WHERE aid = :aid AND bid = :bid\n"
+ "SELECT abalance FROM pgbench_accounts WHERE aid = :aid AND bid = :bid;\n"
"UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid AND bid = :bid;\n"
"UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;\n"
"INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"