From 9e1396f0675c3c25ec309c3cc0991d9e9c5a6f93 Mon Sep 17 00:00:00 2001 From: Hyung-Gyu Ryoo Date: Mon, 16 Dec 2024 13:13:33 +0900 Subject: [PATCH] apply changed session parameter when compiling PL/CSQL, including codeset (set names ) --- .../src/main/java/com/cubrid/jsp/ExecuteThread.java | 9 ++++++--- src/sp/sp_catalog.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pl_engine/pl_server/src/main/java/com/cubrid/jsp/ExecuteThread.java b/pl_engine/pl_server/src/main/java/com/cubrid/jsp/ExecuteThread.java index e7a53ccf3e..ae2d8b0a64 100644 --- a/pl_engine/pl_server/src/main/java/com/cubrid/jsp/ExecuteThread.java +++ b/pl_engine/pl_server/src/main/java/com/cubrid/jsp/ExecuteThread.java @@ -321,6 +321,9 @@ private void readSessionParameter(CUBRIDUnpacker unpacker) { private void processStoredProcedure() throws Exception { unpacker.setBuffer(ctx.getInboundQueue().take()); + // session parameters + readSessionParameter(unpacker); + // prepare if (prepareArgs == null) { prepareArgs = new PrepareArgs(unpacker); @@ -328,9 +331,6 @@ private void processStoredProcedure() throws Exception { prepareArgs.readArgs(unpacker); } - // session parameters - readSessionParameter(unpacker); - long id = unpacker.unpackBigint(); int tid = unpacker.unpackInt(); @@ -398,6 +398,9 @@ private void processBootstrap() throws Exception { private void processCompile() throws Exception { unpacker.setBuffer(ctx.getInboundQueue().take()); + // session parameters + readSessionParameter(unpacker); + CompileRequest request = new CompileRequest(unpacker); // TODO: Pass CompileRequest directly to compilePLCSQL () diff --git a/src/sp/sp_catalog.cpp b/src/sp/sp_catalog.cpp index 4caaad9537..3957a4f868 100644 --- a/src/sp/sp_catalog.cpp +++ b/src/sp/sp_catalog.cpp @@ -843,8 +843,8 @@ sp_add_stored_procedure_code (SP_CODE_INFO &info) goto error; } - db_make_varchar (&value, DB_DEFAULT_PRECISION, info.scode.data (), info.scode.length (), LANG_SYS_CODESET, - LANG_SYS_COLLATION); + db_make_varchar (&value, DB_DEFAULT_PRECISION, info.scode.data (), info.scode.length (), lang_get_client_charset (), + lang_get_client_collation ()); err = dbt_put_internal (obt_p, SP_ATTR_SOURCE_CODE, &value); pr_clear_value (&value); if (err != NO_ERROR) @@ -861,8 +861,8 @@ sp_add_stored_procedure_code (SP_CODE_INFO &info) goto error; } - db_make_varchar (&value, DB_DEFAULT_PRECISION, info.ocode.data (), info.ocode.length (), LANG_SYS_CODESET, - LANG_SYS_COLLATION); + db_make_varchar (&value, DB_DEFAULT_PRECISION, info.ocode.data (), info.ocode.length (), lang_get_client_charset (), + lang_get_client_collation ()); err = dbt_put_internal (obt_p, SP_ATTR_OBJECT_CODE, &value); pr_clear_value (&value); if (err != NO_ERROR)