Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 1069313004: [sql] Change DoesStuffExist() to work with ScopedErrorIgnorer. (Closed)

Created:
5 years, 8 months ago by Scott Hess - ex-Googler
Modified:
5 years, 8 months ago
Reviewers:
maniscalco
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[sql] Change DoesStuffExist() to work with ScopedErrorIgnorer. This not working was preventing certain corruption-testing tests from being written. Also modified Does{Table,Index,Column}Exist() to reflect that these names are _not_ case sensitive. It is not possible to have distinct tables [Foo] and [foo]. BUG=none Committed: https://crrev.com/92a2ab1f1d0cdff39e6d506c4cb6a80038baeeb3 Cr-Commit-Position: refs/heads/master@{#324337}

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -14 lines) Patch
M sql/connection.h View 1 chunk +3 lines, -3 lines 0 comments Download
M sql/connection.cc View 4 chunks +19 lines, -4 lines 5 comments Download
M sql/connection_unittest.cc View 3 chunks +36 lines, -7 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
Scott Hess - ex-Googler
I guess this makes sense. The case-sensitivity change was because I tried rewriting with a ...
5 years, 8 months ago (2015-04-08 21:17:19 UTC) #2
maniscalco
Thanks for doing this! I've verified that this patch enables me to write a corruption ...
5 years, 8 months ago (2015-04-08 22:40:27 UTC) #3
Scott Hess - ex-Googler
https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode727 sql/connection.cc:727: // This is evidence of a syntax error in ...
5 years, 8 months ago (2015-04-08 22:49:20 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1069313004/1
5 years, 8 months ago (2015-04-08 22:51:26 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 8 months ago (2015-04-09 02:00:00 UTC) #7
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/92a2ab1f1d0cdff39e6d506c4cb6a80038baeeb3 Cr-Commit-Position: refs/heads/master@{#324337}
5 years, 8 months ago (2015-04-09 02:00:55 UTC) #8
maniscalco
https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode727 sql/connection.cc:727: // This is evidence of a syntax error in ...
5 years, 8 months ago (2015-04-09 15:11:08 UTC) #9
maniscalco
https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode728 sql/connection.cc:728: DLOG_IF(FATAL, !ShouldIgnoreSqliteError(rc)) I just realized that ShouldIgnoreSqliteError is not ...
5 years, 8 months ago (2015-04-09 20:40:52 UTC) #10
Scott Hess - ex-Googler
https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode728 sql/connection.cc:728: DLOG_IF(FATAL, !ShouldIgnoreSqliteError(rc)) On 2015/04/09 20:40:52, maniscalco wrote: > I ...
5 years, 8 months ago (2015-04-09 20:46:30 UTC) #11
maniscalco
On 2015/04/09 20:46:30, Scott Hess wrote: > https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc > File sql/connection.cc (right): > > https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode728 ...
5 years, 8 months ago (2015-04-09 21:17:42 UTC) #12
Scott Hess - ex-Googler
On 2015/04/09 21:17:42, maniscalco wrote: > On 2015/04/09 20:46:30, Scott Hess wrote: > > https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc ...
5 years, 8 months ago (2015-04-09 21:29:44 UTC) #13
maniscalco
5 years, 8 months ago (2015-04-09 21:34:32 UTC) #14
Message was sent while issue was closed.
On 2015/04/09 21:29:44, Scott Hess wrote:
> On 2015/04/09 21:17:42, maniscalco wrote:
> > On 2015/04/09 20:46:30, Scott Hess wrote:
> > > https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc
> > > File sql/connection.cc (right):
> > > 
> > >
> https://codereview.chromium.org/1069313004/diff/1/sql/connection.cc#newcode728
> > > sql/connection.cc:728: DLOG_IF(FATAL, !ShouldIgnoreSqliteError(rc))
> > > On 2015/04/09 20:40:52, maniscalco wrote:
> > > > I just realized that ShouldIgnoreSqliteError is not a pure function
since
> it
> > > > calls ScopedErrorIgnorer::ShouldIgnore which modifies the underlying
> > > > errors_ignored_ set.
> > > > 
> > > > In Debug builds, the second argument to DLOG_IF
(ShouldIgnoreSqliteError)
> > will
> > > > be evaluated as expected.
> > > > 
> > > > However, in Release builds, DLOG_IF is replaced with
EAT_STREAM_PARAMETERS
> > and
> > > > so the second argument won't be evaluated, which means that rc will
never
> be
> > > > added to the errors_ignored_ set in Release builds.
> > > > 
> > > > WDYT about pulling the call to ShouldIgnoreSqliteError out of the
DLOG_IF?
> 
> > > I'm
> > > > thinking it would look something like this:
> > > > 
> > > >     const bool should_ignore = ShouldIgnoreSqliteError(rc);
> > > >     ALLOW_UNUSED_LOCAL(should_ignore);
> > > >     DLOG_IF(FATAL, !should_ignore) << "SQL compile error " <<
> > > GetErrorMessage();
> > > 
> > > At this site, OnSqliteError() should call ShouldIgnoreSqliteError().  But
it
> > > does look like the form in that code is maybe usable here:
> > >   if (!ShouldIgnoreSqliteError(err))
> > >     DLOG(FATAL) << "SQL compile error " << GetErrorMessage();
> > > 
> > > The other case won't have that backup.  I can make a CL, but just for my
> info,
> > > are you seeing this actually fail, or just hypothetical?
> > 
> > Actually fail.  Check out the trybot failures on
> > https://codereview.chromium.org/1072093002/ (patch set 4).
> 
> I suspect my change won't fix that, since it's reporting a bunch of failures
> with error 11, so it should be reaching the OnSqliteError() code in there.  Do
> you have an error callback?  The error-ignorer stuff was geared towards
> non-error-callback connections (which is most of them).  I'm not sure where
that
> would take things, like maybe the untracked statements need some
error-callback
> magic, too.
> 
> [The untracked statements are a bit weird, they exist to prevent a particular
> statement-caching problem which I cannot recall the details of.]

Hmm.  Yes, I have an error callback installed.  I'm re-running the trybots with
your patch merged in (https://codereview.chromium.org/1072093002/ patch set 5),
which I think will all pass.

Powered by Google App Engine
This is Rietveld 408576698