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

Permit using updatable resultset when fetching

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.1.1
    • metadata, Other
    • None

    Description

      When updating a resultset with fetchsize, query to fetch metadata information will failed with NPE (Statement / PrepareStatement created with explicit ResultSet.CONCUR_UPDATABLE and setting setFetchSize to a value <> 0)

      (ResultSet.CONCUR_UPDATABLE support was introduced in 2.1.0)
      example :

      PreparedStatement preparedStatement = connection.prepareStatement("SELECT id, data1 FROM test_table", ResultSet.FETCH_FORWARD, ResultSet.CONCUR_UPDATABLE);
                  preparedStatement.setFetchSize(2);
                  ResultSet rs = preparedStatement.executeQuery();
                  while (rs.next()) {
                      rs.updateString(2, "another String ");
                      rs.updateRow();
                  }
      

       
      java.lang.NullPointerException
      	at org.mariadb.jdbc.internal.com.read.dao.Results.loadFully(Results.java:316)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.cmdPrologue(AbstractQueryProtocol.java:1626)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:156)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.mariadb.jdbc.internal.logging.ProtocolLoggingProxy.invoke(ProtocolLoggingProxy.java:101)
      	at com.sun.proxy.$Proxy10.executeQuery(Unknown Source)
      	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:341)
      	at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:517)
      	at org.mariadb.jdbc.internal.com.read.resultset.UpdatableResultSet.checkIfUpdatable(UpdatableResultSet.java:184)
      	at org.mariadb.jdbc.internal.com.read.resultset.UpdatableResultSet.<init>(UpdatableResultSet.java:114)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readResultSet(AbstractQueryProtocol.java:1568)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1327)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1277)
      	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:218)
      
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.