Bug 37583 - RDBMS store not retrieving revision descriptors correctly.
Summary: RDBMS store not retrieving revision descriptors correctly.
Status: NEW
Alias: None
Product: Slide
Classification: Unclassified
Component: Stores (show other bugs)
Version: Nightly
Hardware: All Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 23:58 UTC by Rob Nielsen
Modified: 2005-11-21 14:58 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Nielsen 2005-11-21 23:58:44 UTC
The successors SQL query in StandardRDBMSAdapter.java appears to be wrong.  If
you perform a load of a store using this class than contains a branch , then try
to make a new branch (ie. you have 1.0, 1.0.1.0, and 1.1 and you try to make
1.0.2.0), you will get an Internal Server Error (500) as it will try to create
1.0.1.0 again.

The issue is in the retrieveRevisionDescriptors() method, line 955
The query is 

"select distinct pvh.REVISION_NO from VERSION_HISTORY vh, VERSION_HISTORY pvh,
VERSION_PREDS vp, URI u where pvh.VERSION_ID = vp.VERSION_ID and vp.VERSION_ID =
vh.VERSION_ID and vh.URI_ID = u.URI_ID and u.URI_STRING = ? and vh.REVISION_NO = ?"

but this will only return the revision_no passed in.  It seems like it should be 

"select distinct pvh.REVISION_NO from VERSION_HISTORY vh, VERSION_HISTORY pvh,
VERSION_PREDS vp, URI u where pvh.VERSION_ID = vp.PREDECESSOR_ID and
vp.VERSION_ID = vh.VERSION_ID and vh.URI_ID = u.URI_ID and u.URI_STRING = ? and
vh.REVISION_NO = ?"

(ie vp.VERSION_ID becomes vp.PREDECESSOR_ID) and this seems to fix the issue.

Steps to reproduce:
checkout file.txt
checkin file.txt
update file.txt /store/history/1/1.0
checkout file.txt
checkin file.txt

<restart slide>

update file.txt /store/history/1/1.0
checkout file.txt
checkin file.txt
<500 internal server error>