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

Re: svn commit: r1470904 - /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql

From: Paul Burba <ptburba_at_gmail.com>
Date: Thu, 25 Apr 2013 12:27:15 -0400

On Thu, Apr 25, 2013 at 11:58 AM, Paul Burba <ptburba_at_gmail.com> wrote:
> On Wed, Apr 24, 2013 at 6:34 PM, Bert Huijben <bert_at_qqmail.nl> wrote:
>>
>>
>>> -----Original Message-----
>>> From: Bert Huijben [mailto:bert_at_qqmail.nl]
>>> Sent: donderdag 25 april 2013 00:14
>>> To: 'Paul Burba'; 'Subversion Development'
>>> Subject: RE: svn commit: r1470904 -
>>> /subversion/trunk/subversion/libsvn_wc/wc-metadata.sql
>>
>>> > > Which ultimately causes libsvn_wc/upgrade:bump_to_31() to create an
>>> > > INHERITED_PROPS cache for the WC root, albeit and empty one.
>>> > >
>>> > > The tweak I suggest above avoids the root from being selected:
>>> > >
>>> > > SELECT l.wc_id, l.local_relpath FROM nodes as l
>>> > > LEFT OUTER JOIN nodes as r
>>> > > ON l.wc_id = r.wc_id
>>> > > AND r.local_relpath = l.parent_relpath
>>> > > AND r.op_depth = 0 AND l.op_depth = 0
>>> > > AND l.repos_path != ''
>>> >
>>> > ^^^
>>> > This line should have that same effect?
>>> > (Moved from the where to the join to have it apply to all the or clauses
>>> > without having to duplicate it 3 times)
>>> >
>>> > Are you sure that you have that line in your testcase.
>>>
>>> Tested this query and indeed it shows this problem.
>>>
>>> The op-depth checks on the line above it should also be moved to the where
>>> part for all three cases.
>>
>> I tweaked the query further in r1471744.
>
> Hi Bert,
>
> Unfortunately that change is actually worse, because it doesn't catch
> the case where the root of the WC *doesn't* point to the root of the
> repos (and hence requires an INHERITED_PROPS cache). This breaks the
> inherited properties feature.
>
> For example, we checkout some repository subtree with a 1.7 client"
>
> 1.7.10-dev>svn co
> file:///C:/SVN/src-branch-1.7.x/Debug/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-101/A/B
> wc-non-root
> A wc-non-root\lambda
> A wc-non-root\E
> A wc-non-root\E\beta
> A wc-non-root\E\alpha
> A wc-non-root\F
> Checked out revision 9.
>
> 1.7.10-dev>cd wc-non-root
>
> # Note that svn:auto-props is set on the root of the repository:
>
> 1.7.10-dev>svn pg svn:auto-props ^^/
> *.c = svn:eol-style=native
>
> # But your latest query doesn't select the wc root:
>
> SELECT l.wc_id, l.local_relpath FROM nodes as l
> LEFT OUTER JOIN nodes as r
> ON l.wc_id = r.wc_id
> AND r.local_relpath = l.parent_relpath
> WHERE l.op_depth = 0 AND r.op_depth = 0
> AND l.repos_path != ''
> AND ((l.repos_id IS NOT r.repos_id)
> OR (l.repos_path IS NOT (CASE WHEN (r.local_relpath) = '' THEN
> (CASE WHEN (r.repos_path) = '' THEN (l.local_relpath) WHEN
> (l.local_relpath) = '' THEN (r.repos_path) ELSE (r.repos_path) || '/'
> || (l.local_relpath) END) WHEN (r.repos_path) = '' THEN (CASE WHEN
> (r.local_relpath) = '' THEN (l.local_relpath) WHEN
> SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) =
> (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) =
> LENGTH(l.local_relpath) THEN '' WHEN SUBSTR((l.local_relpath),
> LENGTH(r.local_relpath)+1, 1) = '/' THEN SUBSTR((l.local_relpath),
> LENGTH(r.local_relpath)+2) END END) WHEN SUBSTR((l.local_relpath), 1,
> LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN
> LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN (r.repos_path)
> WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/'
> THEN (r.repos_path) || SUBSTR((l.local_relpath),
> LENGTH(r.local_relpath)+1) END END)))
>
> #
> -
>
> 0 row(s) affected in 0.001066 second(s).
>
> # Which means that when we upgrade with a 1.8/1.9-dev client, that
> there is no inherited property cache on the WC root and thus
> disconnected inheritance no longer works:
>
> 1.9.0-dev_at_1475809>cd wc-non-root
>
> 1.9.0-dev_at_1475809>svn st
> ..\..\..\subversion\svn\svn.c:2899: (apr_err=SVN_ERR_WC_UPGRADE_REQUIRED)
> svn: E155036: Please see the 'svn upgrade' command
> ..\..\..\subversion\svn\status-cmd.c:352,
> ..\..\..\subversion\svn\util.c:621,
> ..\..\..\subversion\libsvn_client\status.c:590,
> ..\..\..\subversion\libsvn_wc\status.c:2817,
> ..\..\..\subversion\libsvn_wc\status.c:2723,
> ..\..\..\subversion\libsvn_wc\status.c:270,
> ..\..\..\subversion\libsvn_wc\wc_db.c:8446,
> ..\..\..\subversion\libsvn_wc\wc_db_wcroot.c:687,
> ..\..\..\subversion\libsvn_wc\wc_db_wcroot.c:317:
> (apr_err=SVN_ERR_WC_UPGRADE_REQUIRED)
> svn: E155036: The working copy at
> 'C:\SVN\src-branch-1.7.x\Debug\subversion\tests\cmdline\svn-test-work\working_copies\wc-non-root'
> is too old (format 29) to work with client version '1.9.0-dev (under
> development)' (expects format 31). You need to upgrade the working
> copy first.
>
>
> 1.9.0-dev_at_1475809>svn upgrade
>
> 1.9.0-dev_at_1475809>svn pg svn:auto-props -v ^^/
> Properties on 'file:///C:/SVN/src-branch-1.7.x/Debug/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-101':
> svn:auto-props
> *.c = svn:eol-style=native
>
> 1.9.0-dev_at_1475809>svn pg svn:auto-props ^^/
> *.c = svn:eol-style=native
>
> # We expect the repos root property to show up here!
>
> 1.9.0-dev_at_1475809>svn pg svn:auto-props . --show-inherited-props
>
> 1.9.0-dev_at_1475809>
>
> # Analogous to this:
>
> 1.9.0-dev_at_1475809>svn pg svn:auto-props --show-inherited-props ^^/A/B_at_9
> file:///C:/SVN/src-branch-1.7.x/Debug/subversion/tests/cmdline/svn-test-work/repositories/merge_tests-101
> - *.c = svn:eol-style=native
>
> Just looking at this part of your query:
>
> SELECT l.wc_id, l.local_relpath FROM nodes as l
> LEFT OUTER JOIN nodes as r
> ON l.wc_id = r.wc_id
> AND r.local_relpath = l.parent_relpath
> WHERE l.op_depth = 0 AND r.op_depth = 0
>
> It will *never* select the root of any WC because l.parent_relpath for
> the WC root is NULL right?

Oops, it's an outer join, so

SELECT l.wc_id, l.local_relpath FROM nodes as l
LEFT OUTER JOIN nodes as r
ON l.wc_id = r.wc_id
   AND r.local_relpath = l.parent_relpath

selects, but the WHERE clause filters it out.

--
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba
Received on 2013-04-25 18:27:48 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.