Skip to content

Commit d753e4c

Browse files
authored
fix: hash-threshold should be compared with the number of values (#121)
1 parent 7e39de7 commit d753e4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sqllogictest/src/runner.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ impl<D: AsyncDB> Runner<D> {
429429
self.validator = validator;
430430
}
431431

432+
pub fn with_hash_threshold(&mut self, hash_threshold: usize) {
433+
self.hash_threshold = hash_threshold;
434+
}
435+
432436
pub async fn apply_record(&mut self, record: Record) -> RecordOutput {
433437
match record {
434438
Record::Statement { conditions, .. } if self.should_skip(&conditions) => {
@@ -504,7 +508,7 @@ impl<D: AsyncDB> Runner<D> {
504508
Some(SortMode::ValueSort) => todo!("value sort"),
505509
};
506510

507-
if self.hash_threshold > 0 && rows.len() > self.hash_threshold {
511+
if self.hash_threshold > 0 && rows.len() * types.len() > self.hash_threshold {
508512
let mut md5 = md5::Context::new();
509513
for line in &rows {
510514
for value in line {

0 commit comments

Comments
 (0)