[fpc-devel] Wrong version of db.pas in the fixes_3_2 branch?
Michael Roland
csg at ocmulgeeemc.com
Mon Mar 31 23:47:22 CEST 2025
Is the wrong version of the db.pas in fixes_3_2 branch?
The current version of db.pas in fixes_3_2 seems to be from the 3.3.1 branch instead of the 3.2.3 branch.
The 3.3.1 db.pas adds a new enum value ftSingle to TFieldType.
This causes the compilation of ZeosDb 8.0 ZAbstractRODataset.pas to fail with the error
Error: Expected another 1 array elements.
The ZeosDb source code creates an array of TFieldType, then fills the array with values.
line 5901 of zeosdbo-8.0.0-stable/src/component/ZAbstractRODataset.pas
"BaseFieldTypes: array[TFieldType] of TFieldType = ("
The error occurs because ZeosDb in not expecting the extra ftSingle element in free pascal version 3.2, so a value for ftSingle is not added to the array. The missing ftSingle value produces the array error.
However, ZeosDb does add the ftSingle value for free pascal version 3.3 or higher.
zeosdbo-8.0.0-stable/src/component/ZAbstractRODataset.pas
The ZeosDb source code is checking to see if the extra value ftSingle is needed in TFieldType (line 5914). If so, it adds and ftSingle entry to TFieldType.
{$IFDEF WITH_FTSINGLE}
, ftSingle
{$ENDIF}
The file zeosdbo-8.0.0-stable/src/ZeosLazarus.inc defines WITH_FTSINGLE as
{$IF FPC_FULLVERSION >= 30300}
{$DEFINE WITH_FTSINGLE}
{$DEFINE WITH_FTSHORTINT}
{$IFEND}
So ZeosDb is doing the correct thing.
The fixes_3_2 branch has the correct version in FPCSource/compiler/version.pas
{ version string }
version_nr = '3';
release_nr = '2';
patch_nr = '3';
minorpatch = '';
The current db.pas file seems like a breaking change to make in the fixes_3_2 branch. Was the current db.pas file added to the fixes_3_2 branch for a reason, or was it added unintenionally?
Are any other files from the 3.3.1 branch in the fixes_3_2 branch?
A git bisect of branch fixes_3_2 shows this commit as the source of the changed db.pas file.
b907920ef392d6b3a2ae02e489577ff869ede235 is the first bad commit
commit b907920ef392d6b3a2ae02e489577ff869ede235
Author: Michaël Van Canneyt <michael at freepascal.org>
Date: Mon Feb 14 09:15:30 2022 +0100
* Patch from Laco to add TSingleField
(cherry picked from commit c46b45bf72ed7e4522e69611d0a5c5c2f44739c9)
packages/fcl-db/src/base/bufdataset.pas | 4 +-
packages/fcl-db/src/base/db.pas | 56 ++++++-
packages/fcl-db/src/base/dsparams.inc | 23 ++-
packages/fcl-db/src/base/fields.inc | 178 +++++++++++++++++++--
packages/fcl-db/src/base/xmldatapacketreader.pp | 5 +-
packages/fcl-db/src/codegen/fpddcodegen.pp | 2 +-
packages/fcl-db/src/datadict/fpdatadict.pp | 2 +-
packages/fcl-db/src/dbase/dbf_fields.pas | 4 +-
packages/fcl-db/src/export/fpfixedexport.pp | 5 +-
packages/fcl-db/src/export/fprtfexport.pp | 2 +-
packages/fcl-db/src/export/fptexexport.pp | 2 +-
packages/fcl-db/src/memds/memds.pp | 2 +
packages/fcl-db/src/sqldb/odbc/odbcconn.pas | 22 ++-
packages/fcl-db/src/sqldb/postgres/pqconnection.pp | 3 +-
packages/fcl-db/src/sqldb/sqldb.pp | 1 +
packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp | 14 +-
packages/fcl-db/tests/bufdatasettoolsunit.pas | 2 +
packages/fcl-db/tests/memdstoolsunit.pas | 2 +
packages/fcl-db/tests/sqldbtoolsunit.pas | 3 +-
packages/fcl-db/tests/testdbbasics.pas | 43 +++--
packages/fcl-db/tests/testdbexport.pas | 8 +-
packages/fcl-db/tests/toolsunit.pas | 4 +-
packages/fcl-sdo/src/das/sdo_das_utils.pas | 17 +-
packages/fcl-web/src/restbridge/sqldbrestschema.pp | 3 +-
24 files changed, 340 insertions(+), 67 deletions(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20250331/f456284e/attachment.htm>
More information about the fpc-devel
mailing list