summaryrefslogtreecommitdiffstats
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Add APK targets for sql_unittests and sync_unit_tests.nileshagrawal@chromium.org2012-05-311-2/+29
| | | | | | | | | | | | | BUG=125059 Follow-up to: http://codereview.chromium.org/10399126/ TEST= Review URL: https://chromiumcodereview.appspot.com/10443068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139727 0039d316-1c4b-4281-b951-d872f2087c98
* Revert [SQLite] Hack to touch page cache to debug slow connection close.shess@chromium.org2012-05-191-15/+0
| | | | | | | | | | | | | | | | Original CL http://codereview.chromium.org/7891025 , http://crrev.com/101034 The hypothesis discussed in that CL seems proven out, as the shutdown-hang crashes mostly moved from sqlite3_close() into sqlite3_95527(). BUG=95527 TEST=Monitor crash in bug, see if it changes. Review URL: https://chromiumcodereview.appspot.com/9845034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137989 0039d316-1c4b-4281-b951-d872f2087c98
* Change the way _EXPORT macros look.thakis@chromium.org2012-05-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current setup, if you have a header file my_class.h class BASE_EXPORT MyClass { public: void MyInlineMethod() { /* do stuff, inline */ } }; then every cc file that includes my_class.h will have a public symbol for MyInlineMethod (because inline methods need to be emitted to every translation unit, and the linker sorts them out). With the components build, the linker can't decide to drop these inline methods, so every .so that uses this header file will have the same public symbol. With this proposed change, the symbol will only be visible in the target the header file belongs to, and it will be hidden in all other components. That's cleaner, and it also prevents accident hidden dependencies (say target A depends on B, and B depends on C. A accidentally uses an inline function from a class in C. With this change, that would result in a linker error, and an explicit dependency from A on C would have to be added). Also add a missing CHROMEOS_IMPLEMENTATION define which went unnoticed until now. BUG=90078 TEST=Things still build. TBR=ben, tony, viettrungluu, thestig, agl, willchan Review URL: https://chromiumcodereview.appspot.com/10386108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137130 0039d316-1c4b-4281-b951-d872f2087c98
* RefCounted types should not have public destructors, sql/ and jingle/ editionrsleevi@chromium.org2012-04-282-3/+9
| | | | | | | | | | BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10038045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134456 0039d316-1c4b-4281-b951-d872f2087c98
* Added parameter 'clear_bound_vars', so we could reset the statement without ↵michaelbai@chromium.org2012-04-254-12/+35
| | | | | | | | | | | | | | clearing bound variables, so and current row is reset to the beginning. 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
* Implement sql::Connection::Raze() in terms of sqlite3_backup API.shess@chromium.org2012-04-063-1/+232
| | | | | | | | | | | | | | | | | | 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
* Reset needs_rollback after rollback.michaelbai@chromium.org2012-03-232-1/+11
| | | | | | | | | | | | 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
* Persist SQLite journal files.shess@chromium.org2012-03-171-0/+16
| | | | | | | | | | | | | | | | | The default is DELETE mode, in which the delete commits the transaction. PERSIST keeps the files around, but zeros out the header. journal_mode has been in SQLite since 3.5.9 (2008), so even very old versions of Chromium should interact well. BUG=118470 TEST=none Review URL: http://codereview.chromium.org/9702092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127366 0039d316-1c4b-4281-b951-d872f2087c98
* Making sure all dirs have OWNERS ... add some to sql/.dpranke@chromium.org2012-03-131-0/+3
| | | | | | | | | R=shess@chromium.org, gbillock@chromium.org, erikwright@chromium.org BUG=88315 Review URL: https://chromiumcodereview.appspot.com/9666026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126285 0039d316-1c4b-4281-b951-d872f2087c98
* Create meta table atomically.shess@chromium.org2012-03-082-2/+17
| | | | | | | | | | | | | | | | | | http://crbug.com/111376 happened because a crash between creation and population of the meta table could leave a meta table returning 0 for the version numbers, even though no client ever stored 0 for the versions. This makes creation and population atomic. Additionally, version numbers are restricted to positive values, to prevent this case from being masked in the future. BUG=116306 TEST=none Review URL: http://codereview.chromium.org/9592026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125557 0039d316-1c4b-4281-b951-d872f2087c98
* Add documentation regarding the nestability of sql::Transaction objects.erikwright@chromium.org2012-03-071-1/+4
| | | | | | | | | | | | This is because I wondered if they were nestable, looked here for documentation to that affect, didn't see any, and thus assumed they weren't (I also googled sqlite3 nested transactions and saw that they were not natively supported by the DB - I think that the conclusion I drew is probably the one that most readers would have drawn). BUG=None TEST=Ask a random developer if sql::Transaction transactions may be nested. Review URL: http://codereview.chromium.org/9624006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125448 0039d316-1c4b-4281-b951-d872f2087c98
* Add a DeleteKey() method to delete a key from the meta table. This will be ↵pkasting@chromium.org2012-03-032-41/+44
| | | | | | | | | | | | used in the TemplateURL refactoring changes. Reorder function definitions to match declaration order. Shorten a few bits. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9584031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124823 0039d316-1c4b-4281-b951-d872f2087c98
* Remove operator overloads from Statement.gbillock@chromium.org2012-02-252-9/+5
| | | | | | | | | | | | | Fix leftover users of operators. R=shess@chromium.org BUG=None TEST=sql_unittests,unit_tests Review URL: http://codereview.chromium.org/9433022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123609 0039d316-1c4b-4281-b951-d872f2087c98
* Close out statement refs before closing database.shess@chromium.org2012-02-241-0/+11
| | | | | | | | | | | | | | | | | The existing code DCHECKs that all statement handles are closed, but if any statements handles are open, they have a weak reference which can end up referring to a deallocated Connection instance. Additionally, that change allows the code to reach DeleteSessionCookies() without crashing, so add a guard there. BUG=111376 TEST=fewer crashes. Review URL: http://codereview.chromium.org/9402035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123536 0039d316-1c4b-4281-b951-d872f2087c98
* Clear statement before closing db in cookie code.shess@chromium.org2012-02-172-0/+9
| | | | | | | | | | | | | | | sql::Statement maintains a weak ref to the associated sql::Connection, meaning that if the database and statement are destructed in the wrong order, a use-after-free can result. sql::Statement::Clear() allows resetting the statement to the default-constructed state. BUG=111376 TEST=fewer crashes. Review URL: http://codereview.chromium.org/9418021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122430 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Android build.benm@chromium.org2012-02-101-4/+2
| | | | | | | | | | Android does not have toLower in it's <algorithm>, use StringToLowerASCII instead. Review URL: http://codereview.chromium.org/9384004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121505 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak inside sql::Connection::OpenInternal.benm@chromium.org2012-02-101-1/+2
| | | | | | | | | | | Make sure to close the database even if we failed to open it. BUG=113658 Review URL: http://codereview.chromium.org/9381011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121501 0039d316-1c4b-4281-b951-d872f2087c98
* Create a class to represent a Dom Storage Database.benm@chromium.org2012-02-103-6/+40
| | | | | | | | | | | | | Add a class that can read/write a local storage database in the same format as WebCore's StorageArea. Also add a method to sql::Statement to query the declared type of a column and a method to return a string16 from a Blob. BUG=106763 Review URL: http://codereview.chromium.org/9159020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121442 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
* Update webdata files to take advantage of DLOG(FATAL) ingbillock@chromium.org2011-12-222-1/+6
| | | | | | | | | | | | | sql/Statement and Connection. R=shess@chromium.org BUG= TEST=webdata/*Test*.* Review URL: http://codereview.chromium.org/8966003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115574 0039d316-1c4b-4281-b951-d872f2087c98
* AppCache INTERCEPT namespace.michaeln@google.com2011-12-132-2/+18
| | | | | | | | | | | | | | - 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-129-138/+180
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove 4 static initializers.thakis@chromium.org2011-11-241-1/+4
| | | | | | | | | | | | Most of them caused by gcc 4.4 being not sufficiently smart. BUG=94925 TEST=none TBR=akalin Review URL: http://codereview.chromium.org/8690005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111560 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-107-6/+38
| | | | | | | | | | 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
* [SQLite] Hack to touch page cache to debug slow connection close.shess@chromium.org2011-09-141-0/+14
| | | | | | | | | | | | | | | | | | The shutdown-monitor has noted cases where sqlite3_close() is taking a very long time to finish. In reviewing the code, writes are committed before the close is called, so there should be almost no I/O involved (excepting perhaps unlocking the file?). One hypothesis is that the SQLite page cache, which is LRU, may have very old pages which have been paged out. This change touches them all, so if they are paged out the crash should move to this code. BUG=95527 TEST=Monitor crash in bug, see if it changes. Review URL: http://codereview.chromium.org/7891025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101034 0039d316-1c4b-4281-b951-d872f2087c98
* Enable SQLite's secure-delete at runtime so thatphajdan.jr@chromium.org2011-08-091-0/+6
| | | | | | | | | | | we don't need to rely on system SQLite being compiled with specific flags. BUG=22208 Review URL: http://codereview.chromium.org/7552022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96095 0039d316-1c4b-4281-b951-d872f2087c98
* Move app/sql/* files to sql/ directory.tfarina@chromium.org2011-07-1917-15/+2153
| | | | | | | | | | | | | | | | 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
* Remove the comments setting emands and vim tab width and expansion variables.tony@chromium.org2011-07-111-6/+0
| | | | | | | | | | | | | | | | | These were added in r28089 (http://codereview.chromium.org/256059) but are unnecessary bloat for everyone to carry around, even those that don't use emacs or vim. In an earlier change, I added editor config files in src/tools/emacs/ and src/tools/vim/ so users of the appropriate editor can source those instead. BUG=none TEST=none Review URL: http://codereview.chromium.org/7310019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92046 0039d316-1c4b-4281-b951-d872f2087c98
* Add sql/sql.gyp to start building libsql and sql_unittests.rsesek@chromium.org2011-06-301-0/+67
Nothing uses this yet, but is needed to make the changes to buildbot. It only hooks into all.gyp so it can be built. BUG=72317 TEST=sql_unittests Review URL: http://codereview.chromium.org/7281015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91132 0039d316-1c4b-4281-b951-d872f2087c98