diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-12-27 13:48:37 +1100 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-12-27 13:48:37 +1100 |
commit | 9ff8d7452ddf7370fc9047ebe9517fd7558914e6 (patch) | |
tree | 582219e9112051f579005f48781c0f6f9fb29ea8 /src/third_party/wiredtiger/test/format/format.h | |
parent | 62c7e599ba211209eb93ae8f652d17fc8f6c251f (diff) | |
download | mongo-9ff8d7452ddf7370fc9047ebe9517fd7558914e6.tar.gz |
Import wiredtiger: e6c1b9724ed6ed2879a36d7e140f4fa9daceb261 from branch mongodb-4.2
ref: d5793d4dd5..e6c1b9724e
for: 4.1.7
WT-4366 Fix how test/format handles prepare conflict errors
WT-4426 Change WT data format to include timestamps in leaf page key/value cells
WT-4475 clang detected memory leak while executing csuite tests
WT-4499 Fix prepared transactions for cursor key order check failure
WT-4506 Bypass some csuite tests for valgrind
Diffstat (limited to 'src/third_party/wiredtiger/test/format/format.h')
-rw-r--r-- | src/third_party/wiredtiger/test/format/format.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/test/format/format.h b/src/third_party/wiredtiger/test/format/format.h index e9063674476..4b8eadeea1d 100644 --- a/src/third_party/wiredtiger/test/format/format.h +++ b/src/third_party/wiredtiger/test/format/format.h @@ -377,6 +377,13 @@ mmrand(WT_RAND_STATE *rnd, u_int min, u_int max) uint32_t v; u_int range; + /* + * Test runs with small row counts can easily pass a max of 0 (for + * example, "g.rows / 20"). Avoid the problem. + */ + if (min <= max) + return (min); + v = rng(rnd); range = (max - min) + 1; v %= range; |