mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:43:02 +01:00
Frontported fix for CORE-3627: Server crashes with access violation when inserting row into table with unique index
This commit is contained in:
parent
f1cee0e9d1
commit
2390d0be30
@ -1741,15 +1741,14 @@ void CVT_conversion_error(const dsc* desc, ErrorFunction err)
|
||||
* A data conversion error occurred. Complain.
|
||||
*
|
||||
**************************************/
|
||||
const char* p;
|
||||
VaryStr<41> s;
|
||||
Firebird::string message;
|
||||
|
||||
if (desc->dsc_dtype == dtype_blob)
|
||||
p = "BLOB";
|
||||
message = "BLOB";
|
||||
else if (desc->dsc_dtype == dtype_array)
|
||||
p = "ARRAY";
|
||||
message = "ARRAY";
|
||||
else if (desc->dsc_dtype == dtype_boolean)
|
||||
p = "BOOLEAN";
|
||||
message = "BOOLEAN";
|
||||
else
|
||||
{
|
||||
// CVC: I don't have access here to JRD_get_thread_data())->tdbb_status_vector
|
||||
@ -1764,9 +1763,11 @@ void CVT_conversion_error(const dsc* desc, ErrorFunction err)
|
||||
|
||||
try
|
||||
{
|
||||
const char* p;
|
||||
VaryStr<41> s;
|
||||
const USHORT length =
|
||||
CVT_make_string(desc, ttype_ascii, &p, &s, sizeof(s) - 1, localError);
|
||||
const_cast<char*>(p)[length] = 0;
|
||||
message.assign(p, length);
|
||||
}
|
||||
/*
|
||||
catch (status_exception& e)
|
||||
@ -1784,12 +1785,12 @@ void CVT_conversion_error(const dsc* desc, ErrorFunction err)
|
||||
*/
|
||||
catch (DummyException&)
|
||||
{
|
||||
p = "<Too long string or can't be translated>";
|
||||
message = "<Too long string or can't be translated>";
|
||||
}
|
||||
}
|
||||
|
||||
//// TODO: Need access to transliterate here to convert p to metadata charset.
|
||||
err(Arg::Gds(isc_convert_error) << p);
|
||||
//// TODO: Need access to transliterate here to convert message to metadata charset.
|
||||
err(Arg::Gds(isc_convert_error) << message);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user