Skip to content

Commit 166d038

Browse files
committed
Limit the number of columns involved in an index to 12 or less.
Some databases simply does not support that many columns.
1 parent e2025bf commit 166d038

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dbgen"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
authors = ["kennytm <[email protected]>"]
55
edition = "2018"
66
license = "MIT"

src/schemagen_cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'a> IndexAppender<'a> {
288288
unique_cutoff: f64,
289289
is_primary_key: bool,
290290
) {
291-
let index_count = self.index_count_distr.sample(rng) as usize;
291+
let index_count = (self.index_count_distr.sample(rng) as usize).min(12);
292292
let index_set = self
293293
.index_distr
294294
.sample_iter(&mut rng)

0 commit comments

Comments
 (0)