Firebird Documentation Index → Firebird 2.1 Release Notes → External Functions (UDFs) → UDFs Added and Changed |
UDFs added or enhanced in Firebird 2.0's supplied libraries are:
In previous versions, the external function rand() sets the random number generator's starting point based on the current time and then generates the pseudo-random value.
srand((unsigned) time(NULL)); return ((float) rand() / (float) RAND_MAX);
The problem with this algorithm is that it will return the same value for two calls done within a second.
To work around this issue, rand() was changed in Firebird 2.0 so that the starting point is not set explicitly. This ensures that different values will always be returned.
In order to keep the legacy behaviour available in case somebody needs it, srand() has been introduced. It does exactly the same as the old rand() did.
The function IB_UDF_lower()
in the IB_UDF library might conflict with the new
internal function lower()
, if you try to declare it in a database using the ib_udf.sql
script from a previous Firebird version.
/* ib_udf.sql declaration that now causes conflict */ DECLARE EXTERNAL FUNCTION lower CSTRING(255) RETURNS CSTRING(255) FREE_IT ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';
The problem will be resolved in the latest version of the new ib_udf2.sql script, where the old UDF is declared using a quoted identifier.
/* New declaration in ib_udf2.sql */ DECLARE EXTERNAL FUNCTION "LOWER" CSTRING(255) NULL RETURNS CSTRING(255) FREE_IT ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';
It is preferable to use the internal function LOWER() than to call the UDF.
Firebird Documentation Index → Firebird 2.1 Release Notes → External Functions (UDFs) → UDFs Added and Changed |