[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] WC DB verification triggers

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Thu, 26 May 2011 10:51:05 +0100

On Wed, 2011-05-25 at 06:06 -0400, Greg Stein wrote:
> On May 25, 2011 5:50 AM, "Stefan Sperling" <stsp_at_elego.de> wrote:
> > On Wed, May 25, 2011 at 10:12:42AM +0100, Julian Foad wrote:
> > > We can catch some WC DB inconsistencies as soon as they happen by adding
> > > SQLite "trigger" functions that fire on adding or modifying rows, and
> > > throw an error if some condition is not met. This is especially useful
> > > in the NODES table because of its complex rules.
> > >
> > > This patch is presented as a concept and not to apply as-is. It adds a
> > > couple of very simple checks, with which I caught the bug fixed in
> > > r1127069 and the test-bug fixed in r1127072.
> >
> > I would very much be in favour of adding such checks by default
> > if svn is compiled in maintainer mode!
>
> That was the idea behind wc-checks.sql

In r1127834 I committed an initial version of such checks.

At the moment, this code will unconditionally install the triggers in
any new or upgraded DB. I was planning to make only a debug (maintainer
mode) build do so, but that would have the drawback that we'd then have
two different kinds of WC-NG DB, ones with debugging triggers in them
and ones without, regardless of what build of Subversion is currently
accessing it. Also it would mean bumping the WC format every time we
want to add another trigger or edit an existing one.

It would be better if we could arrange for the checks to be enabled
every time a debug-mode build is running, and disabled every time a
release-mode build is running. Philip suggested I could use "CREATE
TEMPORARY TRIGGER" each time we open the DB instead of installing them
permanently in the DB, so I'm investigating that.

- Julian
Received on 2011-05-26 11:51:42 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.