Revision 7397
Added by ben leinfelder about 12 years ago
src/edu/ucsb/nceas/metacat/QuerySpecification.java | ||
---|---|---|
272 | 272 |
{ |
273 | 273 |
String allowQuery = null; |
274 | 274 |
String allowString = constructAllowString(); |
275 |
allowQuery = "SELECT id.docid from xml_access xa, identifier id WHERE id.guid = xa.guid AND ( " + allowString; |
|
275 |
allowQuery = "SELECT id.docid from xml_access xa, identifier id, xml_documents xmld " + |
|
276 |
"WHERE id.guid = xa.guid AND id.docid = xmld.docid AND id.rev = xmld.rev AND ( " + allowString; |
|
276 | 277 |
allowQuery = allowQuery + ")"; |
277 |
allowQuery = allowQuery + " AND id.rev = (select max(rev) from identifier maxid WHERE maxid.docid = id.docid)"; |
|
278 | 278 |
logMetacat.info("QuerySpecification.createAllowRuleQuery - allow query is: " + allowQuery); |
279 | 279 |
return allowQuery; |
280 | 280 |
|
... | ... | |
320 | 320 |
{ |
321 | 321 |
String denyQuery = null; |
322 | 322 |
String denyString = constructDenyString(); |
323 |
denyQuery = "SELECT id.docid from xml_access xa, identifier id WHERE id.guid = xa.guid AND ( " + denyString; |
|
323 |
denyQuery = "SELECT id.docid from xml_access xa, identifier id, xml_documents xmld " + |
|
324 |
"WHERE id.guid = xa.guid AND id.docid = xmld.docid AND id.rev = xmld.rev AND ( " + denyString; |
|
324 | 325 |
denyQuery = denyQuery + ") "; |
325 |
denyQuery = denyQuery + " AND id.rev = (select max(rev) from identifier maxid WHERE maxid.docid = id.docid)"; |
|
326 | 326 |
logMetacat.info("QuerySpecification.createDenyRuleQuery - denyquery is: " + denyQuery); |
327 | 327 |
return denyQuery; |
328 | 328 |
|
Also available in: Unified diff
remove the max(rev) clause in favor of a more straight-forward join to xml_documents (that will have the max rev). http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5696