Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class MysqlConnectionManager extends BaseConnectionManager {

private static final String jdbcUrlTemplate = "jdbc:mysql://${host}:${port}/${db}?useSSL=false&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=CONVERT_TO_NULL&tinyInt1isBit=false";
private static final String jdbcUrlTemplate = "jdbc:mysql://${host}:${port}/${db}?useSSL=false&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=CONVERT_TO_NULL&tinyInt1isBit=false&jdbcCompliantTruncation=false";
private String jdbcUrl;

public MysqlConnectionManager(DBConnectInfo connectInfo, Datasource datasource) {
Expand All @@ -37,7 +37,6 @@ public void ping() throws SQLException {
this.jdbcUrl = url;
}


@Override
public Connection getConnection() throws SQLException {
var conn = super.getConnection();
Expand All @@ -60,13 +59,11 @@ private void setTimeZone(Connection conn) throws SQLException {

String offsetStr = offset.equals(ZoneOffset.UTC) ? "+00:00" : offset.toString();


try (Statement stmt = conn.createStatement()) {
stmt.execute("SET time_zone = '" + offsetStr + "'");
}
}


protected void setSSLProps(Properties props) {
if (this.getConnectInfo().getOptions().get("useSSL") != null
&& (boolean) this.getConnectInfo().getOptions().get("useSSL")) {
Expand Down Expand Up @@ -101,7 +98,6 @@ public String getVersion() throws SQLException {
return (String) result.getData().get(0).get(0);
}


@Override
public String getJDBCUrl() {
return this.jdbcUrl;
Expand All @@ -112,7 +108,6 @@ public String getDisplayJDBCUrl() {
return this.getConnectInfo().toDisplayJDBCUrl(jdbcUrlTemplate);
}


@Override
public String getJDBCUrl(String database) {
return this.jdbcUrl;
Expand Down