From aefc2d789f5c264b8efcf6ff500cc9cd54eda4dc Mon Sep 17 00:00:00 2001 From: lacak Date: Tue, 27 Oct 2020 15:01:57 +0000 Subject: [PATCH] fcl-db: dbase: add new field types (ftLongWord, ftShortint, ftByte) to fix export test errors git-svn-id: trunk@47225 - (cherry picked from commit eb4bc9d153f69392bb5e2b41a121690815c0a3e6) --- packages/fcl-db/src/dbase/dbf_common.inc | 1 + packages/fcl-db/src/dbase/dbf_fields.pas | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/fcl-db/src/dbase/dbf_common.inc b/packages/fcl-db/src/dbase/dbf_common.inc index fdc2f17304..6c3a270dd2 100644 --- a/packages/fcl-db/src/dbase/dbf_common.inc +++ b/packages/fcl-db/src/dbase/dbf_common.inc @@ -223,6 +223,7 @@ {$define SUPPORT_SEPARATE_VARIANTS_UNIT} {$define SUPPORT_REFRESHEVENTS} {$define SUPPORT_BACKWARD_FIELDDATA} + {$define SUPPORT_LONGWORD} // FPC 1.0.x exceptions: no 0/0 support {$ifdef VER1_0} diff --git a/packages/fcl-db/src/dbase/dbf_fields.pas b/packages/fcl-db/src/dbase/dbf_fields.pas index e34bab4d2b..71ade3022d 100644 --- a/packages/fcl-db/src/dbase/dbf_fields.pas +++ b/packages/fcl-db/src/dbase/dbf_fields.pas @@ -177,6 +177,7 @@ database. DIGITS_WORD = 5; DIGITS_INTEGER = 9; DIGITS_LARGEINT = 18; + DIGITS_LONGWORD = 9; //==================================================================== // DbfFieldDefs @@ -474,6 +475,9 @@ begin ftFloat, ftSmallInt, ftWord {$ifdef SUPPORT_INT64} , ftLargeInt +{$endif} +{$ifdef SUPPORT_LONGWORD} + , ftLongWord, ftShortInt, ftByte {$endif} : FNativeFieldType := 'N'; //numerical @@ -559,6 +563,19 @@ begin FSize := DIGITS_LARGEINT; FPrecision := 0; end; +{$endif} +{$ifdef SUPPORT_LONGWORD} + ftLongWord: + begin + FSize := DIGITS_LONGWORD; + FPrecision := 0; + end; + ftShortInt, + ftByte: + begin + FSize := 3; + FPrecision := 0; + end; {$endif} ftString {$ifdef SUPPORT_FIELDTYPES_V4}, ftFixedChar, ftWideString{$endif}: begin