You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/05/24 13:06:12 UTC

svn commit: r1342195 - /subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Author: rhuijben
Date: Thu May 24 11:06:12 2012
New Revision: 1342195

URL: http://svn.apache.org/viewvc?rev=1342195&view=rev
Log:
Following up on r1341889, fix an ordering problem in the changelist
notifications introduced by adding a primary key on the temporary
table.

We really want to notify the removal from a changelist before the notification
of adding it to the new one.
(Unless we would want to change behavior and only show a single list).

Found by the ruby testsuite.

* subversion/libsvn_wc/wc-queries.sql
  (changelist_list): Update primary key, to order them correctly on insert.
  (STMT_SELECT_CHANGELIST_LIST): Ask for the records in the right order.
    wc-queries-test.c ensures that this doesn't cost anything for us, as
    the table is pre-sorted.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1342195&r1=1342194&r2=1342195&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu May 24 11:06:12 2012
@@ -403,7 +403,8 @@ CREATE TEMPORARY TABLE changelist_list (
   local_relpath TEXT NOT NULL,
   notify INTEGER NOT NULL,
   changelist TEXT NOT NULL,
-  PRIMARY KEY (wc_id, local_relpath, notify)
+  /* Order NOTIFY descending to make us show clears (27) before adds (26) */
+  PRIMARY KEY (wc_id, local_relpath, notify DESC)
 )
 
 /* Create notify items for when a node is removed from a changelist and
@@ -441,7 +442,7 @@ DROP TABLE IF EXISTS targets_list
 -- STMT_SELECT_CHANGELIST_LIST
 SELECT wc_id, local_relpath, notify, changelist
 FROM changelist_list
-ORDER BY wc_id, local_relpath
+ORDER BY wc_id, local_relpath ASC, notify DESC
 
 -- STMT_CREATE_TARGETS_LIST
 DROP TABLE IF EXISTS targets_list;