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

Updatable view with calculated column can not be updated by ResultSet

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.6.2, 2.7.2
    • 2.7.3
    • JDBC compatibility
    • None
    • MariaDB Server version 10.5.8
      also tested with MySQL Server version: 5.7.26

    Description

      When a view contains calculated column, the view is still updatable in MariaDb. However the JDBC driver considers this view as not updatable, because JDBC driver incorrectly considers all views that contain columns without database information as not updatable. The ResultSet from this view should be updatable, only the calculated column should not.

      Even if this is not to be supported (yet), the query should fail by throwing more specific SQLFeatureNotSupportedException instead of generic SQLException.

      Please see the example source code.
      Expected result: the database field will be updated
      Actual result: Exception is thrown

      Exception in thread "main" java.sql.SQLException: ResultSet cannot be updated. The result-set contains fields without without any database information
      	at org.mariadb.jdbc.internal.com.read.resultset.UpdatableResultSet.checkUpdatable(UpdatableResultSet.java:317)
      	at org.mariadb.jdbc.internal.com.read.resultset.UpdatableResultSet.updateString(UpdatableResultSet.java:420)
      	at org.mariadb.jdbc.internal.com.read.resultset.UpdatableResultSet.updateString(UpdatableResultSet.java:430)
      	at TestMariaDbUpdateView.main(TestMariaDbUpdateView.java:24)
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            janci Tomas Janco
            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.