Skip to content

Commit eec4e85

Browse files
committed
upgrading for mysql 8 support
1 parent ba863ff commit eec4e85

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ dependencies {
9292

9393
// api files("./lib/jsql/ojdbc6.jar") // for oracle
9494
api "org.xerial:sqlite-jdbc:3.25.2" // for sqlite
95-
api "mysql:mysql-connector-java:6.0.6" // for mysql
95+
api "mysql:mysql-connector-java:8.0.26" // for mysql
9696

9797
// Newer MSSQL connection (THIS DOES NOT WORK)
9898
// api "com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8" // for mssql
@@ -266,6 +266,12 @@ test {
266266
// As our test tends to be io-blocked rather then cpu
267267
// we will run more tests in parallels
268268
maxParallelForks = (Runtime.runtime.availableProcessors() * 2) as int
269+
270+
// We clamp this to 12 threads, because the high volume of SQL test
271+
// can currently cause connection errors on the test servers
272+
if( maxParallelForks > 12 ) {
273+
maxParallelForks = 12;
274+
}
269275
}
270276

271277
// Set up the number of tests per fork

src/main/java/picoded/dstack/connector/jsql/HikaricpUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public static HikariDataSource mysql(GenericConvertMap config) {
217217
}
218218

219219
// Setup the configured connection URL + DB
220-
hconfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
220+
// hconfig.setDriverClassName("com.mysql.cj.jdbc.Driver");
221221

222222
hconfig.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + name);
223223

@@ -233,7 +233,7 @@ public static HikariDataSource mysql(GenericConvertMap config) {
233233
config.getBoolean("cachePrepStmts", true) //
234234
);
235235
hconfig.addDataSourceProperty("prepStmtCacheSize", //
236-
config.getInt("prepStmtCacheSize", 250) //
236+
config.getInt("prepStmtCacheSize", 500) //
237237
);
238238
hconfig.addDataSourceProperty("prepStmtCacheSqlLimit", //
239239
config.getInt("prepStmtCacheSqlLimit", 2048) //
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package picoded.dstack.jsql.mysql;
2+
3+
// Test depends
4+
import picoded.dstack.*;
5+
import picoded.dstack.jsql.*;
6+
import picoded.dstack.connector.jsql.*;
7+
import picoded.dstack.struct.simple.*;
8+
9+
public class JSql_DataObjectMap_Mysql_test extends JSql_DataObjectMap_test {
10+
11+
// To override for implementation
12+
//-----------------------------------------------------
13+
14+
/// Note that this SQL connector constructor
15+
/// is to be overriden for the various backend
16+
/// specific test cases
17+
public JSql jsqlConnection() {
18+
return JSqlTestConnection.mysql();
19+
}
20+
21+
}

0 commit comments

Comments
 (0)