mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 00:03:03 +01:00
Fixed CORE-1378 - Domain names and charset issues
This commit is contained in:
parent
7c8013a73c
commit
8c202cdd61
@ -5955,14 +5955,14 @@ static void put_dtype(dsql_req* request, const dsql_fld* field, bool use_subtype
|
||||
{
|
||||
request->append_uchar(blr_domain_name2);
|
||||
request->append_uchar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
|
||||
request->append_cstring(0, field->fld_type_of_name);
|
||||
request->append_meta_string(field->fld_type_of_name);
|
||||
request->append_ushort(field->fld_ttype);
|
||||
}
|
||||
else
|
||||
{
|
||||
request->append_uchar(blr_domain_name);
|
||||
request->append_uchar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
|
||||
request->append_cstring(0, field->fld_type_of_name);
|
||||
request->append_meta_string(field->fld_type_of_name);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -6814,6 +6814,28 @@ void dsql_req::append_cstring(UCHAR verb, const char* string)
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Write out a string in metadata charset with one byte of length.
|
||||
//
|
||||
void dsql_req::append_meta_string(const char* string)
|
||||
{
|
||||
ISC_STATUS_ARRAY status_vector = {0};
|
||||
Firebird::UCharBuffer nameBuffer;
|
||||
|
||||
THREAD_EXIT();
|
||||
const ISC_STATUS s =
|
||||
gds__intl_function(status_vector, &req_dbb->dbb_database_handle,
|
||||
INTL_FUNCTION_CONV_TO_METADATA, CS_dynamic,
|
||||
strlen(string), (const UCHAR*) string, &nameBuffer);
|
||||
THREAD_ENTER();
|
||||
|
||||
if (s)
|
||||
ERRD_punt(status_vector);
|
||||
|
||||
append_string(0, (const TEXT*) nameBuffer.begin(), nameBuffer.getCount());
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Write out a string valued attribute.
|
||||
//
|
||||
|
@ -381,6 +381,7 @@ public:
|
||||
inline void append_ushort(USHORT val);
|
||||
inline void append_ulong(ULONG val);
|
||||
void append_cstring(UCHAR verb, const char* string);
|
||||
void append_meta_string(const char* string);
|
||||
void append_string(UCHAR verb, const char* string, USHORT len);
|
||||
void append_number(UCHAR verb, SSHORT number);
|
||||
void begin_blr(UCHAR verb);
|
||||
|
@ -2975,20 +2975,7 @@ static void stuff_cstring( dsql_req* request, const char* string)
|
||||
**/
|
||||
static void stuff_meta_string(dsql_req* request, const char* string)
|
||||
{
|
||||
ISC_STATUS_ARRAY status_vector = {0};
|
||||
Firebird::UCharBuffer nameBuffer;
|
||||
|
||||
THREAD_EXIT();
|
||||
const ISC_STATUS s =
|
||||
gds__intl_function(status_vector, &request->req_dbb->dbb_database_handle,
|
||||
INTL_FUNCTION_CONV_TO_METADATA, CS_dynamic,
|
||||
strlen(string), (const UCHAR*) string, &nameBuffer);
|
||||
THREAD_ENTER();
|
||||
|
||||
if (s)
|
||||
ERRD_punt(status_vector);
|
||||
|
||||
stuff_string(request, (const TEXT*) nameBuffer.begin(), nameBuffer.getCount());
|
||||
request->append_meta_string(string);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user