<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;
mso-ligatures:standardcontextual;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Is the wrong version of the db.pas in fixes_3_2 branch?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The 3.3.1 db.pas adds a new enum value ftSingle to TFieldType.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">This causes the compilation of ZeosDb 8.0 ZAbstractRODataset.pas to fail with the error<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Error: Expected another 1 array elements.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The ZeosDb source code creates an array of TFieldType, then fills the array with values.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">line 5901 of zeosdbo-8.0.0-stable/src/component/ZAbstractRODataset.pas<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">"BaseFieldTypes: array[TFieldType] of TFieldType = ("<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">However, ZeosDb does add the ftSingle value for free pascal version 3.3 or higher.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">zeosdbo-8.0.0-stable/src/component/ZAbstractRODataset.pas<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> {$IFDEF WITH_FTSINGLE}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> , ftSingle<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> {$ENDIF}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The file zeosdbo-8.0.0-stable/src/ZeosLazarus.inc defines WITH_FTSINGLE as<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">{$IF FPC_FULLVERSION >= 30300}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">{$DEFINE WITH_FTSINGLE}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">{$DEFINE WITH_FTSHORTINT}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">{$IFEND}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">So ZeosDb is doing the correct thing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The fixes_3_2 branch has the correct version in FPCSource/compiler/version.pas<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> { version string }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> version_nr = '3';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> release_nr = '2';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> patch_nr = '3';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> minorpatch = '';<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Are any other files from the 3.3.1 branch in the fixes_3_2 branch?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">A git bisect of branch fixes_3_2 shows this commit as the source of the changed db.pas file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">b907920ef392d6b3a2ae02e489577ff869ede235 is the first bad commit<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">commit b907920ef392d6b3a2ae02e489577ff869ede235<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Author: Michaël Van Canneyt <michael@freepascal.org><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Date: Mon Feb 14 09:15:30 2022 +0100<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> * Patch from Laco to add TSingleField<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> (cherry picked from commit c46b45bf72ed7e4522e69611d0a5c5c2f44739c9)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/base/bufdataset.pas | 4 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/base/db.pas | 56 ++++++-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/base/dsparams.inc | 23 ++-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/base/fields.inc | 178 +++++++++++++++++++--<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/base/xmldatapacketreader.pp | 5 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/codegen/fpddcodegen.pp | 2 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/datadict/fpdatadict.pp | 2 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/dbase/dbf_fields.pas | 4 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/export/fpfixedexport.pp | 5 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/export/fprtfexport.pp | 2 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/export/fptexexport.pp | 2 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/memds/memds.pp | 2 +<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/sqldb/odbc/odbcconn.pas | 22 ++-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/sqldb/postgres/pqconnection.pp | 3 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/sqldb/sqldb.pp | 1 +<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/src/sqldb/sqlite/sqlite3conn.pp | 14 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/bufdatasettoolsunit.pas | 2 +<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/memdstoolsunit.pas | 2 +<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/sqldbtoolsunit.pas | 3 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/testdbbasics.pas | 43 +++--<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/testdbexport.pas | 8 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-db/tests/toolsunit.pas | 4 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-sdo/src/das/sdo_das_utils.pas | 17 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">packages/fcl-web/src/restbridge/sqldbrestschema.pp | 3 +-<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">24 files changed, 340 insertions(+), 67 deletions(-)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>