summaryrefslogtreecommitdiffstats
path: root/sql/connection.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixing null pointer dereference.glotov@chromium.org2013-01-171-2/+3
| | | | | | | | | | BUG=chromium:158178 TEST=units,make sure such SEGV doesnt happen on x86-generic-bot (where it pops periodically now) Review URL: https://chromiumcodereview.appspot.com/11886065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177399 0039d316-1c4b-4281-b951-d872f2087c98
* Bake targeted error histogram support directly into sql::Connection.shess@chromium.org2013-01-031-0/+10
| | | | | | | | | | | | Previously there was a convoluted template system to unique histogram names for purposes of tracking database errors separately. This was needed due to the static cache used by the histogram macros. Instead, just log the histogram manually without using a static cache. Additionally, pull the histogram functionality right up into the connection, rather than requiring formalized delegation to get it. BUG=none Review URL: https://chromiumcodereview.appspot.com/11474030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175055 0039d316-1c4b-4281-b951-d872f2087c98
* Make sql::Connection::Raze() more robust against corruptions.shess@chromium.org2012-11-101-0/+13
| | | | | | | | | | | | | | 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
* Move ErrorDelegate to its own file and add static utility functions to ↵pkotwicz@chromium.org2012-10-181-7/+7
| | | | | | | | | | | | | ErrorDelegate BUG=151841 Test=None R=shess, erikwright TBR=cpu Review URL: https://chromiumcodereview.appspot.com/11141012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162647 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ref counting on sql::ErrorDelegatepkotwicz@chromium.org2012-10-171-9/+6
| | | | | | | | | | | | BUG=151841 Test=None R=shess TBR=jamesr,erikwright Review URL: https://chromiumcodereview.appspot.com/11111021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162443 0039d316-1c4b-4281-b951-d872f2087c98
* Annotate calls to SQLite functions - they have to be executed on a thread ↵shess@chromium.org2012-07-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | allowing IO access. Also expanded scope of ScopedAllowIO in SQLiteServerBoundCertStore::Backend::Load() to cover SQLite functions. And added ScopedAllowIO to PasswordStoreFactory::BuildServiceInstanceFor() -- it calls LoginDatabase::Init() which should be executed on DB thread. This is a reland of https://src.chromium.org/viewvc/chrome?view=rev&revision=147309 which was reverted because of missing ScopedAllowIO in PasswordStoreFactory. Patch from Pavel Ivanov <paivanof@gmail.com> BUG=75232, 52909, 137961, 138903 TEST=no test fails with message "Function marked as IO-only was called from a thread that disallows IO!" Review URL: https://chromiumcodereview.appspot.com/10824008 Patch from Pavel Ivanov <paivanof@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148788 0039d316-1c4b-4281-b951-d872f2087c98
* [sql] Refactor to remove use of const_cast<>.shess@chromium.org2012-07-241-1/+10
| | | | | | | | | | | | | | | The comments in these cases used incorrect reasoning for why the const_cast<> was safe. Whether the SQL statements modify the database is irrelevant. Add an internal helper to allow them to correctly accomplish things in a const situation. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10736042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148031 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 147309 - Annotate calls to SQLite functions - they have to be ↵shess@chromium.org2012-07-181-18/+1
| | | | | | | | | | | | | | | | | | | executed on a thread allowing IO access. Expand scope of ScopedAllowIO in the only place where SQLite functions are used on UI thread. Patch from Pavel Ivanov <paivanof@gmail.com> BUG=75232,52909,137961 TEST=no test fails with message "Function marked as IO-only was called from a thread that disallows IO!" Review URL: https://chromiumcodereview.appspot.com/10540155 Patch from Pavel Ivanov <paivanof@gmail.com>. TBR=shess@chromium.org Review URL: https://chromiumcodereview.appspot.com/10806025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147340 0039d316-1c4b-4281-b951-d872f2087c98
* Annotate calls to SQLite functions - they have to be executed on a thread ↵shess@chromium.org2012-07-181-1/+18
| | | | | | | | | | | | | | | | allowing IO access. Expand scope of ScopedAllowIO in the only place where SQLite functions are used on UI thread. Patch from Pavel Ivanov <paivanof@gmail.com> BUG=75232,52909 TEST=no test fails with message "Function marked as IO-only was called from a thread that disallows IO!" Review URL: https://chromiumcodereview.appspot.com/10540155 Patch from Pavel Ivanov <paivanof@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147309 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-111-1/+0
| | | | | | | | | For context see this thread: https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/RMcVNGjB4II TBR=thakis,pkasting,jam git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146163 0039d316-1c4b-4281-b951-d872f2087c98
* Implement sql::Connection::Raze() in terms of sqlite3_backup API.shess@chromium.org2012-04-061-0/+20
| | | | | | | | | | | | | | | | | | 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
* [sql] WARN_UNUSED_RESULT on Execute().shess@chromium.org2011-12-231-5/+11
| | | | | | | | | | | | | | | | | | Goal is to encourage callers to handle errors, especially in cases like schema changes, where dropped errors can result in broken databases. Many CREATE INDEX calls where ignoring errors rather than checking if the index already existed before creating it. Recoded those to CREATE INDEX IF NOT EXISTS, which is for exactly this purpose. BUG=none TEST=none Review URL: http://codereview.chromium.org/9005036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115725 0039d316-1c4b-4281-b951-d872f2087c98
* AppCache INTERCEPT namespace.michaeln@google.com2011-12-131-0/+6
| | | | | | | | | | | | | | - Add support for a custom CHROMIUM CACHE MANIFEST signature. Other browsers should ignore files with this signature. - Parse intercept namespace entries out of the new CHROMIUM-INTERCEPT manifest section. Other browsers should ignore this entire section. - Store and retrieve the new kind of namespace records in the database layer. - Upgrade existing databases to the new schema. - Look for matches in the new namespaces when handling main and sub resource requests. - Add unit tests. BUG=101565 Review URL: http://codereview.chromium.org/8396013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114151 0039d316-1c4b-4281-b951-d872f2087c98
* Put debugging assertions into sql::Statement.shess@chromium.org2011-12-121-3/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* export StatementRefdpranke@chromium.org2011-11-121-1/+1
| | | | | | | | | | R=tony@chromium.org BUG=103987 TEST=sql_unittests compiles on the webkit win shared builder Review URL: http://codereview.chromium.org/8538031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109753 0039d316-1c4b-4281-b951-d872f2087c98
* build sql as a component - this will help ensure there is only one copydpranke@chromium.org2011-11-101-2/+3
| | | | | | | | | | of sqlite getting linked in. R=rsesek@chromium.org Review URL: http://codereview.chromium.org/8506027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109510 0039d316-1c4b-4281-b951-d872f2087c98
* Move app/sql/* files to sql/ directory.tfarina@chromium.org2011-07-191-0/+387
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