Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2025-03

Wrong version of db.pas in the fixes_3_2 branch?

7 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Roland

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
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(-)

Reply by email

Sven Barth
to Michael Roland

Michael Roland via fpc-devel schrieb am
Di., 1. Apr. 2025, 02:24:

Is the wrong version of the db.pas in fixes_3_2 branch?

No.

Show quoted text 5 lines
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.

There have been changes from 3.3.1 that have been merged to 3.2.3.

The 3.3.1 db.pas adds a new enum value ftSingle to TFieldType.

Correct.

Show quoted text 9 lines
This causes the compilation of ZeosDb 8.0 ZAbstractRODataset.pas to fail with the error Error: Expected another 1 array elements.

Then Zeos code will have to be adjusted.

Show quoted text 16 lines
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.

No, it's not. For ftSingle it needs to be adjusted.

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?

Things like these can and do happen especially considering how old 3.2.2 is.

Are any other files from the 3.3.1 branch in the fixes_3_2 branch?

There are no "files from the 3.3.1 branch" that were moved over (well, expect maybe some new ones), just selected changes that were merged over. This is simply how things work and third party software has to adjust their checks. That's how it has always been.

Regards,
Sven

Reply by email

Marco van de Voort
to Sven Barth

Op 1-4-2025 om 08:04 schreef Sven Barth via fpc-devel:

Show quoted text 10 lines
Are any other files from the 3.3.1 branch in the fixes_3_2 branch? There are no "files from the 3.3.1 branch" that were moved over (well, expect maybe some new ones), just selected changes that were merged over. This is simply how things work and third party software has to adjust their checks. That's how it has always been.

As Sven says, the fixes branch is a mix of development-at-arms-length and a rigid stable branch(as in bugfix only). In practice it means that compiler changes are usually real bugfixes (the rigid part), but runtime and library changes and fixes are merged when they are considered stable (the development-at-arms-length part) and don't depend on new language features.

The criterium is mostly that the merges must be possible without too much hand interference (which could possibly introduce bugs due to the merging), in the past there have been exceptions to that for specially major Mysql versions.

New mysql major versions are also one of the main reasons why also features are added, otherwise you could now only use 6 year old mysql/mariadb versions (not that it is much better with the current fixes release frequency)

A few attempts were made at also providing wholly rigid stable branches  for e.g. corporate use, but those initiatives to my best knowledge petered out.

The reasons are rooted in release frequency, but also spreading out library fixes more to avoid the dreaded "don't use .0 versions" syndrome by mitigating the amount of changes in library code that hasn't seen wide usage yet in new major (.0) releases.

Reply by email

Michael Roland
to Marco van de Voort

Ok, thanks for explaining. I am new to Free Pascal.

What is the best way to check which version of TFieldType is in use? Is the compiler patch number changed when changes like this occur? Is there a more reliable method than looking at the compiler version? ________________________________

Earlier message 45 lines
From: fpc-devel on behalf of Marco van de Voort via fpc-devel Sent: Tuesday, April 1, 2025 5:45 AM To: Cc: Marco van de Voort Subject: Re: [fpc-devel] Wrong version of db.pas in the fixes_3_2 branch? Op 1-4-2025 om 08:04 schreef Sven Barth via fpc-devel: > > > Are any other files from the 3.3.1 branch in the fixes_3_2 branch? > > > There are no "files from the 3.3.1 branch" that were moved over (well, > expect maybe some new ones), just selected changes that were merged > over. This is simply how things work and third party software has to > adjust their checks. That's how it has always been. > As Sven says, the fixes branch is a mix of development-at-arms-length and a rigid stable branch(as in bugfix only). In practice it means that compiler changes are usually real bugfixes (the rigid part), but runtime and library changes and fixes are merged when they are considered stable (the development-at-arms-length part) and don't depend on new language features. The criterium is mostly that the merges must be possible without too much hand interference (which could possibly introduce bugs due to the merging), in the past there have been exceptions to that for specially major Mysql versions. New mysql major versions are also one of the main reasons why also features are added, otherwise you could now only use 6 year old mysql/mariadb versions (not that it is much better with the current fixes release frequency) A few attempts were made at also providing wholly rigid stable branches for e.g. corporate use, but those initiatives to my best knowledge petered out. The reasons are rooted in release frequency, but also spreading out library fixes more to avoid the dreaded "don't use .0 versions" syndrome by mitigating the amount of changes in library code that hasn't seen wide usage yet in new major (.0) releases.

Reply by email

thaddy
to Michael Roland
It is enough to change this to cover fixes, 3.2.3, and a future 3.2.4:
{$IF FPC_FULLVERSION >= 30203} // change here to 3.2.x fixes
{$DEFINE WITH_FTSINGLE}
{$DEFINE WITH_FTSHORTINT}
{$IFEND}

Regards,

Thaddy

Michael Roland wrote 68 lines
Ok, thanks for explaining. I am new to Free Pascal. What is the best way to check which version of TFieldType is in use? Is the compiler patch number changed when changes like this occur? Is there a more reliable method than looking at the compiler version? ------------------------- From: fpc-devel on behalf of Marco van de Voort via fpc-devel Sent: Tuesday, April 1, 2025 5:45 AM To: Cc: Marco van de Voort Subject: Re: [fpc-devel] Wrong version of db.pas in the fixes_3_2 branch? Op 1-4-2025 om 08:04 schreef Sven Barth via fpc-devel: > > > Are any other files from the 3.3.1 branch in the fixes_3_2 branch? > > > There are no "files from the 3.3.1 branch" that were moved over (well, > expect maybe some new ones), just selected changes that were merged > over. This is simply how things work and third party software has to > adjust their checks. That's how it has always been. > As Sven says, the fixes branch is a mix of development-at-arms-length and a rigid stable branch(as in bugfix only). In practice it means that compiler changes are usually real bugfixes (the rigid part), but runtime and library changes and fixes are merged when they are considered stable (the development-at-arms-length part) and don't depend on new language features. The criterium is mostly that the merges must be possible without too much hand interference (which could possibly introduce bugs due to the merging), in the past there have been exceptions to that for specially major Mysql versions. New mysql major versions are also one of the main reasons why also features are added, otherwise you could now only use 6 year old mysql/mariadb versions (not that it is much better with the current fixes release frequency) A few attempts were made at also providing wholly rigid stable branches for e.g. corporate use, but those initiatives to my best knowledge petered out. The reasons are rooted in release frequency, but also spreading out library fixes more to avoid the dreaded "don't use .0 versions" syndrome by mitigating the amount of changes in library code that hasn't seen wide usage yet in new major (.0) releases. _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel CAUTION: This email originated from outside of Ocmulgee EMC! Do not click links, open attachments or reply, unless you recognize the sender's email address and know the content is safe! _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marsupilami79
to Michael Roland: Is the wrong version of the db.pas in fixes_3_2 branch? The current version of db.pas in…

Hello Michael,

this has been fixed in the 8.0-patches branch of Zeos. Please check the SVN: https://sourceforge.net/p/zeoslib/code-0/HEAD/tree/branches/8.0-patches/ or GIT repository:
https://github.com/marsupilami79/zeoslib/tree/8.0-patches

Zeos 8.0, as you can download it, is only meant for FPC 3.2.2, not for the 3.2-fixes branch.

Best regards,

Jan

Michael Roland wrote 139 lines
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 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(-) _______________________________________________ fpc-devel maillist https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Roland
to Marsupilami79

I see now. I misunderstood what the 3.2-fixes branch was for.

Thanks to everyone who replied.
________________________________

Earlier message 195 lines
From: Marsupilami79 Sent: Tuesday, April 1, 2025 12:42 PM To: Cc: Michael Roland Subject: Re: [fpc-devel] Wrong version of db.pas in the fixes_3_2 branch? Hello Michael, this has been fixed in the 8.0-patches branch of Zeos. Please check the SVN: https://sourceforge.net/p/zeoslib/code-0/HEAD/tree/branches/8.0-patches/ or GIT repository: https://github.com/marsupilami79/zeoslib/tree/8.0-patches Zeos 8.0, as you can download it, is only meant for FPC 3.2.2, not for the 3.2-fixes branch. Best regards, Jan Am 31.03.2025 um 23:47 schrieb Michael Roland via fpc-devel: 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 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(-)

Reply by email