Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-812

getBestRowIdentifier returns incorrect value as SCOPE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.7.0
    • metadata
    • None

    Description

      According to documentation SCOPE field of the resultset may contain DatabaseMetaData.bestRowTemporary,
      DatabaseMetaData.bestRowTransaction, DatabaseMetaData.bestRowSession values only. Looking in the [code|
      But https://github.com/mariadb-corporation/mariadb-connector-j/blob/a5c414d35813c683fdbbb46e9d2ad6149315c88e/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L1071] one can see that DatabaseMetaData.bestRowUnknown is always returned in this field, which is valid value for the PSEUDO_COLUMN field, but not for the SCOPE. Btw, comments to the code method say the same. Also bestRowUnknown has the same value as one of bestRowTemporary. So, in fact applications read it not as bestRowUnknown, but bestRowTemporary.
      The value for PSEUDO_COLUMN is 1. It corresponds bestRowNotPseudo, but does not look very nice. And maybe the field IS_GENERATED should be considered here.
      Also I am not sure if MUL index columns should be included in the resultset. At first look - it should not. Mixing unique and primary indexes columns does look quite correct, but is rather harmless

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              Lawrin Lawrin Novitsky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.