Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.1.0, 2.1.1
-
None
Description
PreparedStatement st = connection.prepareStatement("delete from temp_t where col1 = ?");
st.setInt(1, 0);
st.addBatch();
st.setInt(1, 1);
st.addBatch();
int[] ints = st.executeBatch();
When I run Batched Queries in 1.6.4 or 2.0.3 I got two results, exactly what I expect;
ints =
When the same code ran in 2.1.0 or 2.1.1
I got unexpected first value -3, so that my array looks like this:
ints = {-3, 1, 1}
In case if newer driver used with Hibernate, we face fail, since it traverse through whole array and throw Exception on negative values - it's in this class
org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts()
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
PreparedStatement st = connection.prepareStatement("delete from temp_t where col1 = ?");
st.setInt(1, 0); st.addBatch(); st.setInt(1, 1); st.addBatch(); int[] ints = st.executeBatch(); When I run Batched Queries in 1.6.4 or 2.0.3 I got two results, exactly what I expect; ints = {1, 1} When the same code ran in 2.1.0 or 2.1.1 I got unexpected first value -3, so that my array looks like this: ints = {-3, 1, 1} In case if newer driver used with Hibernate, we face fail, since it traverse trough whole array and throw Exception on negative values - it's in this class org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts() |
PreparedStatement st = connection.prepareStatement("delete from temp_t where col1 = ?");
st.setInt(1, 0); st.addBatch(); st.setInt(1, 1); st.addBatch(); int[] ints = st.executeBatch(); When I run Batched Queries in 1.6.4 or 2.0.3 I got two results, exactly what I expect; ints = {1, 1} When the same code ran in 2.1.0 or 2.1.1 I got unexpected first value -3, so that my array looks like this: ints = {-3, 1, 1} In case if newer driver used with Hibernate, we face fail, since it traverse through whole array and throw Exception on negative values - it's in this class org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts() |
Fix Version/s | 1.6.5 [ 22628 ] | |
Fix Version/s | 2.1.2 [ 22629 ] |
Component/s | batch [ 14105 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 82543 ] | MariaDB v4 [ 135017 ] |
I believe "return;" after this line
https://github.com/MariaDB/mariadb-connector-j/blob/master/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L222
Could solve the issue, but is it safe - I don't know