[CONJ-385] Calling stored procedure 'call RenewGet(?)' for SELECT result returns no data. Created: 2016-11-04 Updated: 2016-11-06 Resolved: 2016-11-06 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.5.4 |
| Fix Version/s: | 1.5.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Seonmi Anderson | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
AWS Aurora MySQL 5.6 |
||
| Description |
|
I am trying to upgrade maraidb-java-client from 1.4.6 to 1.5.4 to support cluster endpoint but I am not able to upgrade it because calling 'execute(SqlParameterSource)' method in SimpleJdbcCall won't return result as like 1.4.6 does. Here is sample client code that trying to retrieve data from MySSQL stored procedure; SqlParameterSource sqlParameterSource = new MapSqlParameterSource().addValue("id", id); Map<String, Object> out = null; finally {} return (List<Renew>) out.get("items"); It expects output return 'items' that containing result but failed to return data. It is because getUpdateCount() in MariaDBStatement class returns 0 instead of -1 in 1.5.4, so JdbcTemplate won't put the result into output (returnedResult). version 1.5.4; if (executionResult.isSingleExecutionResult()) { return (int) ((SingleExecutionResult) executionResult).getAffectedRows(); } else { return ((MultiExecutionResult) executionResult).getFirstAffectedRows(); } } version 1.4.6 public int getUpdateCount() throws SQLException { if (executionResult == null || executionResult.getResult() != null) { return -1; /* Result comes from SELECT , or there are no more results */ } if (executionResult instanceof SingleExecutionResult) { // same as above }} |
| Comments |
| Comment by Diego Dupin [ 2016-11-06 ] |
|
confirmed : getUpdateCount() for callableStatement return 0 instead of -1 when returning resultset. fixed with commit : https://github.com/MariaDB/mariadb-connector-j/commit/6190081f0106466da40d8181adf6e45f576884c3 |