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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2, 2.7.2
    • Fix Version/s: 2.7.3
    • Component/s: JDBC compatibility
    • Labels:
      None
    • Environment:
      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

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            janci Tomas Janco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: