Skip to content

Commit 50ad0f5

Browse files
committed
consider table level max_rows directive in builder
1 parent 45c8a01 commit 50ad0f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,13 +1423,13 @@ where
14231423
}
14241424
};
14251425

1426-
let max_rows: u64 = xtype
1426+
let max_rows = xtype
14271427
.schema
14281428
.context
14291429
.schemas
14301430
.values()
14311431
.find(|s| s.oid == xtype.table.schema_oid)
1432-
.map(|x| x.directives.max_rows)
1432+
.map(|schema| xtype.table.max_rows(schema))
14331433
.unwrap_or(30);
14341434

14351435
let before: Option<Cursor> = read_argument_cursor(

src/sql_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl Table {
591591
/// Get the effective max_rows value for this table.
592592
/// If table-specific max_rows is set, use that.
593593
/// Otherwise, fall back to schema-level max_rows.
594-
/// If neither is set, use the global default.
594+
/// If neither is set, use the global default(set in load_sql_context.sql)
595595
pub fn max_rows(&self, schema: &Schema) -> u64 {
596596
self.directives.max_rows.unwrap_or(schema.directives.max_rows)
597597
}

0 commit comments

Comments
 (0)