From 219f5ebf8fca3572d8d4265d78d0e4670ca35a27 Mon Sep 17 00:00:00 2001
From: Peter Wemm <peter@FreeBSD.org>
Date: Thu, 20 Feb 2014 19:26:10 +0000
Subject: Vendor import svn-1.8.8

---
 subversion/libsvn_wc/wc-queries.sql | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'subversion/libsvn_wc/wc-queries.sql')

diff --git a/subversion/libsvn_wc/wc-queries.sql b/subversion/libsvn_wc/wc-queries.sql
index d275a7bada0ad..a8388a3a2892a 100644
--- a/subversion/libsvn_wc/wc-queries.sql
+++ b/subversion/libsvn_wc/wc-queries.sql
@@ -1565,10 +1565,15 @@ WHERE wc_id = ?1
 
 -- STMT_SELECT_MOVED_PAIR3
 SELECT local_relpath, moved_to, op_depth, kind FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3
+  AND moved_to IS NOT NULL
+UNION ALL
+SELECT local_relpath, moved_to, op_depth, kind FROM nodes
 WHERE wc_id = ?1
-  AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+  AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth > ?3
   AND moved_to IS NOT NULL
+ORDER BY local_relpath, op_depth
 
 -- STMT_SELECT_MOVED_OUTSIDE
 SELECT local_relpath, moved_to, op_depth FROM nodes
-- 
cgit v1.2.3

