Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4714

Clean up some edge-case uses of the BOOLEAN keyword

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.6.1.0
    • 10.7.1.1
    • SQL
    • None
    • 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;

      Attachments

        1. derby-4714-01-aa-cleanup.diff
          3 kB
          Richard N. Hillegas

        Issue Links

          Activity

            People

              rhillegas Richard N. Hillegas
              rhillegas Richard N. Hillegas
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: