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

Using functions, you can create a LONG VARCHAR value which is longer than the maximum length of a Derby LONG VARCHAR

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix, Repro attached

      Description

      I can create a static method which returns a long String and register this as a function which returns LONG VARCHAR. I am able to invoke this function and create a LONG VARCHAR value which is longer than the maximum length which Derby allows for this datatype (32700 characters).

      It is not clear to me what is supposed to happen in this situation according to the SQL standard. However, the current behavior seems wrong. Here are two possible correct behaviors:

      1) Raise an exception if the user-coded method violates the declared contract of the CREATE FUNCTION statement.

      2) Silently truncate the value returned by the user-coded method.

      There may be a similar problem with methods which return byte[] and which are registered as functions returning (LONG) VARCHAR FOR BIT DATA. However, experiments to test this are blocked by DERBY-3511.

      I will attach a test case demonstrating the problem.

        Attachments

        1. BigStringMaker.java
          0.6 kB
          Rick Hillegas
        2. bigStrings.sql
          0.3 kB
          Rick Hillegas

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: