Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: Have MetaTable expose a "delete the table" method
sql::MetaTable works by manipulating a caller-provided database to store additional version information in a new metadata table. Some clients using sql::MetaTable might start out with their databases unversioned and switch to maintaining version metadata at a later time. In this case, it can help to be able to test the no-metadata-maintained to metadata-maintained upgrade. However, once a database begins using a metadata table, it might be difficult to emulate the state of the database prior to using a metadata table. Clearing out the initialized metadata table can achieve this effect, but the name of the metadata table is an implementation detail, so it's not possible to just delete the table directly from test code. To get around this issue, this CL adds an sql::MetaTable::DeleteTableForTesting method to do just that. As one example, the child CL crrev.com/c/2908133 uses this method to verify its database correctly handles an upgrade from a state with no version written to disk. Bug: None Change-Id: I5d440e11196638a04ad16beb4002ed5d3e25af19 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2920848 Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#894658}
- Loading branch information