Skip to content

Commit

Permalink
apply changed session parameter when compiling PL/CSQL, including cod…
Browse files Browse the repository at this point in the history
…eset (set names <codeset>)
  • Loading branch information
hgryoo committed Dec 16, 2024
1 parent 2ad6e5b commit 9e1396f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ 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);
} else {
prepareArgs.readArgs(unpacker);
}

// session parameters
readSessionParameter(unpacker);

long id = unpacker.unpackBigint();
int tid = unpacker.unpackInt();

Expand Down Expand Up @@ -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 ()
Expand Down
8 changes: 4 additions & 4 deletions src/sp/sp_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 9e1396f

Please sign in to comment.