[Core] Fire character DB cleanup on DBC client-build change#296
Merged
billy1arm merged 1 commit intoJul 4, 2026
Merged
Conversation
CharacterDatabaseCleaner::CleanDatabase() has been dead since import: it is gated on saved_variables.cleaning_flags, which nothing ever sets non-zero, so the orphaned-row reconciliation against the DBC stores never runs. Orphaned character_achievement_progress / character_skills / character_spell / character_talent rows only appear when the extracted DBC data is swapped for another client build. Track that build in the new saved_variables.last_cleaned_dbc_build column (character DB update Rel22_03_003) and schedule a full cleanup whenever the build loaded at startup differs from the recorded one. The build is recorded only after a completed run, so an interrupted cleanup retries on the next startup, and manually set cleaning_flags keep working as before. On databases without the new column the cleaner logs a DB-update notice and falls back to the legacy flags-only behaviour.
This was referenced Jul 4, 2026
billy1arm
pushed a commit
to mangosthree/database
that referenced
this pull request
Jul 4, 2026
…#131) Paired with mangosthree/server#296 (DBC-build-change character DB cleanup). Adds the column the core reads to decide when to run the reconciliation; chains db_version 22/03/002 -> 22/03/003.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
CharacterDatabaseCleaner(reconcilescharacter_achievement_progress/character_skills/character_spell/character_talentagainst the DBC stores) is gated onsaved_variables.cleaning_flags— which nothing has ever set (schema-default 0, only ever read and reset). So the cleaner has never actually run, on any core.Orphaned rows only appear when the valid-ID set changes, i.e. when the operator swaps the extracted DBC data for a different client build. This wires the cleaner to fire exactly then:
GetDBCLoadedBuild(), no new read);saved_variables.last_cleaned_dbc_build;cleaning_flagsUPDATE still works);Verified with a live 3-scenario boot matrix (build-change purges planted orphans; match skips the scans; an un-migrated DB warns and still boots).
Schema coordination: requires a paired
mangosthree/databasemigrationRel22_03_003_Add_Last_Cleaned_DBC_Build(addssaved_variables.last_cleaned_dbc_build); this PR bumpsCHAR_DB_CONTENT_NR2→3 to match. The migration SQL is ready — happy to open it against the database repo alongside. The version bump is a content-level change, so it's soft both ways (an un-migrated DB boots with a warning).This change is