From b369aceb1dc31d221b9341906a9b8688f15e9bd1 Mon Sep 17 00:00:00 2001 From: rusher Date: Thu, 10 Oct 2024 14:20:52 +0200 Subject: [PATCH] [CONJ-1202] Session variable setting must be executed last --- .../org/mariadb/jdbc/client/impl/StandardClient.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java b/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java index 2694c5576..ba52dd3c4 100644 --- a/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java +++ b/src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java @@ -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()) { @@ -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(",")); }