summaryrefslogtreecommitdiffstats
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Invoke the iOS hook from TestSuite so each run_all_unittests.cc file does notlliabraa@chromium.org2013-03-151-2/+0
| | | | | | | | | | | | have to remember to install MainHook. BUG=None Review URL: https://chromiumcodereview.appspot.com/12321117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188376 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-1/+1
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Implement sql::Connection::RazeAndClose().shess@chromium.org2013-02-074-69/+255
| | | | | | | | | | | | | | | | | | | 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
* Linux/ChromeOS Chromium style checker cleanup, sql/ edition.rsleevi@chromium.org2013-02-064-8/+8
| | | | | | | | | | | 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
* Add FilePath to base namespace.brettw@chromium.org2013-02-023-4/+7
| | | | | | | 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
* Only HistogramBase is used outside of base/metrics.kaiwang@chromium.org2013-01-231-2/+2
| | | | | | | | | | | | | | So client code of histogram will see a simpler interface. This also makes adding SparseHistogram to existing metrics framework possible. This CL depends on https://codereview.chromium.org/11682003/ So please review that one first. TBR=sky@chromium.org,erikwright@chromium.org BUG=139612 Review URL: https://chromiumcodereview.appspot.com/11615008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178242 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing null pointer dereference.glotov@chromium.org2013-01-172-3/+4
| | | | | | | | | | 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
* Make sql build on Win64jschuh@chromium.org2013-01-111-0/+4
| | | | | | | | | | BUG=166496 BUG=167187 TBR=shess Review URL: https://chromiumcodereview.appspot.com/11860013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176397 0039d316-1c4b-4281-b951-d872f2087c98
* Bake targeted error histogram support directly into sql::Connection.shess@chromium.org2013-01-032-0/+36
| | | | | | | | | | | | 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
* Add diagnostics to debug database open problems.shess@chromium.org2012-12-071-0/+15
| | | | | | | | | | | | | Currently the histograms are binned together for all errors, but knowing open-specific errors is helpful for dealing with problems on open. BUG=159490 Review URL: https://chromiumcodereview.appspot.com/11468024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171862 0039d316-1c4b-4281-b951-d872f2087c98
* Move scoped_temp_dir from base to base/filesbrettw@chromium.org2012-11-164-9/+9
| | | | | | | | | | 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
* Handle cookie-file corruption found during open.shess@chromium.org2012-11-101-1/+8
| | | | | | | | | | | | | | | | | | KillDatabaseErrorDelegate cannot Raze() if the corruption is found while opening the databse, because by the time the callback happens the database has been closed. Add support for setting a flag for the database-opening code to check. Additionally, errors detected when executing or preparing statements were not forwarded to the error delegate, which could let them sneak by without notice. BUG=159490 Review URL: https://chromiumcodereview.appspot.com/11358170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167023 0039d316-1c4b-4281-b951-d872f2087c98
* Make sql::Connection::Raze() more robust against corruptions.shess@chromium.org2012-11-103-21/+63
| | | | | | | | | | | | | | 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-185-28/+135
| | | | | | | | | | | | | 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-175-68/+70
| | | | | | | | | | | | 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
* Remove {base,net}_java dependencies from GYP client targets on Android.pliard@chromium.org2012-09-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | On Android, some GYP client targets were explicitly depending on both the native and Java sides of a library. This removes the dependencies to {base,net}_java and make the native side ('base' and 'net) of these libraries depend on their Java counterpart. On Android it rarely makes sense to depend on a single side of a Java/C++ library. The {base,net}_java can now be considered as "private" targets although GYP does not support this concept unfortunately (AFAICT). Note that I made sure that the resulting APKs' size is unchanged. Additionally, this CL removes 'base_java' (i.e. does not replace it with 'base') from the targets including 'build/apk_test.gypi'. This dependency should not have been there (in the wrong layer) in the first place. It's needed by ChromeNativeTestActivity.java which clients should not know about. BUG=146323 TBR=lipalani,sky,willchan,brettw Review URL: https://chromiumcodereview.appspot.com/10913083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155737 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 152946 - Replace HistoryQuickProvider protobuf-based caching with an ↵ricow@chromium.org2012-08-231-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQLite-based database. The protobuf-based cache was only being read at startup and written at shutdown. (Except that when the cache could not be read at startup the cache would immediately be saved upon private data reconstruction from the History database.) With the new implementation using an SQLite database for the HQP cache the private data will be restored from the cache database at startup and continually updated during normal operation. There is no need to flush or write the cache at shutdown as it is constantly kept up-to-date. Detailed comments about the changes made in this CL can be found in the document shared separately. Previous reviewers: sky, pkasting, shess. BUG=95686, 95876, 131668 TEST=New tests added, old tests updated, all tests pass. To manually verify changes: NOTE: For tests using chrome://omnibox be sure to check the "Show results per provider" and then look at the results for the HistoryQuickProvider. 1) New visits: Type an URL never visited before. Bring up new tab. Start typing the URL or parts of the page title or both and verify that the page is offered as a suggestion. 2) New visits: Type an URL never visited before. Do search using chrome://omnibox. New visit should show. 3) Delete visit: Visit some pages and verify they have been recorded. Bring up history and delete one of the visits. Check via chrome://omnibox that it was deleted. 4) Clear history: Visit some pages. Clear the visit history. Check via chrome://omnibox that none of the visits are still returned by the HQP. 5) Updated site: Create a local page and visit it. Search using chrome://omnibox by page title and verify it can be found. Change the page title dramatically and revisit the page. Verify via chrome://oomnibox that the page can be found by words from the new title. Previously reviewed as: http://codereview.chromium.org/10477018/. 10477018 was reverted due to memory leaks detected by build bots. Review URL: https://chromiumcodereview.appspot.com/10837244 TBR=mrossetti@chromium.org This is causing performance regressions across a range of perf bots. Review URL: https://chromiumcodereview.appspot.com/10872032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152963 0039d316-1c4b-4281-b951-d872f2087c98
* Replace HistoryQuickProvider protobuf-based caching with an SQLite-based ↵mrossetti@chromium.org2012-08-231-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | database. The protobuf-based cache was only being read at startup and written at shutdown. (Except that when the cache could not be read at startup the cache would immediately be saved upon private data reconstruction from the History database.) With the new implementation using an SQLite database for the HQP cache the private data will be restored from the cache database at startup and continually updated during normal operation. There is no need to flush or write the cache at shutdown as it is constantly kept up-to-date. Detailed comments about the changes made in this CL can be found in the document shared separately. Previous reviewers: sky, pkasting, shess. BUG=95686, 95876, 131668 TEST=New tests added, old tests updated, all tests pass. To manually verify changes: NOTE: For tests using chrome://omnibox be sure to check the "Show results per provider" and then look at the results for the HistoryQuickProvider. 1) New visits: Type an URL never visited before. Bring up new tab. Start typing the URL or parts of the page title or both and verify that the page is offered as a suggestion. 2) New visits: Type an URL never visited before. Do search using chrome://omnibox. New visit should show. 3) Delete visit: Visit some pages and verify they have been recorded. Bring up history and delete one of the visits. Check via chrome://omnibox that it was deleted. 4) Clear history: Visit some pages. Clear the visit history. Check via chrome://omnibox that none of the visits are still returned by the HQP. 5) Updated site: Create a local page and visit it. Search using chrome://omnibox by page title and verify it can be found. Change the page title dramatically and revisit the page. Verify via chrome://oomnibox that the page can be found by words from the new title. Previously reviewed as: http://codereview.chromium.org/10477018/. 10477018 was reverted due to memory leaks detected by build bots. Review URL: https://chromiumcodereview.appspot.com/10837244 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152946 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 151419 - Replace HistoryQuickProvider protobuf-based caching with an ↵mrossetti@chromium.org2012-08-141-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQLite-based database. The protobuf-based cache was only being read at startup and written at shutdown. (Except that when the cache could not be read at startup the cache would immediately be saved upon private data reconstruction from the History database.) With the new implementation using an SQLite database for the HQP cache the private data will be restored from the cache database at startup and continually updated during normal operation. There is no need to flush or write the cache at shutdown as it is constantly kept up-to-date. Detailed comments about the changes made in this CL can be found in the document shared separately. Reviewer suggestions: sky: for proper thread usage. Also chrome/browser/ui/ and chrome/browser/visitedlink/. pkasting: for whatever you'd like to check over but please look over the design document shared separately. shess: please take a look at database usage in chrome/browser/history/in_memory_url_cache_database.h/.cc. BUG=95686,95876,131668 TEST=New tests added, old tests updated, all tests pass. To manually verify changes: NOTE: For tests using chrome://omnibox be sure to check the "Show results per provider" and then look at the results for the HistoryQuickProvider. 1) New visits: Type an URL never visited before. Bring up new tab. Start typing the URL or parts of the page title or both and verify that the page is offered as a suggestion. 2) New visits: Type an URL never visited before. Do search using chrome://omnibox. New visit should show. 3) Delete visit: Visit some pages and verify they have been recorded. Bring up history and delete one of the visits. Check via chrome://omnibox that it was deleted. 4) Clear history: Visit some pages. Clear the visit history. Check via chrome://omnibox that none of the visits are still returned by the HQP. 5) Updated site: Create a local page and visit it. Search using chrome://omnibox by page title and verify it can be found. Change the page title dramatically and revisit the page. Verify via chrome://oomnibox that the page can be found by words from the new title. Review URL: https://chromiumcodereview.appspot.com/10477018 TBR=mrossetti@chromium.org Review URL: https://chromiumcodereview.appspot.com/10830297 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151424 0039d316-1c4b-4281-b951-d872f2087c98
* Replace HistoryQuickProvider protobuf-based caching with an SQLite-based ↵mrossetti@chromium.org2012-08-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | database. The protobuf-based cache was only being read at startup and written at shutdown. (Except that when the cache could not be read at startup the cache would immediately be saved upon private data reconstruction from the History database.) With the new implementation using an SQLite database for the HQP cache the private data will be restored from the cache database at startup and continually updated during normal operation. There is no need to flush or write the cache at shutdown as it is constantly kept up-to-date. Detailed comments about the changes made in this CL can be found in the document shared separately. Reviewer suggestions: sky: for proper thread usage. Also chrome/browser/ui/ and chrome/browser/visitedlink/. pkasting: for whatever you'd like to check over but please look over the design document shared separately. shess: please take a look at database usage in chrome/browser/history/in_memory_url_cache_database.h/.cc. BUG=95686,95876,131668 TEST=New tests added, old tests updated, all tests pass. To manually verify changes: NOTE: For tests using chrome://omnibox be sure to check the "Show results per provider" and then look at the results for the HistoryQuickProvider. 1) New visits: Type an URL never visited before. Bring up new tab. Start typing the URL or parts of the page title or both and verify that the page is offered as a suggestion. 2) New visits: Type an URL never visited before. Do search using chrome://omnibox. New visit should show. 3) Delete visit: Visit some pages and verify they have been recorded. Bring up history and delete one of the visits. Check via chrome://omnibox that it was deleted. 4) Clear history: Visit some pages. Clear the visit history. Check via chrome://omnibox that none of the visits are still returned by the HQP. 5) Updated site: Create a local page and visit it. Search using chrome://omnibox by page title and verify it can be found. Change the page title dramatically and revisit the page. Verify via chrome://oomnibox that the page can be found by words from the new title. Review URL: https://chromiumcodereview.appspot.com/10477018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151419 0039d316-1c4b-4281-b951-d872f2087c98
* Make java.gypi export jar path to input_jars_paths variablecjhopman@chromium.org2012-08-091-1/+0
| | | | | | | | | | | | | | | | | Both java.gypi and apk_test.gypi expect the jar path in input_jars_paths. This means that we were specifying the dependence in both 'dependencies' and 'input_jars_paths'. This change makes it so that we don't need that redundancy. Also, make java.gypi use input_jars_paths in its input so that we actually rebuild targets when we should. BUG=136756 Review URL: https://chromiumcodereview.appspot.com/10837143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150850 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream sqlite gyp changes for Android.yfriedman@chromium.org2012-08-062-8/+42
| | | | | | | | | | | 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
* Annotate calls to SQLite functions - they have to be executed on a thread ↵shess@chromium.org2012-07-273-1/+48
| | | | | | | | | | | | | | | | | | | | | | | 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
* GYP changes to get sql and sqlite building on iOS.rohitrao@chromium.org2012-07-241-1/+1
| | | | | | | | | | BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10696219 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148136 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the sqlite errors of content unittests on Androidyongsheng.zhu@intel.com2012-07-241-0/+14
| | | | | | | | | | | | | | | | | | | | | 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
* [sql] Refactor to remove use of const_cast<>.shess@chromium.org2012-07-242-12/+35
| | | | | | | | | | | | | | | 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-183-49/+2
| | | | | | | | | | | | | | | | | | | 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-183-2/+49
| | | | | | | | | | | | | | | | 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
* Modify sql unittests to pass on iOS.rohitrao@chromium.org2012-07-133-7/+13
| | | | | | | | | | BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10702203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146604 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the rest of #pragma once in one big CL.ajwong@chromium.org2012-07-117-7/+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
* Avoid leaking any files from SQLiteFeaturesTest.paivanof@gmail.com2012-06-131-10/+5
| | | | | | | | | | | Patch from Pavel Ivanov <paivanof@gmail.com> BUG=130498 TEST=On Linux /tmp/SQLStatementTest.db-journal is not left after execution. Review URL: https://chromiumcodereview.appspot.com/10542096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141849 0039d316-1c4b-4281-b951-d872f2087c98
* 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