Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-37449

Metadata request behaviour change after upgrading from 11.4.7 to 11.4.8

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 11.4.8
    • N/A
    • Server
    • Not for Release Notes

    Description

      We noticed metadata request behaviour change after upgrading from 11.4.7 to 11.4.8

      When a column has no default value:

      11.4.7 resultSet.getString("COLUMN_DEF") returns null
      11.4.8 resultSet.getString("COLUMN_DEF") returns "NULL" (string)

      JDBC driver version - 3.5.5

      @Test
      public void testDefault() throws SQLException {
          var dataSource = DATA_SOURCE;
          var connection = dataSource.getConnection();
          var metadata = connection.getMetaData();
          var catalog = connection.getCatalog();
          var schema = connection.getSchema();
       
          try (var resultSet = metadata.getColumns(catalog, schema, TABLE, COLUMN)) {
              resultSet.next();
              var defaultValue = resultSet.getString("COLUMN_DEF");
              assertNull(defaultValue);
              // Passed on 11.4.7
              //
              // FAILED on 11.4.8 because instead of null it returns 'NULL' (string):
              // org.opentest4j.AssertionFailedError:
              // Expected :null
              // Actual   :NULL
          } finally {
              close(connection, dataSource);
          }
      }
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Usenko Igor
              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.