You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Martin Kalén <mk...@apache.org> on 2005/04/05 19:58:51 UTC
CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Greetings developers,
CommonRDBMSAdapter#revokePermission(Connection,Uri,NodePermission) is
broken in CVS [1] since the fix for Bugzilla id #31820 [2].
The applied patch removed the right parenthesis from the SQL string
(all remaining right-parens are in Java only).
SQL statements issued from revokePermission will start like this:
"delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select"
^
...but end like this (example with NULL revision):
"and VERSION_NO IS NULL"
NB the missing right parenthesis at the end of the SQL string.
I have reproduced this with Oracle9 but it should be a consistent
failure for all platforms.
This has also been spotted on the user list. [3]
Could someone please reapply the right parenthesis to the SQL-string
or would you like a patch (if so, unified or context diff?)
or maybe a re-open of the bugzilla issue?
TIA & regards,
Martin
[1] CVS update at 2005-04-05T19:00 GMT+1
[2] http://issues.apache.org/bugzilla/show_bug.cgi?id=31820
[3] http://www.mail-archive.com/slide-user@jakarta.apache.org/msg09999.html
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Posted by Martin Kalén <mk...@apache.org>.
Martin Kalén wrote:
> CommonRDBMSAdapter#revokePermission(Connection,Uri,NodePermission) is
> broken in CVS [1] since the fix for Bugzilla id #31820 [2].
P.S. Usage pattern is direct Slide Kernel integration from Java,
the WebDAV servlet is not used.
I saw some notes in the mail archives that NULL revision was not
expected, but IMO the code should then be removed (not left there
broken).
I would be happy to make a patch also for removal/changes of the
code if you could just advise me of the "endorsed" usage pattern.
Regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Posted by Martin Kalén <mk...@apache.org>.
Stefan Lützkendorf wrote:
> I applied your patch to the CVS HEAD.
Great! Thank you for the fast turn-around.
(And for sparing me the Bugzilla formalities...) ;-)
Cheers,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Posted by Stefan Lützkendorf <lu...@apache.org>.
Hi Martin,
I applied your patch to the CVS HEAD.
Thanks, Stefan
Martin Kalén wrote:
> Martin Kalén wrote:
>
>> CommonRDBMSAdapter#revokePermission(Connection,Uri,NodePermission) is
>> broken in CVS [1] since the fix for Bugzilla id #31820 [2].
>
>
> The attached unified diff fixes this.
>
> Tested with Oracle9i but should apply to all RDBMS
> without explicit override of this method.
>
> Please advice if you would rather like the patch attached in a
> re-opened Bugzilla issue (#31820).
>
> Regards,
> Martin
>
>
> ------------------------------------------------------------------------
>
> Index: src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java,v
> retrieving revision 1.9
> diff -u -r1.9 CommonRDBMSAdapter.java
> --- src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java 30 Oct 2004 13:46:25 -0000 1.9
> +++ src/stores/org/apache/slide/store/impl/rdbms/CommonRDBMSAdapter.java 6 Apr 2005 08:44:24 -0000
> @@ -225,10 +225,18 @@
> if (permission == null) return;
> PreparedStatement statement = null;
> try {
> - NodeRevisionNumber revisionNumber = permission.getRevisionNumber();
> + final NodeRevisionNumber revisionNumber;
> + final String versionNoCriteria;
> +
> + revisionNumber = permission.getRevisionNumber();
> + if (revisionNumber == null) {
> + versionNoCriteria = "IS NULL";
> + } else {
> + versionNoCriteria = "= '" + revisionNumber.toString() + "'";
> + }
> statement =
> connection.prepareStatement(
> - "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select ou.URI_ID from URI ou, URI su, URI au where ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and su.URI_STRING = ? and ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO" + ((revisionNumber == null) ? " IS NULL " : " = '" + revisionNumber.toString() + "'"));
> + "delete from PERMISSIONS where PERMISSIONS.OBJECT_ID in (select ou.URI_ID from URI ou, URI su, URI au where ou.URI_STRING = ? and SUBJECT_ID = su.URI_ID and su.URI_STRING = ? and ACTION_ID = au.URI_ID and au.URI_STRING = ? and VERSION_NO " + versionNoCriteria + ")");
> statement.setString(1, permission.getObjectUri());
> statement.setString(2, permission.getSubjectUri());
> statement.setString(3, permission.getActionUri());
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
--
Stefan Lützkendorf -- luetzkendorf@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
Re: CommonRDBMSAdapter#revokePermission broken in CVS HEAD
Posted by Martin Kalén <mk...@apache.org>.
Martin Kalén wrote:
> CommonRDBMSAdapter#revokePermission(Connection,Uri,NodePermission) is
> broken in CVS [1] since the fix for Bugzilla id #31820 [2].
The attached unified diff fixes this.
Tested with Oracle9i but should apply to all RDBMS
without explicit override of this method.
Please advice if you would rather like the patch attached in a
re-opened Bugzilla issue (#31820).
Regards,
Martin