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

getProcedureColumns doesn't handle escaping in patterns correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 10.9.1.0
    • None
    • JDBC
    • None
    • Normal

    Description

      When querying the procedure columns, according to the JDBC standard pattern characters are escaped, like _ and % if necessary. The escape character is here taken from the function getSearchStringEscape(), which returns "\". The problem is, that derby doesn’t seem to accept the escaping in case of _ (underscore), and uses the escape characters within the match which leads to the situation that the stored proc is not found (Exception thrown)

      Example:

      We have a stored procedure MY_PROC.

      getConnection ().getMetaData ().getProcedureColumns (null, null, ”MY
      _PROC” ,"%") => Stored proc is not found

      getConnection ().getMetaData ().getProcedureColumns (null, null, ”MY_PROC” ,"%") => Stored proc is found

      The first case is the problem, as the _ needs escaping. For the second case it works, even though theoretically also procedures called MY-PROC, MY+PROC, MYXPROC would match.

      http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              steffen.lutter Steffen Lutter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: