Skip to content

Commit

Permalink
fix: hash-threshold should be compared with the number of values (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan authored Dec 9, 2022
1 parent 7e39de7 commit d753e4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ impl<D: AsyncDB> Runner<D> {
self.validator = validator;
}

pub fn with_hash_threshold(&mut self, hash_threshold: usize) {
self.hash_threshold = hash_threshold;
}

pub async fn apply_record(&mut self, record: Record) -> RecordOutput {
match record {
Record::Statement { conditions, .. } if self.should_skip(&conditions) => {
Expand Down Expand Up @@ -504,7 +508,7 @@ impl<D: AsyncDB> Runner<D> {
Some(SortMode::ValueSort) => todo!("value sort"),
};

if self.hash_threshold > 0 && rows.len() > self.hash_threshold {
if self.hash_threshold > 0 && rows.len() * types.len() > self.hash_threshold {
let mut md5 = md5::Context::new();
for line in &rows {
for value in line {
Expand Down

0 comments on commit d753e4c

Please sign in to comment.