Index expression in TDbf component raise an exception when large numeric fields are used
Original Reporter info from Mantis: Vali
-
Reporter name: Valentin Calinov
Original Reporter info from Mantis: Vali
- Reporter name: Valentin Calinov
Description:
I am not sure this is a bug or a missing feature, but trying to build expression indexes
on a dbf table containing numeric fields with more then 9 digits will raise an exception.
Example: Index expression:
'STR(NUM_10DIG)+STR_FLD'
where NUM_10DIG is a 10 digit numeric field and STR_FLD is a string field.
Note: Index expression 'STR(NUM_09DIG)+STR_FLD' with 9 digits numeric field works.
When trying to run the attached project from the command line it produces the following output:
C:\bug_dbf_indx_expr>bug_dbf_indx_expr.exe
IndxExpr = STR(NUM_10DIG)+STR_FLD
An unhandled exception occurred at $0045914F :
EParserException : Argument type mismatch
$0045914F
$0045906B
$00432617
$004380E8
$00430B4D
$00412983
$004017AC
Additional information:
To solve the problem I added the following lines in
packages\fcl-db\src\dbase\dbf_prscore.pas unit (line 2280):
{$ifdef SUPPORT_INT64}
Add(TFunction.Create('STR', '', 'LII', 1, etString, FuncInt64ToStr, ''));
{$endif}
Mantis conversion info:
- Mantis ID: 16794
- OS: WinXp 32 bit
- Version: 2.4.0
- Fixed in version: 2.6.0
- Fixed in revision: 17724 (#ea880b82)