Skip to content
Draft
Prev Previous commit
Next Next commit
Review changes
  • Loading branch information
tkyc committed Jan 10, 2024
commit f7fdc56481e794450da01588bda71283d07191ff
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,11 @@ protected static void populateBinaryNullCase() throws SQLException {
* @param charValues
* @throws SQLException
*/
protected static void populateCharNormalCase(String[] charValues, boolean sendStringParametersAsUnicode) throws SQLException {
protected static void populateCharNormalCase(String[] charValues) throws SQLException {
String sql = "insert into " + CHAR_TABLE_AE + " values( " + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?,"
+ "?,?,?," + "?,?,?," + "?,?,?," + "?,?,?" + ")";

String connectionString = TestUtils.addOrOverrideProperty(AETestConnectionString, "sendStringParametersAsUnicode", Boolean.toString(sendStringParametersAsUnicode));
String connectionString = TestUtils.addOrOverrideProperty(AETestConnectionString, "sendStringParametersAsUnicode", Boolean.toString(false));
try (SQLServerConnection con = (SQLServerConnection) PrepUtil.getConnection(connectionString, AEInfo);
SQLServerPreparedStatement pstmt = (SQLServerPreparedStatement) TestUtils.getPreparedStmt(con, sql,
stmtColEncSetting)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static void initValues() throws Exception {
createTable(BINARY_TABLE_AE, cekJks, binaryTable);

createDateTableCallableStatement(cekJks);
populateCharNormalCase(charValues, false);
populateCharNormalCase(charValues);
populateNumericSetObject(numericValues);
populateBinaryNormalCase(byteValues);
populateDateNormalCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void testAEv2Disabled(String serverName, String url, String protocol) thr
String[] values = createCharValues(false);
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(values, false);
populateCharNormalCase(values);
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekJks);
fail(TestResource.getResource("R_expectedExceptionNotThrown"));
} catch (Throwable e) {
Expand Down Expand Up @@ -346,7 +346,7 @@ public void testChar(String serverName, String url, String protocol) throws Exce
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekJks, charTable);
populateCharNormalCase(createCharValues(false), false);
populateCharNormalCase(createCharValues(false));
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekJks);
}
}
Expand All @@ -363,7 +363,7 @@ public void testCharAkv(String serverName, String url, String protocol) throws E
SQLServerStatement stmt = (SQLServerStatement) con.createStatement()) {
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekAkv, charTable);
populateCharNormalCase(createCharValues(false), false);
populateCharNormalCase(createCharValues(false));
testAlterColumnEncryption(stmt, CHAR_TABLE_AE, charTable, cekAkv);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@ void testChars(SQLServerStatement stmt, String cekName, String[][] table, String

switch (testCase) {
case NORMAL:
populateCharNormalCase(values, false);
populateCharNormalCase(values);
break;
case SETOBJECT:
populateCharSetObject(values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ private void testCharAkv(String connStr) throws SQLException {
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekAkv, charTable);
String[] values = createCharValues(false);
populateCharNormalCase(values, false);
populateCharNormalCase(values);

try (ResultSet rs = (stmt == null) ? pstmt.executeQuery() : stmt.executeQuery(sql)) {
int numberOfColumns = rs.getMetaData().getColumnCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public void testParameterMetaDataCacheTrim() throws Exception {
createTable(CHAR_TABLE_AE, cekAkv, charTable);
createTable(NUMERIC_TABLE_AE, cekAkv, numericTable);

populateCharNormalCase(charValues, false);
populateCharNormalCase(charValues);
populateNumeric(numericValues);
populateCharNormalCase(charValues, false);
populateCharNormalCase(charValues);
}
}

Expand All @@ -144,17 +144,17 @@ public void testRetryWithSecureCache() throws Exception {
String[] values = createCharValues(false);
TestUtils.dropTableIfExists(CHAR_TABLE_AE, stmt);
createTable(CHAR_TABLE_AE, cekAkv, charTable);
populateCharNormalCase(values, false);
populateCharNormalCase(values);
if (TestUtils.doesServerSupportEnclaveRetry(con)) {
testAlterColumnEncryption((SQLServerStatement) stmt, CHAR_TABLE_AE, charTable, cekAkv);
}
populateCharNormalCase(values, false);
populateCharNormalCase(values);
}
}

private long timedCharUpdate(String[] values) throws SQLException {
long timer = System.currentTimeMillis();
populateCharNormalCase(values, false);
populateCharNormalCase(values);
return System.currentTimeMillis() - timer;
}

Expand Down