Skip to content

Commit 9d39c9a

Browse files
committed
store: Account for causality region column in InsertQuery::chunk_size
The code assumed one column too few when calculating chunk size which can cause errors
1 parent 0095a56 commit 9d39c9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

store/postgres/src/relational_queries.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,11 @@ impl<'a> InsertQuery<'a> {
23262326
/// query, and depends on what columns `table` has and how they get put
23272327
/// into the query
23282328
pub fn chunk_size(table: &Table) -> usize {
2329+
// We always have one column for the block number/range
23292330
let mut count = 1;
2331+
if table.has_causality_region {
2332+
count += 1;
2333+
}
23302334
for column in table.columns.iter() {
23312335
// This code depends closely on how `walk_ast` and `QueryValue`
23322336
// put values into bind variables

0 commit comments

Comments
 (0)