Skip to content

Commit bb9b11f

Browse files
author
diego Dupin
committed
[misc] test correction
1 parent 69fd0e5 commit bb9b11f

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
allow_failures:
3939
- env: srv=build v=10.6
4040
include:
41-
- env: srv=mariadb v=10.5
41+
- env: srv=mariadb v=10.6
4242
os: windows
4343
language: shell
4444
- env: srv=mariadb v=10.2 local=1

src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ private void postConnectionQueries() throws SQLException {
295295
commands.add("show status like 'wsrep_local_state'");
296296
}
297297

298-
if (!hostAddress.primary && context.getVersion().versionGreaterOrEqual(5, 6, 5)) {
298+
if (hostAddress != null
299+
&& !hostAddress.primary
300+
&& context.getVersion().versionGreaterOrEqual(5, 6, 5)) {
299301
commands.add("SET SESSION TRANSACTION READ ONLY");
300302
}
301303

src/test/java/org/mariadb/jdbc/integration/ConnectionTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -932,20 +932,20 @@ public void localSocket() throws Exception {
932932
&& !System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win"));
933933
Statement stmt = sharedConn.createStatement();
934934
ResultSet rs = stmt.executeQuery("select @@version_compile_os,@@socket");
935-
if (!rs.next()) {
935+
if (!rs.next() || rs.getString(2) == null) {
936936
return;
937937
}
938938
String path = rs.getString(2);
939-
stmt.execute("DROP USER IF EXISTS testSocket@'localhost'");
940-
stmt.execute("CREATE USER testSocket@'localhost' IDENTIFIED BY 'MySup5%rPassw@ord'");
941-
stmt.execute("GRANT SELECT on *.* to testSocket@'localhost' IDENTIFIED BY 'MySup5%rPassw@ord'");
939+
stmt.execute("DROP USER IF EXISTS testSocket");
940+
stmt.execute("CREATE USER testSocket IDENTIFIED BY 'heyPassw!µ20§rd'");
941+
stmt.execute("GRANT SELECT on *.* to testSocket IDENTIFIED BY 'heyPassw!µ20§rd'");
942942
stmt.execute("FLUSH PRIVILEGES");
943943

944-
try (java.sql.Connection connection =
945-
DriverManager.getConnection(
946-
String.format(
947-
"jdbc:mariadb:///%s?user=testSocket&password=%s&localSocket=%s&tcpAbortiveClose&tcpKeepAlive",
948-
sharedConn.getCatalog(), "MySup5%rPassw@ord", path))) {
944+
String url = String.format(
945+
"jdbc:mariadb:///%s?user=testSocket&password=heyPassw!µ20§rd&localSocket=%s&tcpAbortiveClose&tcpKeepAlive",
946+
sharedConn.getCatalog(), path);
947+
System.out.println(url);
948+
try (java.sql.Connection connection = DriverManager.getConnection(url)) {
949949
connection.setNetworkTimeout(null, 300);
950950
rs = connection.createStatement().executeQuery("select 1");
951951
assertTrue(rs.next());
@@ -957,7 +957,7 @@ public void localSocket() throws Exception {
957957
DriverManager.getConnection(
958958
"jdbc:mariadb:///"
959959
+ sharedConn.getCatalog()
960-
+ "?user=testSocket&password=MySup5%rPassw@ord&localSocket=/wrongPath"),
960+
+ "?user=testSocket&password=heyPassw!µ20§rd&localSocket=/wrongPath"),
961961
"Socket fail to connect to host");
962962

963963
if (haveSsl()) {
@@ -967,7 +967,7 @@ public void localSocket() throws Exception {
967967
DriverManager.getConnection(
968968
"jdbc:mariadb:///"
969969
+ sharedConn.getCatalog()
970-
+ "?sslMode=verify-full&user=testSocket&password=MySup5%rPassw@ord"
970+
+ "?sslMode=verify-full&user=testSocket&password=heyPassw!µ20§rd"
971971
+ "&serverSslCert="
972972
+ serverCertPath
973973
+ "&localSocket="
@@ -977,7 +977,7 @@ public void localSocket() throws Exception {
977977
}
978978
}
979979
}
980-
stmt.execute("DROP USER testSocket@'localhost'");
980+
stmt.execute("DROP USER testSocket");
981981
}
982982

983983
@Test

0 commit comments

Comments
 (0)