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
9 changes: 8 additions & 1 deletion src/doltlite_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,14 @@ int doltliteMaybeSeedRepo(sqlite3 *db){
"Initialize data repository", NULL, NULL, 0, 0, &seedHash);
if( rc!=SQLITE_OK ) return rc;

return doltliteAdvanceBranch(db, &seedHash, &emptyCatalog, 0);
/* Tables created before the seed live only in the session; the working
** set must carry them, not the seed's empty catalog. */
{
ProllyHash liveCatalog;
rc = doltliteFlushCatalogToHash(db, &liveCatalog);
if( rc!=SQLITE_OK ) return rc;
return doltliteAdvanceBranch(db, &seedHash, &emptyCatalog, &liveCatalog);
}
}

int doltliteConfigRegister(sqlite3 *db){
Expand Down
8 changes: 7 additions & 1 deletion src/doltlite_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,13 @@ static int doltliteAdvanceBranchWithState(
}
}

rc = doltlitePersistWorkingSetWithHash(db, pWorkingCatHash);
/* A null working catalog used to flush the live session here, but the
** head confirm can have reloaded that session from a peer's freshly
** written working set: the persist then binds the peer's content to the
** new head and the staleness gate waves it through. Advancing with no
** explicit working catalog means the working set IS the new catalog. */
rc = doltlitePersistWorkingSetWithHash(
db, pWorkingCatHash ? pWorkingCatHash : pCatalogHash);
if( rc!=SQLITE_OK ){
return doltliteRestoreTxnStateOnFailure(db, pSaved, rc);
}
Expand Down
Loading