Skip to content

Commit

Permalink
[CONJ-755] permits to avoid setting session_track_schema with new opt…
Browse files Browse the repository at this point in the history
…ion `trackSchema`
  • Loading branch information
rusher committed Jan 27, 2020
1 parent 38c8a69 commit 39eeb60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,9 @@ private void sendSessionInfos() throws IOException {
StringBuilder sessionOption =
new StringBuilder("autocommit=").append(options.autocommit ? "1" : "0");
if ((serverCapabilities & MariaDbServerCapabilities.CLIENT_SESSION_TRACK) != 0) {
sessionOption.append(", session_track_schema=1");
if (options.trackSchema) {
sessionOption.append(", session_track_schema=1");
}
if (options.rewriteBatchedStatements) {
sessionOption.append(", session_track_system_variables='auto_increment_increment' ");
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/mariadb/jdbc/util/DefaultOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,13 @@ public enum DefaultOptions {
"Permit to get MySQL server key retrieval",
false),
TLS_SOCKET_TYPE(
"tlsSocketType", (String) null, "2.5.0", "Indicate TLS socket type implementation", false);
"tlsSocketType", (String) null, "2.5.0", "Indicate TLS socket type implementation", false),
TRACK_SCHEMA(
"trackSchema",
Boolean.TRUE,
"2.6.0",
"manage session_track_schema setting when server has CLIENT_SESSION_TRACK capability",
false);

private final String optionName;
private final String description;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/mariadb/jdbc/util/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class Options implements Cloneable {
public String localSocketAddress;
public Integer socketTimeout;
public boolean allowMultiQueries;
public boolean trackSchema = true;
public boolean rewriteBatchedStatements;
public boolean useCompression;
public boolean interactiveClient;
Expand Down

0 comments on commit 39eeb60

Please sign in to comment.