Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 29A7E4520 for ; Thu, 19 May 2011 12:23:47 +0000 (UTC) Received: (qmail 53026 invoked by uid 500); 19 May 2011 12:23:47 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 53002 invoked by uid 500); 19 May 2011 12:23:47 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 52995 invoked by uid 99); 19 May 2011 12:23:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 May 2011 12:23:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 May 2011 12:23:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B6FC0238890A; Thu, 19 May 2011 12:23:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1124707 - in /subversion/trunk/subversion/libsvn_wc: wc-queries.sql wc_db.c Date: Thu, 19 May 2011 12:23:23 -0000 To: commits@subversion.apache.org From: gstein@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110519122323.B6FC0238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gstein Date: Thu May 19 12:23:23 2011 New Revision: 1124707 URL: http://svn.apache.org/viewvc?rev=1124707&view=rev Log: Add a LIMIT to a query and rename it for clarity. * subversion/libsvn_wc/wc-queries.sql: (STMT_SELECT_ACTUAL_CHILDREN): renamed to ... (STMT_ACTUAL_HAS_CHILDREN): ... this. add a LIMIT 1. * subversion/libsvn_wc/wc_db.c: (op_revert_txn): tweak a couple comments. track STMT rename. Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql subversion/trunk/subversion/libsvn_wc/wc_db.c Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1124707&r1=1124706&r2=1124707&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu May 19 12:23:23 2011 @@ -883,8 +883,10 @@ WHERE wc_id = ?1 AND local_relpath = ?2 UPDATE nodes SET repos_id = ?3, repos_path = ?4 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0 --- STMT_SELECT_ACTUAL_CHILDREN -SELECT 1 FROM actual_node WHERE wc_id = ?1 AND parent_relpath = ?2 +-- STMT_ACTUAL_HAS_CHILDREN +SELECT 1 FROM actual_node +WHERE wc_id = ?1 AND parent_relpath = ?2 +LIMIT 1 -- STMT_INSERT_EXTERNAL INSERT OR REPLACE INTO externals ( Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1124707&r1=1124706&r2=1124707&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original) +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu May 19 12:23:23 2011 @@ -5397,6 +5397,7 @@ op_revert_txn(void *baton, { SVN_ERR(svn_sqlite__reset(stmt)); + /* There was no NODE row, so attempt to delete an ACTUAL_NODE row. */ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_DELETE_ACTUAL_NODE)); SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath)); @@ -5404,9 +5405,9 @@ op_revert_txn(void *baton, if (affected_rows) { /* Can't do non-recursive actual-only revert if actual-only - children exist */ + children exist. Raise an error to cancel the transaction. */ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, - STMT_SELECT_ACTUAL_CHILDREN)); + STMT_ACTUAL_HAS_CHILDREN)); SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath)); SVN_ERR(svn_sqlite__step(&have_row, stmt)); SVN_ERR(svn_sqlite__reset(stmt));