8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:43:02 +01:00

According to Adriano's suggestions

This commit is contained in:
hvlad 2018-05-23 20:42:22 +03:00
parent 7f3bfe7cf1
commit fe68255f62
3 changed files with 13 additions and 7 deletions

View File

@ -330,6 +330,7 @@ Firebird 4.0
PRIVILEGE *
QUANTIZE *
RANGE (1)
RESET *
SECURITY
SESSION
SQL (1)

View File

@ -55,6 +55,12 @@ struct DecimalStatus
: decExtFlag(exc), roundingMode(DEC_ROUND_HALF_UP)
{ }
DecimalStatus()
: decExtFlag(FB_DEC_Errors), roundingMode(DEC_ROUND_HALF_UP)
{ }
static const DecimalStatus DEFAULT;
USHORT decExtFlag, roundingMode;
};
@ -64,15 +70,14 @@ struct DecimalBinding
: bind(DEC_NATIVE), numScale(0)
{ }
static const DecimalBinding DEFAULT;
enum Bind { DEC_NATIVE, DEC_TEXT, DEC_DOUBLE, DEC_NUMERIC };
Bind bind;
SCHAR numScale;
};
// Default values for user sessions
const DecimalStatus DefaultDecimalStatus(FB_DEC_Errors);
const DecimalBinding DefaultDecimalBinding;
class DecimalFixed;

View File

@ -204,8 +204,8 @@ Jrd::Attachment::Attachment(MemoryPool* pool, Database* dbb)
att_functions(*pool),
att_internal(*pool),
att_dyn_req(*pool),
att_dec_status(DefaultDecimalStatus),
att_dec_binding(DefaultDecimalBinding),
att_dec_status(DecimalStatus::DEFAULT),
att_dec_binding(DecimalBinding::DEFAULT),
att_charsets(*pool),
att_charset_ids(*pool),
att_pools(*pool),
@ -384,8 +384,8 @@ void Jrd::Attachment::releaseGTTs(thread_db* tdbb)
void Jrd::Attachment::resetSession(thread_db* tdbb)
{
// reset DecFloat
att_dec_status = DefaultDecimalStatus;
att_dec_binding = DefaultDecimalBinding;
att_dec_status = DecimalStatus::DEFAULT;
att_dec_binding = DecimalBinding::DEFAULT;
// reset timeouts
setIdleTimeout(0);