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

TABLE FUNCTION returning CHAR values does not return a correct value if the Java ResultSet class returns a value less than the length of the defined CHAR.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 10.4.1.3
    • SQL
    • None

    Description

      Defining a column in the returned type as CHAR(10) requires that the returned value be of length 10 characters.

      Defining a table function with a return type of:
      returns TABLE column0 char( 10 ), column1 char( 10 ))
      seems to just return whatever the Java ResultSet implementation handed it.

      My guess this is true for all variable length types, no casting of the value occurs when it is returned to the SQL domain.

      Java single value functions and procedure out parameters do perform any required casting to ensure the value is of the declared type.

      Attachments

        1. rrefcreatefunctionstatement.html
          13 kB
          Richard N. Hillegas
        2. derby-3341-02-aa-refGuide.diff
          1 kB
          Richard N. Hillegas
        3. derby-3341-01-da-coerceWithTests.diff
          21 kB
          Richard N. Hillegas
        4. derby-3341-01-coerce.diff
          13 kB
          Richard N. Hillegas
        5. derby_3341_test.txt
          2 kB
          Daniel John Debrunner

        Issue Links

          Activity

            People

              Unassigned Unassigned
              djd Daniel John Debrunner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: