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

Re: svn commit: r1129818 - /subversion/trunk/subversion/libsvn_wc/wc-checks.sql

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 31 May 2011 20:35:25 +0100

Johan Corveleyn <jcorvel_at_gmail.com> writes:

>> @@ -54,10 +54,9 @@ CREATE TEMPORARY TRIGGER validation_03 B
>>  WHEN NOT (
>>     (new.op_depth = relpath_depth(new.local_relpath))
>>     OR
>> -    ((SELECT COUNT(*) FROM nodes
>> -      WHERE wc_id = new.wc_id AND op_depth = new.op_depth
>> -        AND local_relpath = new.parent_relpath
>> -      LIMIT 2) == 1)
>> +    (EXISTS (SELECT 1 FROM nodes
>> +              WHERE wc_id = new.wc_id AND op_depth = new.op_depth
>> +                AND local_relpath = new.parent_relpath))
>>   )
>>  BEGIN
>>   SELECT RAISE(FAIL, 'WC DB validity check 03 failed');
>
> I don't know the context, but are you sure this is a non-functional change?
>
> The SELECT COUNT you removed checked for == 1. The EXISTS allows for
>>= 1. So if there are 2 such nodes, the condition you removed would
> have been false, but the one you put in place would be true.

(wc_id, op_depth, local_relpath) is the primary key so the count can
only be zero or one.

-- 
Philip
Received on 2011-05-31 21:36:04 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.