From 14242013dd7fe88b1f9f8cd643a762570cc79529 Mon Sep 17 00:00:00 2001
From: Riccardo Boero <ribo@nilu.no>
Date: Thu, 11 Apr 2024 09:58:35 +0200
Subject: [PATCH] Fixed SQL parameters variable settings

---
 src/utils_DB_connection.jl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils_DB_connection.jl b/src/utils_DB_connection.jl
index d951005..08c90cf 100644
--- a/src/utils_DB_connection.jl
+++ b/src/utils_DB_connection.jl
@@ -17,9 +17,9 @@ function establish_connection(host::String, user::String, password::String, dbna
     # Establish connection
     conn = MySQL.Connection(host, user, password, dbname, port, "nothing")
     # Temporarily increase max_allowed_packet
-    size_query = "SET SESSION max_allowed_packet=1073741824;"  # Sets max_allowed_packet to 1GB
+    size_query = "SET GLOBAL max_allowed_packet=1073741824;"  # Sets max_allowed_packet to 1GB
     timeout_query = "SET SESSION wait_timeout = 31536000;"     # Sets wait_timeout to 1 year
-    maxtime_query = "SET SESSION max_execution_time = 604800000;"  # Sets max_execution_time to 1 week
+    maxtime_query = "SET SESSION MAX_STATEMENT_TIME=604800000;"  # Sets max_execution_time to 1 week
     try
         # Execute session variable adjustments
         DBInterface.execute(conn, size_query)
-- 
GitLab