Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions go/libraries/doltcore/sqle/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,20 @@ func (db Database) getTableInsensitive(ctx *sql.Context, head *doltdb.Commit, ds
// TODO: these tables that cache a root value at construction time should not, they need to get it from the session
// at runtime
switch {
case lwrName == doltdb.DoltDiffTablePrefix+doltdb.SchemasTableName:
// Special handling for dolt_diff_dolt_schemas
// Get the HEAD commit
if head == nil {
var err error
head, err = ds.GetHeadCommit(ctx, db.RevisionQualifiedName())
if err != nil {
return nil, false, err
}
}

// Use the same pattern as regular diff tables - this will show complete history
return DoltSchemasDiffTable(ctx, db.ddb, head, root, db), true, nil

case strings.HasPrefix(lwrName, doltdb.DoltDiffTablePrefix):
if head == nil {
var err error
Expand Down Expand Up @@ -384,6 +398,17 @@ func (db Database) getTableInsensitive(ctx *sql.Context, head *doltdb.Commit, ds
}
return dt, true, nil

case lwrName == doltdb.DoltHistoryTablePrefix+doltdb.SchemasTableName:
// Special handling for dolt_history_dolt_schemas
if head == nil {
var err error
head, err = ds.GetHeadCommit(ctx, db.RevisionQualifiedName())
if err != nil {
return nil, false, err
}
}
return DoltSchemasHistoryTable(db.ddb, head, db), true, nil

case strings.HasPrefix(lwrName, doltdb.DoltHistoryTablePrefix):
baseTableName := tblName[len(doltdb.DoltHistoryTablePrefix):]
baseTable, ok, err := db.getTable(ctx, root, baseTableName)
Expand Down
Loading
Loading