Derby
  1. Derby
  2. DERBY-195

isSearchable() returns true for a calculated field

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 10.0.2.0
    • Fix Version/s: None
    • Component/s: JDBC
    • Environment:
      Windows XP SP1 Professional
    • Urgency:
      Normal
    • Bug behavior facts:
      Deviation from standard

      Description

      Issuing a ResultSetMetaData isSearchable() against a computing column returns a TRUE value. i.e. SELECT NAME, ADDRESS, 1 FROM EMPLOYEE .... will return a value of TRUE for isSearchable against the computed value (1) in the SELECT list. Is that what is supposed to be returned for a computed column?

      It may be that I misunderstood the semantics for what isSearchable() is supposed to do. I thought that a column with isSearchable()=true can be used in a subsequent WHERE clause.

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Closing this bug report with resolution Not A Problem on the assumption that returning true is OK in this situation. If we find information that suggests otherwise, it should be reopened.

        Show
        Knut Anders Hatlen added a comment - Closing this bug report with resolution Not A Problem on the assumption that returning true is OK in this situation. If we find information that suggests otherwise, it should be reopened.
        Hide
        Knut Anders Hatlen added a comment -

        One more data point: MySQL and PostgreSQL always return true when isSearchable() is called.

        I haven't been able to find anything more specific in the JDBC spec than this sentence in isSearchable()'s javadoc: "Indicates whether the designated column can be used in a where clause." I haven't found what "can be used in a where clause" means exactly.

        Strictly speaking, the column 1 can be used in a where clause. For example:

        SELECT * FROM T WHERE 1=1

        or

        SELECT * FROM T WHERE X < 1

        Would it make sense to close this bug for now, and rather reopen it if someone can point us to where the standard says it should return false in this case?

        Show
        Knut Anders Hatlen added a comment - One more data point: MySQL and PostgreSQL always return true when isSearchable() is called. I haven't been able to find anything more specific in the JDBC spec than this sentence in isSearchable()'s javadoc: "Indicates whether the designated column can be used in a where clause." I haven't found what "can be used in a where clause" means exactly. Strictly speaking, the column 1 can be used in a where clause. For example: SELECT * FROM T WHERE 1=1 or SELECT * FROM T WHERE X < 1 Would it make sense to close this bug for now, and rather reopen it if someone can point us to where the standard says it should return false in this case?
        Hide
        Mike Matrigali added a comment -

        Triaged July 10, 2009: assigned normal urgency.
        marked deviation from standard, work on the issue needs to figure out what the right
        behavior is, and if it is indeed a standard issue.

        Show
        Mike Matrigali added a comment - Triaged July 10, 2009: assigned normal urgency. marked deviation from standard, work on the issue needs to figure out what the right behavior is, and if it is indeed a standard issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            George Baklarz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development