8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 21:23:03 +01:00

Correction for problem with CURRENT_USER/ROLE and client charset

This commit is contained in:
asfernandes 2006-07-12 18:44:08 +00:00
parent a3fdfd273f
commit 84c593b954
3 changed files with 6 additions and 3 deletions

View File

@ -1219,8 +1219,10 @@ void MAKE_desc(dsql_req* request, dsc* desc, dsql_nod* node, dsql_nod* null_repl
desc->dsc_dtype = dtype_varying;
desc->dsc_scale = 0;
desc->dsc_flags = 0;
desc->dsc_ttype() = ttype_dynamic;
desc->dsc_length = USERNAME_LENGTH + sizeof(USHORT);
desc->dsc_ttype() = ttype_metadata;
desc->dsc_length =
USERNAME_LENGTH * METD_get_charset_bpc(request, ttype_metadata) +
sizeof(USHORT);
return;
case nod_internal_info:

View File

@ -1649,6 +1649,7 @@ void CMP_get_desc(thread_db* tdbb, CompilerScratch* csb, jrd_nod* node, DSC * de
case nod_current_role:
desc->dsc_dtype = dtype_text;
desc->dsc_ttype() = ttype_metadata;
// ASF: should be multiplied by maxBytesPerChar of ttype_metadata in the future
desc->dsc_length = USERNAME_LENGTH;
desc->dsc_scale = 0;
desc->dsc_flags = 0;

View File

@ -56,7 +56,7 @@ const ULONG MAX_COLUMN_SIZE = 32767; /* Bytes */
/* Misc constant values */
const int USERNAME_LENGTH = 31; /* Bytes */
const int USERNAME_LENGTH = 31; /* Characters */
const size_t MAX_SQL_IDENTIFIER_SIZE = 32;
const size_t MAX_SQL_IDENTIFIER_LEN = MAX_SQL_IDENTIFIER_SIZE - 1;