Skip to content

Commit

Permalink
[CONJ-1202] Session variable setting must be executed last
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Oct 10, 2024
1 parent 9b69c21 commit b369ace
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,6 @@ public String createSessionVariableQuery(Context context) {
+ "')");
}

// add configured session variable if configured
if (conf.sessionVariables() != null) {
sessionCommands.add(Security.parseSessionVariables(conf.sessionVariables()));
}

// force client timezone to connection to ensure result of now(), ...
if (conf.forceConnectionTimeZoneToSession() == null
|| conf.forceConnectionTimeZoneToSession()) {
Expand Down Expand Up @@ -827,6 +822,11 @@ public String createSessionVariableQuery(Context context) {
sessionCommands.add(defaultCharsetSet);
}

// add configured session variable if configured
if (conf.sessionVariables() != null) {
sessionCommands.add(Security.parseSessionVariables(conf.sessionVariables()));
}

if (!sessionCommands.isEmpty()) {
return "set " + sessionCommands.stream().collect(Collectors.joining(","));
}
Expand Down

0 comments on commit b369ace

Please sign in to comment.