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

Added optional seconds precision to CURRENT_TIME and CURRENT_TIMESTAMP

as agreed with Ann and others times ago.
This commit is contained in:
dimitr 2005-08-24 09:42:14 +00:00
parent c81c80dbec
commit 0cd5e57eaa

View File

@ -927,6 +927,21 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
}
break;
case nod_current_time:
case nod_current_timestamp:
{
dsql_nod* const_node = input->nod_arg[0];
fb_assert(const_node->nod_type == nod_constant);
const int precision = (int)(IPTR) const_node->nod_arg[0];
fb_assert(precision >= 0);
// We pass precision as a single byte, hence a check
// to avoid overflows
if (precision > MAX_UCHAR) {
const_node->nod_arg[0] = (dsql_nod*)(IPTR) MAX_UCHAR;
}
}
break;
case nod_join:
return pass1_join(request, input, proc_flag);