Derby
  1. Derby
  2. DERBY-4714

Clean up some edge-case uses of the BOOLEAN keyword

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.7.1.1
    • Component/s: SQL
    • Labels:
      None
    • Bug behavior facts:
      Deviation from standard

      Description

      The grammar allows almost any datatype to appear in XMLSERIALIZE statements and GRANT/REVOKE EXECUTE ON FUNCTION statements. Right now, the following are legal Derby statements:

      select xmlserialize( a as int ) from t;
      grant execute on function f( int ) to public;
      revoke execute on function f( int ) from public restrict;

      However, you cannot use BOOLEAN in these contexts. The following statements raise parser errors:

      select xmlserialize( a as boolean ) from t;
      grant execute on function f( boolean ) to public;
      revoke execute on function f( boolean ) from public restrict;

      We should be able to use BOOLEAN in these contexts just like other Derby datatypes. This won't actually enable any functionality. It will just make Derby's handling of datatypes more consistent. For instance, the following two statement should both raise a bind-time error because only string types are allowed as targets of the XMLSERIALIZE operator:

      select xmlserialize( a as int ) from t;
      select xmlserialize( a as boolean ) from t;

      And there is no difference between the following statements because Derby does not support overloading of routine signatures today. In fact, the second usage is not even documented in the Reference Guide:

      grant execute on function f to public;
      grant execute on function f( boolean ) to public;

        Issue Links

          Activity

          Hide
          Rick Hillegas added a comment -

          Committed patch at subversion revision 958025.

          Show
          Rick Hillegas added a comment - Committed patch at subversion revision 958025.
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4714-01-aa-cleanup.diff. This cleans up the edge cases. I am running regression tests now.

          Touches the following files:

          ------------

          M java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj

          Allow BOOLEAN in XMLSERIALZE and GRANT/REVOKE EXECUTE ON FUNCTION/PROCEDURE statements.

          ------------

          M java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java
          M java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeDDLTest.java

          Tests to track these syntax changes.

          Show
          Rick Hillegas added a comment - Attaching derby-4714-01-aa-cleanup.diff. This cleans up the edge cases. I am running regression tests now. Touches the following files: ------------ M java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Allow BOOLEAN in XMLSERIALZE and GRANT/REVOKE EXECUTE ON FUNCTION/PROCEDURE statements. ------------ M java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java M java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeDDLTest.java Tests to track these syntax changes.

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development