Derby
  1. Derby
  2. DERBY-4031

If NO_GENERATED_KEYS is specified, Statement.getGeneratedKeys should return an empty ResultSet, not null

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3.3.0, 10.4.2.0, 10.5.1.1
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal
    • Issue & fix info:
      Release Note Needed
    • Bug behavior facts:
      Deviation from standard

      Description

      Currently Derby returns null from Statement.getGeneratedKeys() if the statement is prepared or executed with Statement.NO_GENERATED_KEYS. The javadoc says:

      If this Statement object did not generate any keys, an empty ResultSet object is returned.

      so we should return an empty ResultSet for this case. It is not entirely clear what the structure of the ResultSet and ResultSetMetaData should be. I tend to think the following:

      getConcurrency() - inherit from the parent statement
      getStatement() - null

      ResultSetMetaData
      getColumnCount - 0

      an alternative would be to have the ResultSetMetaData match the signature of Identity_Val_local() but I think to return 0 columns makes more sense.

        Issue Links

          Activity

          Kathey Marsden created issue -
          Kathey Marsden made changes -
          Field Original Value New Value
          Link This issue relates to DERBY-4015 [ DERBY-4015 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.5.0.0 [ 12313010 ]
          Myrna van Lunteren made changes -
          Affects Version/s 10.5.1.1 [ 12313771 ]
          Affects Version/s 10.5.0.0 [ 12313010 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Existing Application Impact] [Release Note Needed]
          Knut Anders Hatlen made changes -
          Description Currently Derby returns null from Statement.getGeneratedKeys() if the statement is prepared or executed with Statement.NO_GENERATED_KEYS. The javadoc says:

          If this Statement object did not generate any keys, an empty ResultSet object is returned.

          so we should return an empty ResultSet for this case. It is not entirely clear what the structure of the ResultSet and ResultSetMetaData should be. I tend to think the following:

          getConcurrency() - inherit from the parent statement
          getStatement() - null

          ResultSetMetaData
          getColumnCount - 0


          an alternative would be to have the ResultSetMetaData match the signature of Identity_Val_local() but I think to return 0 columns makes more sense.


































          Currently Derby returns null from Statement.getGeneratedKeys() if the statement is prepared or executed with Statement.NO_GENERATED_KEYS. The javadoc says:

          If this Statement object did not generate any keys, an empty ResultSet object is returned.

          so we should return an empty ResultSet for this case. It is not entirely clear what the structure of the ResultSet and ResultSetMetaData should be. I tend to think the following:

          getConcurrency() - inherit from the parent statement
          getStatement() - null

          ResultSetMetaData
          getColumnCount - 0


          an alternative would be to have the ResultSetMetaData match the signature of Identity_Val_local() but I think to return 0 columns makes more sense.
          Knut Anders Hatlen made changes -
          Urgency Normal
          Kathey Marsden made changes -
          Labels derby_triage10_5_2
          Gavin made changes -
          Workflow jira [ 12451212 ] Default workflow, editable Closed status [ 12801647 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development