Skip to content

Commit

Permalink
[CONJ-642] correcting test when not rewritable and option option "use…
Browse files Browse the repository at this point in the history
…BulkStmts" not set
  • Loading branch information
rusher committed Sep 3, 2018
1 parent 89c9e5d commit e7c0940
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/test/java/org/mariadb/jdbc/PreparedStatementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,23 @@

package org.mariadb.jdbc;

import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.sql.*;

import static org.junit.Assert.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLSyntaxErrorException;
import java.sql.Statement;
import java.sql.Types;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;

public class PreparedStatementTest extends BaseTest {
private static final int ER_NO_SUCH_TABLE = 1146;
Expand Down Expand Up @@ -353,7 +361,7 @@ private void testRewriteMultiPacket(boolean notRewritable) throws SQLException {
int[] results = pstmt.executeBatch();
assertEquals(2, results.length);
for (int result : results) {
if (!notRewritable || (isMariadbServer() && minVersion(10,2))) {
if (!notRewritable || (isMariadbServer() && minVersion(10,2) && sharedOptions().useBulkStmts)) {
assertEquals(Statement.SUCCESS_NO_INFO, result);
} else {
assertEquals(1, result);
Expand Down

0 comments on commit e7c0940

Please sign in to comment.