Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.6.2, 2.7.2
-
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) |