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

Incorrect method resolution with explicit method signature

    XMLWordPrintableJSON

Details

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

    Description

      If an explicit method signature has Java type that does not match the correct SQL to Java mapping as defined by JDBC, then method resolution seems to try and pick the incorrect method.

      With this example an attempt is made to force an INT procedure parameter to resolve to a java.lang.String, which is not supported. However the engine trys to resolve to a method with an Integr parameter.

      ij> CREATE PROCEDURE SIGNATURE_BUG_1(IN A INT)
      LANGUAGE JAVA PARAMETER STYLE JAVA
      EXTERNAL NAME 'java.lang.System.load(java.lang.String)';
      0 rows inserted/updated/deleted
      ij> CALL SIGNATURE_BUG_1(4);
      ERROR 38000: The exception 'java.lang.NoSuchMethodError: java.lang.System.load(Ljava/lang/Integer;)V' was thrown while evaluating an expression.
      ERROR XJ001: Java exception: 'java.lang.System.load(Ljava/lang/Integer;)V: java.lang.NoSuchMethodError'.

      I believe that the resolution should fail with an illegal conversion error if the supplied Java type is not a match for the SQL type according to JDBC, in this case int or java.lang.Integer.

      Attachments

        1. derby258_20050607.txt
          21 kB
          Daniel John Debrunner

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: