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

DatabaseMetaData getDatabaseMajorVersion() and getDatabaseMinorVersion() return software version rather than database version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.6.1.0
    • None
    • JDBC
    • None
    • Newcomer, Release Note Needed
    • Deviation from standard

    Description

      The javadoc for
      DatabaseMetaData.getDatabaseMajorVersion() and getDatabaseMinorVersion() says they should retrieve the version number of the underlying database, so for soft upgraded databases this should be the database format version not the current software version which it currently does. getDatabaseProductVersion should continue to return the current software version.

      To reproduce create a database wombat with 10.1 with ij and then run the program below with 10.5.

      import java.sql.*;

      public class TestDBMetaDatabaseVersion {

      public static void main(String[] args) throws Exception

      { Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:derby:wombat"); DatabaseMetaData dmd = conn.getMetaData(); System.out.println("getDatabaseMajorVersion():" + dmd.getDatabaseMajorVersion()); System.out.println("getDatabaseMinorVersion():" + dmd.getDatabaseMinorVersion()); System.out.println("getDatabseProductVersion():" + dmd.getDatabaseProductVersion()); }

      }

      The output shows:
      getDatabaseMajorVersion():10
      getDatabaseMinorVersion():5
      getDatabseProductVersion():10.5.1.2 - (777744M)

      The first two are incorrect and should show 10.1

      Attachments

        Activity

          People

            Unassigned Unassigned
            kmarsden Katherine Marsden
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: