> Revert 235492 "[sql] Recover Favicons v5 databases, with more re..."
>
> Speculative revert to find the cause for Mac size regression
> (will revert this revert later)
>
> > [sql] Recover Favicons v5 databases, with more recovery automation.
> >
> > An entirely automated recovery system runs afoul of questions about
> > whether the corrupt database's schema can be trusted.
> > sql::Recovery::AutoRecoverTable() uses a schema created by the caller
> > to construct the recovery virtual table and then copies the data over.
> >
> > sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify
> > accessing meta-table info in the corrupt database.
> >
> > sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to
> > simplify common testing operations.
> >
> > Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using
> > these changes, and add a v5 recovery path. Additionally handle
> > deprecated versions.
> >
> > BUG=240396,109482
> >
> > Review URL: https://codereview.chromium.org/50493012
>
> TBR=shess@chromium.org
>
> Review URL: https://codereview.chromium.org/74933002TBR=kinuko@chromium.org
Review URL: https://codereview.chromium.org/74953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235604 0039d316-1c4b-4281-b951-d872f2087c98
Speculative revert to find the cause for Mac size regression
(will revert this revert later)
> [sql] Recover Favicons v5 databases, with more recovery automation.
>
> An entirely automated recovery system runs afoul of questions about
> whether the corrupt database's schema can be trusted.
> sql::Recovery::AutoRecoverTable() uses a schema created by the caller
> to construct the recovery virtual table and then copies the data over.
>
> sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify
> accessing meta-table info in the corrupt database.
>
> sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to
> simplify common testing operations.
>
> Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using
> these changes, and add a v5 recovery path. Additionally handle
> deprecated versions.
>
> BUG=240396,109482
>
> Review URL: https://codereview.chromium.org/50493012TBR=shess@chromium.org
Review URL: https://codereview.chromium.org/74933002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235595 0039d316-1c4b-4281-b951-d872f2087c98
An entirely automated recovery system runs afoul of questions about
whether the corrupt database's schema can be trusted.
sql::Recovery::AutoRecoverTable() uses a schema created by the caller
to construct the recovery virtual table and then copies the data over.
sql::Recovery::SetupMeta() and GetMetaVersionNumber() simplify
accessing meta-table info in the corrupt database.
sql::test::IntegrityCheck() and CorruptSizeInHeader() helpers to
simplify common testing operations.
Rewrite ThumbnailDatabase v6 and v7 recovery code and tests using
these changes, and add a v5 recovery path. Additionally handle
deprecated versions.
BUG=240396,109482
Review URL: https://codereview.chromium.org/50493012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235492 0039d316-1c4b-4281-b951-d872f2087c98
Load the recover virtual table as part of sql::Recovery::Begin(), and
implement basic unit tests that it correctly recovers valid and
corrupt tables.
BUG=109482
Review URL: https://chromiumcodereview.appspot.com/20022006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215764 0039d316-1c4b-4281-b951-d872f2087c98
sql::Recovery is intended to be used within a sql::Connection error
callback to either recover the database (*) or indicate that the
database is unrecoverable and should be razed. The intend is that the
code should either progress to a valid database which is composed of
data recovered from the original (likely corrupt) database, or a valid
database which is empty.
This is just the framework without the SQLite-level data-recovery
virtual table.
BUG=109482
Review URL: https://chromiumcodereview.appspot.com/19281002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212607 0039d316-1c4b-4281-b951-d872f2087c98
Since the caller cannot have existing database-derived state before
the database is opened, Open() can be safely retried after the error
handler has razed the database.
BUG=109482
Review URL: https://chromiumcodereview.appspot.com/18641004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211936 0039d316-1c4b-4281-b951-d872f2087c98
Test error callback and ScopedErrorIgnorer for running statements.
Share error-callback test code between statement and connection tests.
Test additional error-callback edge cases.
Also fix callback use-after-free case.
BUG=254584
Review URL: https://chromiumcodereview.appspot.com/17726002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211281 0039d316-1c4b-4281-b951-d872f2087c98
Verify that Raze() can handle:
- empty databases.
- non-database files.
- databases overwritten with garbage.
- databases which cannot be opened successfully.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/17752002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210923 0039d316-1c4b-4281-b951-d872f2087c98
Not all of the ad-hoc file_util::Delete() cases handle -journal, and
if -wal was added all of them need to be tracked down.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/17058004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208140 0039d316-1c4b-4281-b951-d872f2087c98
sql/ throws FATAL whenever it sees inappropriate calls, which makes
production code to handle errors hard to test. ScopedErrorIgnorer
provides a way for tests to signal that specific errors are expected
and will be handled.
As a first pass, code up some additional tests for some Raze() edge
cases, and modify things to pass those tests.
BUG=159490
Review URL: https://chromiumcodereview.appspot.com/16664005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207096 0039d316-1c4b-4281-b951-d872f2087c98
Raze() clears out the database, but cannot be called within a
transaction. Close() can only be called once all statements have
cleared. Error callbacks happen while executing statements (thus
often in a transaction, and at least one statement is outstanding).
RazeAndClose() forcibly breaks outstanding transactions, calls Raze()
to clear the database, then calls Close() to close the handle. All
future operations against the database should fail safely (without
affecting storage and without crashing).
BUG=166419, 136846
Review URL: https://chromiumcodereview.appspot.com/12096073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181152 0039d316-1c4b-4281-b951-d872f2087c98
Automated clean up of style checker errors that were missed due to the plugin
not being executed on implementation files.
BUG=115047
Review URL: https://chromiumcodereview.appspot.com/12211033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181004 0039d316-1c4b-4281-b951-d872f2087c98
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes.
Review URL: https://codereview.chromium.org/12163003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Also add to base namespace.
BUG=
Review URL: https://codereview.chromium.org/11359217
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168281 0039d316-1c4b-4281-b951-d872f2087c98
Corruptions resulting from the first page showing a different database
size than the filesystem shows cause very basic functions to fail.
This does fewer queries against the corrupt database, and also enables
a magic pragma to let it make better progress.
BUG=159490
Review URL: https://chromiumcodereview.appspot.com/11369126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167019 0039d316-1c4b-4281-b951-d872f2087c98
Includes a change to sql/Connection to propagate the auto_vacuum pragma across a raze operation. Also updates test expectations.
BUG=137853
Review URL: https://chromiumcodereview.appspot.com/10829062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150128 0039d316-1c4b-4281-b951-d872f2087c98
Many tests are failed due to sqlite errors on Android.
The reason is that sqlite need a temporary directory to
store internal temporary files. However, Android doesn't
have this kind of directory while Linux has /var/tmp.
To fix this, use in-memory temporary files. It also includes:
1) Add one unit test in sql unittests to reproduce this
issue for Android.
2) Remove those disabled cases for content unitests on
Android.
BUG=
TEST=run_tests.py -s sql_unittests; run_test.py -s net_unittests
Review URL: https://chromiumcodereview.appspot.com/10809015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148064 0039d316-1c4b-4281-b951-d872f2087c98
It is used to support the Andorid' sqlite cursor feature which could move the cursor around the result set.
BUG=
TEST=Added a new test.
TBR=agl,akalin,michaeln
Review URL: http://codereview.chromium.org/10171014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133985 0039d316-1c4b-4281-b951-d872f2087c98
Wraps up the notion of reseting a database in a way which respects
SQLite locking constraints and doesn't require closing the database.
A similar outcome could be managed using filesystem operations, which
requires coordination between clients of the database to make sure
that no corruption occurs due to incorrect handling of -journal files.
Also, Windows pins files until the last handle closes, making that
approach challenging in some cases.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9768006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131167 0039d316-1c4b-4281-b951-d872f2087c98
Fix issue that the transaction can not be started if the nesting_transaction rollback.
BUG=
TEST=Add a new test to cover this case. Also pass the existing tests.
Review URL: http://codereview.chromium.org/9839021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128352 0039d316-1c4b-4281-b951-d872f2087c98
Pulls out the core of gbillock's http://codereview.chromium.org/8283002/
- Move NOTREACHED and similar checks into the sql:: implementation code.
- Add malformed SQL checks to Connection::Execute.
- Add SQL-checking convenience methods to Connection.
The general idea is that the sql:: framework assumes valid statements,
rather than having client code contain scattered ad-hoc (and thus
inconsistent) checks.
This version puts back Statement operator overloading and loosy-goosy
Execute() calls to allow other code to be updated in small batches.
R=gbillock@chromium.org,jhawkins@chromium.org,dhollowa@chromium.org
BUG=none
TEST=sql_unittests,unit_tests:*Table*.*
Review URL: http://codereview.chromium.org/8899012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114118 0039d316-1c4b-4281-b951-d872f2087c98
I can't remove app/app.gyp and app/app_base.gypi yet because they are referenced
by third_party gyp files :(
BUG=72317
TEST=None
R=rsesek@chromium.org
move app/sql to sql
Review URL: http://codereview.chromium.org/7353026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93069 0039d316-1c4b-4281-b951-d872f2087c98