0
Commit Graph

46 Commits

Author SHA1 Message Date
Avi Drissman
5deced7586 Migrate to OS_MAC and OS_APPLE in sql
Bug: 1105907
Change-Id: Icecf8ad743a7431ae5cb3ec2cf1c8e88262b8eb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324894
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792874}
2020-07-29 21:24:58 +00:00
Victor Costan
02bf6b6da3 sqlite: Add tests covering ICU functionality.
The last remaining SQLite patch is
0001-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data. This CL adds
tests ensuring that SQLite uses ICU, creating a safety net for the
removal of the SQLite patch.

Bug: 945204
Change-Id: I2b5661d78fcd00e7c088fc234eeef0f981f2bb62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621845
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661968}
2019-05-21 23:27:27 +00:00
Sergey Ulanov
7de7e9f3ab [Fuchsia] Use unix-none VFS for sqlite
Previously unix-dotlock VFS was used by default on Fuchsia. dotlock
creates .lock directory to lock files. It doesn't work correctly because
the lock is not removed if the process dies before releasing the lock.

On Fuchsia profile directories are not expected to be shared between
processes, so cross-process file locks are not necessary.

This CL switches Chromium's VFS wrapper to use unix-none as a base VFS
(which uses no-op locking) and adds custom in-process locking for
Fuchsia in the wrapper.

Bug: 936672
Change-Id: Ibb0a84ba0e540b21551d5f174ec32f0d9077cf98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504048
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639257}
2019-03-09 00:41:02 +00:00
Victor Costan
7e74dcebc6 mac: Rework logic for excluding files from Time Machine backups.
This CL:
1) Re-enables MacUtilTest.TestExcludeFileFromBackups, which was disabled
   due to failures on a bot that does not exist anymore.
2) Extracts the logic used to check base::mac::SetFileBackupExclusion()
   into base::mac::GetFileBackupExclusion(). This logic was duplicated
   in tests.
3) Uses the approach in //sql for converting a base::FilePath into the
   CFURLRef needed by CSBackup{Is,Set}ItemExcluded. This approach does
   not rely on an autorelease pool. The conversion logic is extracted in
   base::mac::FilePathToCFURL().

Change-Id: I6ed2a3ded285e6904dccf7e21ade7ff5f68167a2
Reviewed-on: https://chromium-review.googlesource.com/c/1438035
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626702}
2019-01-28 20:15:25 +00:00
Victor Costan
4f03013104 sqlite: Remove custom PRAGMA auto_vacuum_slack_pages.
SQLite patch 0007-Allow-auto-vacuum-to-work-with-chunks.patch
introduces a PRAGMA that is not used outside of tests. The PRAGMA was
added for an experiment that was discontinued, referenced on the bug
above.

This CL removes the patch and the associated tests, reducing the total
amount of patches we carry on top of SQLite.

No functional changes are expected, because the patch is inert in
production. Specifically, the newly introduced autoVacuumSlack member of
the BtShared structure is zero-initialized by default, and can only be
changed by issuing the auto_vacuum_slack_pages PRAGMA. The new btree
code is gated by an if (... && pBt->autoVacuumSlack). The PRAGMA is not
used outside of testing.

Bug: 698010
Change-Id: Id2a40badccb96389c6ff9ce1780ffa703dedce6c
Reviewed-on: https://chromium-review.googlesource.com/c/1362222
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613782}
2018-12-05 00:30:08 +00:00
Victor Costan
e3d9c4b6d6 Revert "sqlite: Disable mmap usage on Windows."
This reverts commit 7202f4dc1f.

Reason for revert: CL is only needed in 72.0.3620.0 Windows Canary to diagnose SQLite crashes.

Original change's description:
> sqlite: Disable mmap usage on Windows.
>
> This is an experiment to see if the crashes in the referenced bug are
> related to mmap changes on Windows. This CL will be reverted after it
> goes live in 1-2 canaries.
>
> TBR=cmumford
>
> Bug: 897576
> Change-Id: Ic44836c4ed848f8713d16b553f038c63119f0aaf
> Reviewed-on: https://chromium-review.googlesource.com/c/1348736
> Commit-Queue: Victor Costan <pwnall@chromium.org>
> Reviewed-by: Victor Costan <pwnall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#610551}

TBR=cmumford@chromium.org,pwnall@chromium.org

Change-Id: I4d79a63c2a428e1e8ab04143a4d8280e274db1fd
Bug: 897576
Reviewed-on: https://chromium-review.googlesource.com/c/1349789
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610700}
2018-11-24 09:07:40 +00:00
Victor Costan
7202f4dc1f sqlite: Disable mmap usage on Windows.
This is an experiment to see if the crashes in the referenced bug are
related to mmap changes on Windows. This CL will be reverted after it
goes live in 1-2 canaries.

TBR=cmumford

Bug: 897576
Change-Id: Ic44836c4ed848f8713d16b553f038c63119f0aaf
Reviewed-on: https://chromium-review.googlesource.com/c/1348736
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610551}
2018-11-23 08:42:23 +00:00
Victor Costan
cfbfa60d86 sql: Rename sql::Connection to sql::Database.
sql::Connection represents an opened SQLite database. Pedantically, the
name is correct. At the same time, it is inconsistent with the naming
convention of similar software -- IndexedDB, LevelDB, and WebSQL all use
a derivative of "Database" (IDBDatabase, DB, WindowDatabase) to name
this concept. Furthermore, most sql::Connection instances have names
like "db" and "database".

This CL renames the class to sql::Database, reducing the cognitive load
caused by dissonances like "sql::Connection db_".

TBR=mpearson

Bug: none
Change-Id: I8abf34016bca236b6e38a772f5848e7ea9bf1c59
Reviewed-on: https://chromium-review.googlesource.com/1157876
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579990}
2018-08-01 23:24:46 +00:00
Victor Costan
ce678e7988 sqlite: Create all databases with restrictive permissions.
Chrome's SQLite currently uses permissive (0644) POSIX access controls
for newly created databases, and //sql offers a method for opting into
restrictive (0600) permissions. This method is only used by the login
database. However, all Chrome databases are likely to have private data.
For example, the cookies database may contain long-lived OAuth tokens,
and can be just as valuable as the login database. The same argument
applies for the DOMStorage database.

This CL configures SQLite to use restrictive permissions by default, and
removes the method for opting into the restrictive permissions.

Change-Id: I5f0ce9e7f038081fad515cfc30c45ccccf7ff1b6
Reviewed-on: https://chromium-review.googlesource.com/1146295
Reviewed-by: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577476}
2018-07-24 10:25:00 +00:00
Victor Costan
653b14f24e sql: Enable SQLiteFeaturesTest.TimeMachine
Bug: 410350
Change-Id: I34cbb3572b1b5202ea2400acaafa68eae47809e4
Reviewed-on: https://chromium-review.googlesource.com/1146494
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577221}
2018-07-23 19:32:33 +00:00
Victor Costan
70bedf23c8 sql: Remove references to USE_SYSTEM_SQLITE.
USE_SYSTEM_SQLITE used to be supported on iOS, and now is a no-op.
This CL removes the references to it from //sql, to avoid confusing
readers.

The CL also breaks down an unnecessarily large unit test in
//sql/connection_unittest.cc that happend to be near the changes in this
CL.

Change-Id: I47c324300b54362529364a5ef26ee45b45fe3b76
Reviewed-on: https://chromium-review.googlesource.com/1137921
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576213}
2018-07-18 21:21:14 +00:00
Victor Costan
bd62311a9e sql: Replace NULL with nullptr.
Change-Id: Ie3ad5785f82ccafdbcc630a5a26423ecc0b6c4bc
Reviewed-on: https://chromium-review.googlesource.com/1137846
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575937}
2018-07-18 04:17:27 +00:00
Victor Costan
1d868358c9 sql: Use static const char[] in local variables.
Bug: 855465
Change-Id: I5c87955168ede7f73ab551c364066bde5909fb21
Reviewed-on: https://chromium-review.googlesource.com/1111858
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570481}
2018-06-26 19:06:48 +00:00
Victor Costan
f087c84bfe sqlite: Upgrade from 3.22.0 to 3.23.1.
News: https://sqlite.org/releaselog/3_23_1.html

The 3.23 release includes quite a few nice-to-have bug fixes.

This CL removes
0011-Fix-thread-sanitizer-TSAN-error-when-SQLITE_ENABLE_A.patch
because it is included in the 3.23 code.

Bug: 829893
Change-Id: Ia00c5eb3d2afd6edb5028b26ad6f58df950e8851
Reviewed-on: https://chromium-review.googlesource.com/999745
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554232}
2018-04-27 00:47:50 +00:00
Victor Costan
bc7ab0605f sql: Add feature test for default values on boolean columns in SQLite.
The feature is used by //components/webdata. This test will help make
sure the feature keeps working as we upgrade SQLite.

Bug: 829893
Change-Id: Ie94439e5abd2cad4e0e15bad92ec3af462850b4c
Reviewed-on: https://chromium-review.googlesource.com/1015206
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552419}
2018-04-20 19:03:56 +00:00
tzik
d16d21967c Migrate //sql from base::Callback to base::RepeatingCallback
This updates //sql to use base::RepeatingCallback instead of legacy
base::Callback. No intended functional change is included.

This reduces the number of 'base::Bind' in //sql from 19 to 1
as tracked at http://goo.gl/LUVhDj

Bug: 714018
Change-Id: I4b6b321e25f2b3db7ab7ac3e09d9ee74761db230
Reviewed-on: https://chromium-review.googlesource.com/952116
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541388}
2018-03-07 08:58:36 +00:00
Victor Costan
86ca431198 sqlite: Remove USE_SYSTEM_SQLITE option.
We currently use the system-supplied SQLite library on iOS.

This is not the end of the world, because we require iOS 10.0+, which
means SQLite 3.14+, which has the features that Chrome uses. iOS is also
special in that we don't ship Blink, so we don't expose SQLite via
WebSQL -- we control all the other SQL queries we send to SQLite, so
SQLite security bugs aren't easily exploitable.

At the same time, USE_SYSTEM_SQLITE means Chrome for iOS uses an
entirely different SQLite build that most developers don't run. This
makes it more likely that we'll introduce bugs or crashes, and makes it
more difficult to investigate existing bugs/crashes.

In theory, USE_SYSTEM_SQLITE seems appealing on Android and Linux. In
practice, the idea isn't workable on either platform.

* On Android, not shipping our own SQLite would cut down APK size by a few
  hundred KB. However, Android doesn't have a great upgrade story before
  Lollipop (5.0), and we still support KitKat (4.4). SQLite is exposed
  via WebSQL on Android, so we must be in control of SQLite upgrades.

* Linux distributions would like to ship Chromium builds linked against
  their SQLite copies. However, https://crbug.com/807487 suggests that
  USE_SYSTEM_SQLITE on Linux would result in unacceptable stability. The
  root cause of the bug was that NSS can load SQLite on Linux, resulting
  in SQLite getting initialized outside our control. Even if we could
  fix that bug (via a dependency from //crypto to //sql), we'd still
  have to chase all the libraries that might potentially initialize
  SQLite. Today we believe that NSS is the only library in that set, but
  we simply don't have the bandwidth to justify investigating the bug
  reports that will come if we miss something.

In conclusion, there is no platform where USE_SYSTEM_SQLITE is desirable
and viable. So, this CL removes USE_SYSTEM_SQLITE from the codebase.
This will cause the iOS build to increase by a few hundred KB. This
price buys us one less difference between iOS and every other platform,
and increased OS stability in the long run, as iOS bugs / crashes will
be easier to diagnose.

Bug: 22208, 299684, 372584, 807093, 807487
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-device
Change-Id: I1bd64bd93527624e197bd082c725a952c8b3c430
Reviewed-on: https://chromium-review.googlesource.com/898223
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535148}
2018-02-07 21:34:10 +00:00
Victor Costan
42988a99a3 sqlite: Remove special cases handling for iOS 9 and below.
Chrome currently only supports iOS10 and above. iOS 10 ships with SQLite
3.14.0+, so we can remove some special case handling (and cognitive
burden) needed to support older iOS versions.

Bug: 807093
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-device
Change-Id: I5d19af5eeaffdf587fb43216fc9cf97e9297d15b
Reviewed-on: https://chromium-review.googlesource.com/898564
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534591}
2018-02-06 02:22:14 +00:00
Scott Graham
47ed2c3f20 Remove references to MOJO_APPTEST_IMPL in sql/
Noticed while porting sql_unittests to Fuchsia. Seems to be dead code.

Bug: 764423
Change-Id: Ibe238f3674a3b7fbcf9dfd4e98d23052f6161e12
Reviewed-on: https://chromium-review.googlesource.com/665349
Reviewed-by: Elliot Glaysher <erg@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502134}
2017-09-15 02:17:07 +00:00
Scott Graham
502836c852 fuchsia: Disable sqlite tests that require shm in vfs
Dot-file locking (which we're currently using on Fuchsia) specifies
"version 1" of VFS. This doesn't include SHM functions, so disable the
mmap-requiring tests.

Bug: 764423
Change-Id: I2bb24f4130bebdb3371aca4ee4169dd573d9cbb1
Reviewed-on: https://chromium-review.googlesource.com/665301
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502096}
2017-09-14 23:26:23 +00:00
shess
f7fcc45c7c [sql] Verify control of close-time WAL checkpoint.
SQLite WAL mode by default checkpoints the WAL to the main database at
close time.  Chromium closes databases at shutdown, which causes
shutdown slowdowns due to buffered data being flushed.  WAL
checkpointing would effectively increase the amount of buffered data
being flushed.

[WAL mode is currently not in use by Chromium.]

BUG=675264

Review-Url: https://codereview.chromium.org/2827673006
Cr-Commit-Position: refs/heads/master@{#465772}
2017-04-19 22:10:41 +00:00
shess
e812793e45 [sql] SQLite patch to implement "smart" auto-vacuum.
SQLITE_FCNTL_CHUNK_SIZE can advise the VFS to resize files in quantum
amounts, to reduce fragmentation from tiny appends.  This change allows
a new PRAGMA auto_vacuum_slack_pages to provide auto_vacuum with a hint
to only rearrange pages when an entire quantum can be released.

BUG=698010

Review-Url: https://codereview.chromium.org/2732553002
Cr-Commit-Position: refs/heads/master@{#459847}
2017-03-27 19:16:10 +00:00
shess
5f2c344add [sql] Move time-machine support from third_party/sqlite to sql/
Chromium's SQLite was modified to propagate OSX Time-Machine exclusions
from the main database file to any associated journal files.
Re-implement this using a VFS which wraps the default VFS and makes the
check when opening journal files.

BUG=679941

Review-Url: https://codereview.chromium.org/2623083002
Cr-Commit-Position: refs/heads/master@{#445601}
2017-01-24 02:15:10 +00:00
shess
001ae16f05 [sql] Verify regexp not cached with prepared statement.
When the bug was logged, SQLite had a flaw where the regular
expression (Y in X REGEXP Y or REGEXP(Y,X)) effectively had the
compiled results cached with the prepared statement.  At some point
Chromium pulled a version of SQLite which fixed this, this test
verifies that the SQLite currently in use has the fix.

BUG=248608
TBR=nyquist@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2440653002
Cr-Commit-Position: refs/heads/master@{#426398}
2016-10-20 04:07:16 +00:00
rohitrao
83d6b83a93 Updates SQL code now that mmap is supported on iOS.
BUG=621065
TEST=None

Review-Url: https://codereview.chromium.org/2083543003
Cr-Commit-Position: refs/heads/master@{#400915}
2016-06-21 07:27:36 +00:00
avi
0b519209e6 Switch to standard integer types in xxx/.
BUG=138542
TBR=shess@chromium.org

Review URL: https://codereview.chromium.org/1533283002

Cr-Commit-Position: refs/heads/master@{#366346}
2015-12-21 07:26:18 +00:00
shess
53adf16ef2 [sql] Test mmap operation based on SQLite capabilities.
The mmap mitigation for bug 537742 meant that the test wasn't running in
cases where mmap could potentially be enabled but wasn't enabled by
default.  Change the test to instead run when the platform allows SQLite
mmap to be enabled.

Add a test to verify that mmap cannot be enabled in cases where it is
expected not to work, so that platforms must make an explicit decision
about whether to allow mmap.

BUG=537742, 554269

Review URL: https://codereview.chromium.org/1529693002

Cr-Commit-Position: refs/heads/master@{#365904}
2015-12-17 22:08:06 +00:00
erg
102ceb4133 mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage.
This adds a //sql/mojo library which can be linked into preexisting
sqlite3 code which adds a new VFS which transparently proxies filesystem
usage to the mojo:filesystem application.

We create a new sql_apptests.mojo target, which currently has all the
sql connection_unittests.cc (minus 2 hard ones), all statement and
transaction unit tests and refactor the sql testing stuff so that we
have two implementations of an SQLTestBase class: one that uses files
raw and one that proxies to the filesystem process.

Notably, this patch does not implement file locking, which will have to
be implemented before we can safely use this, but will be a large enough
patch in and of itself that I'm punting on it for this patch.

BUG=493311

Review URL: https://codereview.chromium.org/1176653002

Cr-Commit-Position: refs/heads/master@{#335415}
2015-06-20 01:38:55 +00:00
shess
37437cbb43 [sql] Stop building fts2.
Long ago, Chromium used fts2 for history full-text search.  It was
later replaced by fts3, and even later that feature was deleted
entirely.  fts2 is no longer used in the browser at all, so stop
compiling it.

Since SQLite is used by WebSQL, in theory this could affect web
authors, but WebSQL uses an authorizer to allow only specific virtual
table types.  fts2 is not one of those types, I have verified manually
that fts2 tables cannot be created using WebSQL.

BUG=455817

Review URL: https://codereview.chromium.org/999573003

Cr-Commit-Position: refs/heads/master@{#320135}
2015-03-11 20:25:12 +00:00
Scott Hess
dcf1204805 Import SQLite 3.8.7.4.
Ran through the import script in third_party/sqlite/README.Chromium,
including the SQLite test suite.  There are a few pager errors which
are because of a change required for WebDatabase support (documented
in README).

SQLite changes are at http://www.sqlite.org/changes.html , Chromium
previously used 3.7.6.3.

All patches were applied and the results reviewed to make sure
backported patches were safe to remove, and retained patches were still
covering what was necessary.

Keep fts4 disabled, and also the new fts3 virtual table and unicode61
tokenizer.  Once enabled, these are very hard to disable, and there
doesn't seem to be any pressure to enable them.  Other SQLITE_* flags
were reviewed for applicability, none looked essential.

Fixes to Chromium:
 - In recovery.cc, pk_column now follows the documentation.
 - Short garbage files now see SQLITE_NOTADB rather than
   SQLITE_IOERR_SHORT_READ.
   - Adjust to allow clients to use ScopedErrorIgnore without adding
     dependencies.
 - More-specific SQLITE_CONSTRAINT_* errors aren't necessary.
 - Force recovery test to scan table rather than index.

BUG=340757
TEST=*EVERYTHING* continues to work.
R=michaeln@chromium.org

Review URL: https://codereview.chromium.org/901033002

Cr-Commit-Position: refs/heads/master@{#315646}
2015-02-10 21:37:23 +00:00
engedy
be80d53e9b Add SQLite feature test to verify working foreign key support.
This low-level test specifically ensures that foreign key support will not break upon importing a new SQLite version or changing compile-time flags.

BUG=437865

Review URL: https://codereview.chromium.org/856343002

Cr-Commit-Position: refs/heads/master@{#312596}
2015-01-22 09:57:36 +00:00
shess
156733dbbc [sql] Enable HAVE_USLEEP for more platforms.
HAVE_USLEEP affects SQLite's sleep implementation, which is used when
SQLite waits for a lock to clear.  Browser databases are generally
uncontended, but this case could happen for WebDatabase in the renderer.

BUG=none

Review URL: https://codereview.chromium.org/827523004

Cr-Commit-Position: refs/heads/master@{#312460}
2015-01-21 21:53:06 +00:00
shess
355d9a1e3c [sql] Test that a Chromium fts change is actually in place.
In working on a new import of SQLite, I found the patch resulting from:
   http://codereview.chromium.org/14176

This only touches fts2, not fts3.  These tests verify that both versions
work in the way the patch implies.

BUG=340757

Review URL: https://codereview.chromium.org/844443002

Cr-Commit-Position: refs/heads/master@{#310922}
2015-01-10 00:44:03 +00:00
dcheng
1b3b125e90 Standardize usage of virtual/override/final specifiers in sql/.
The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.

BUG=417463

Review URL: https://codereview.chromium.org/817403002

Cr-Commit-Position: refs/heads/master@{#309480}
2014-12-22 23:01:07 +00:00
the_jk
ffdda02dd3 Make FTS2 inclusion in SQLite optional
Only platforms/products that need to support old history files need
FTS2 support in the included SQLite library.

BUG=418082

R=shess@chromium.org
R=michaeln@chromium.org
R=erikwright@chromium.org

Review URL: https://codereview.chromium.org/606033002

Cr-Commit-Position: refs/heads/master@{#298022}
2014-10-03 11:36:35 +00:00
thestig
22dfc40185 Change base/file_utils.h includes to base/files/file_utils.h in gin, google_apis, printing, sql, ui, and webkit.
TBR=jochen@chromium.org,rogerta@chromium.org,shess@chromium.org,ben@chromium.org,jamesr@chromium.org

Review URL: https://codereview.chromium.org/529273002

Cr-Commit-Position: refs/heads/master@{#293479}
2014-09-05 08:35:40 +00:00
thakis@chromium.org
1fb07ac8b7 Add unistd.h include in a file using geteuid().
(Also delete two dead methods in other files.)

BUG=31877
NOTRY=true

Review URL: https://codereview.chromium.org/218133002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260569 0039d316-1c4b-4281-b951-d872f2087c98
2014-03-31 16:46:54 +00:00
shess@chromium.org
526b466671 Remove sql::ErrorDelegate.
API cleanup.  Replaced by ErrorCallback.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/16788002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206299 0039d316-1c4b-4281-b951-d872f2087c98
2013-06-14 04:09:12 +00:00
rsleevi@chromium.org
3dbbf7d631 Linux/ChromeOS Chromium style checker cleanup, sql/ edition.
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
2013-02-06 18:13:53 +00:00
brettw@chromium.org
ea1a3f60aa Move scoped_temp_dir from base to base/files
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
2012-11-16 20:34:23 +00:00
pkotwicz@chromium.org
49dc4f20a2 Remove ref counting on sql::ErrorDelegate
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
2012-10-17 17:41:16 +00:00
rohitrao@chromium.org
e73e8922ac Modify sql unittests to pass on iOS.
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
2012-07-13 18:55:22 +00:00
paivanof@gmail.com
9903468a31 Avoid leaking any files from SQLiteFeaturesTest.
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
2012-06-13 03:31:16 +00:00
rsleevi@chromium.org
60e60dd3c9 RefCounted types should not have public destructors, sql/ and jingle/ edition
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
2012-04-28 08:16:04 +00:00
shess@chromium.org
eff1fa525c Put debugging assertions into sql::Statement.
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
2011-12-12 23:50:59 +00:00
tfarina@chromium.org
f0a54b2f3f Move app/sql/* files to sql/ directory.
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
2011-07-19 18:40:21 +00:00