Skip to content

Commit 20c3086

Browse files
committed
refactor(diff): filter only dolt_ignore table in diff summary
Changed from filtering all dolt_* system tables to only filtering the dolt_ignore table itself in dolt_diff_summary. This maintains ignore pattern functionality while being more conservative about which system tables are filtered, fixing bats test failures. Refs: #5861
1 parent 677c3bd commit 20c3086

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

go/libraries/doltcore/sqle/dtablefunctions/dolt_diff_summary.go

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ func (ds *DiffSummaryTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.
301301
return NewDiffSummaryTableFunctionRowIter([]*diff.TableDeltaSummary{}), nil
302302
}
303303

304-
// Check if the specific table is a system table
305-
if shouldFilterSystemTable(delta) {
304+
// Filter out dolt_ignore table itself to match dolt diff behavior
305+
if shouldFilterDoltIgnoreTable(delta) {
306306
return NewDiffSummaryTableFunctionRowIter([]*diff.TableDeltaSummary{}), nil
307307
}
308308

@@ -325,8 +325,8 @@ func (ds *DiffSummaryTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.
325325
continue
326326
}
327327

328-
// Filter out system tables (tables starting with "dolt_")
329-
if shouldFilterSystemTable(delta) {
328+
// Filter out dolt_ignore table itself to match dolt diff behavior
329+
if shouldFilterDoltIgnoreTable(delta) {
330330
continue
331331
}
332332

@@ -518,14 +518,7 @@ func shouldIgnoreDelta(delta diff.TableDelta, ignorePatterns doltdb.IgnorePatter
518518
return false
519519
}
520520

521-
// shouldFilterSystemTable determines if a table delta should be filtered out because it's a system table.
522-
func shouldFilterSystemTable(delta diff.TableDelta) bool {
523-
// Check if either the from or to table name starts with "dolt_"
524-
if delta.FromName.Name != "" && strings.HasPrefix(delta.FromName.Name, "dolt_") {
525-
return true
526-
}
527-
if delta.ToName.Name != "" && strings.HasPrefix(delta.ToName.Name, "dolt_") {
528-
return true
529-
}
530-
return false
521+
// shouldFilterDoltIgnoreTable filters out the dolt_ignore table itself to match dolt diff behavior.
522+
func shouldFilterDoltIgnoreTable(delta diff.TableDelta) bool {
523+
return delta.FromName.Name == "dolt_ignore" || delta.ToName.Name == "dolt_ignore"
531524
}

0 commit comments

Comments
 (0)