Firebird.pas issue

40 views
Skip to first unread message

Dalton Calford

unread,
Jul 2, 2025, 5:51:26 PMJul 2
to firebir...@googlegroups.com
Hi everyone, I don't know who I should ask about this - since it appears to be an issue with the provided Firebird.pas I figured I would try dev first but I am willing to post it on general  support.

I am attempting to compile a UDR for Firebird version 6 but I am getting this error :

Free Pascal Compiler version 3.2.2+dfsg-20 [2023/03/30] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling setup_udr.pas
Compiling Firebird.pas
Firebird.pas(4025,2) Error: Forward type not resolved "Paramdsc"
Firebird.pas(6352,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

In Firebird.pas on line 210  there is the following instruction : 
paramdscPtr = ^paramdsc;

It is used multiple times in the file, but I don't see where it is declared.

Any guidance would be appreciated.

 

Dalton Calford

unread,
Jul 2, 2025, 6:09:15 PMJul 2
to firebir...@googlegroups.com
It appears to be an issue with it's declaration, it was declared as Dsc instead of paramdsc.

It should be updated in the distribution.

Thanks 

tony.whyman

unread,
Jul 2, 2025, 6:10:10 PMJul 2
to firebir...@googlegroups.com
You might find the version of firebird.pas provided with IBX and as part of the fbintf package useful. This version has been updated to work with the forthcoming version of fpc. It has been renamed to avoid confusion with earlier versions.


The fbintf package also includes udr support.



Sent from my Galaxy
--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/firebird-devel/CANY9GwqXG%2B2Szm1LQv-z3sAWBkoX%3D1i3gUx36B%3DezK6aZgm9eQ%40mail.gmail.com.

Alex Peshkoff

unread,
Jul 3, 2025, 5:13:49 AMJul 3
to firebir...@googlegroups.com
On 7/3/25 01:09, Dalton Calford wrote:
> It appears to be an issue with it's declaration, it was declared as
> Dsc instead of paramdsc.
>
> It should be updated in the distribution.

I've fixed an issue with paramdsc but there is one more problem with
.pas in fb6. Will take care of it on a day or two.



Dalton Calford

unread,
Jul 3, 2025, 6:32:37 AMJul 3
to firebir...@googlegroups.com
Thanks Alex,
Can you provide a simple command line example of compiling a single file udr and the files that need to be in the directory?
Even after making the change to the firebird.pas file, I am having compilation errors.

Appreciate your help on this.

Regards 
Dalton 

--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.

tony.whyman

unread,
Jul 3, 2025, 8:06:03 AMJul 3
to firebir...@googlegroups.com
I've always wondered whether there are any other users of Firebird.pas, that is other than IBX for Lazarus. So it's interesting to see someone else come forward.

For IBX, I always found it necessary to edit Firebird.pas, e.g. to allow IBX to continue to dynamically load the Firebird client, and to keep with legacy naming conventions on IBX, etc. I.e. I only ever took the Firebird.pas that came with Firebird as a starting point.

The last time I looked the version of Firebird.pas shipped with Firebird would always crash on first use when compiled with fpc 3.3.1 and later. It was broken.

This is because and starting with fpc 3.3.1, the object instance layout became incompatible with the cloop approach. This is due to an extra variable being added to the fpc object instance header. When I protested about this to the fpc devs, the response was that the object instance layout was an internal structure and its layout could thus change at any time. Only the layout of a record could be assumed to be unchanging.

Given that it was not feasible to change the Firebird client library to align with the fpc change, I designed an approach for the Pascal side of the API using extended records instead of objects. This supports all versions of fpc and has been in operational use for over a year now. It also works with Delphi.

The Firebird.pas shipped with IBX thus uses the extended record approach.  The code is very different in structure to the original Firebird pas, but there are only minor differences to the user and as documented in the distribution. Fortunately the syntax for using an API based on extended records is almost identical to an API using objects 

I did offer to make my changes available to Firebird but got such a negative response that I really couldn't be bothered to engage with the problem. My updated Firebird.pas and cloop updates are available for anyone interested on github.




Sent from my Galaxy


-------- Original message --------
From: Alex Peshkoff <alexander...@gmail.com>
Date: 03/07/2025 10:13 (GMT+00:00)

Dalton Calford

unread,
Jul 3, 2025, 1:40:19 PMJul 3
to firebir...@googlegroups.com
Hey Tony,  I want to thank you, I have my first udr compiled and I am starting testing.

Your framework is wonderful.

As I just started reviewing it, are there any gotchas when using ib6 (other than ib6)?

Thanks again!

tony.whyman

unread,
Jul 3, 2025, 3:27:23 PMJul 3
to firebir...@googlegroups.com
I assume you mean fb6.

What you may find is that my current version of Firebird.pas has yet to be updated to FB6. So if you want to use a new fb6 call then the idl will need updating and Firebird.pas regenerated. One reason that I am slow to do this is that the Firebird devs rename old functions and reuse the sane name for extended versions. Makes for a maintenance headache.

The udr framework was built with the support of a German Delphi user group. The feedback helped polish  the code.

Dalton Calford

unread,
Jul 3, 2025, 4:01:39 PMJul 3
to firebir...@googlegroups.com
Yep, FB6, been working with IB/FB since IB version 4 - been doing this for a bit.

I have been away working on other projects, years ago, I built some rough recursive data structures using stored proc's (with the 1000 deep recursion limit), then when recursive CTE's came out, I redid it, following key:data format (a precursor to  6th normal form).
I wanted to share it, but, without schema's, it is a very complex mess.   So, now, I have schemas and I started to convert all my code, tried to have gemini-cli analyse it and it came back that I wrote the framework for a Graph database. (go figure) so my first UDR builds the data structure,   my second UDR implements a UDR parser that uses Cypher (an open source graph database language) and the parser converts the commands and responses to and from my data structure.

I also have been working on the math to  implement vector distance calculations, as my day job had me using vector analysis for a bit, but I always wanted to use firebird to do it.  I am thinking UDR's would keep the in-memory index and connect to the external vector engine (a specialized LLM).   So, hopefully I will be able to get some versions out for people to play with.

I was really hoping that Firebirds schema would be recursive ie [root].[schema1].[schema2].[schema3]  etc as it would make my work easier, but it would also make porting from other databases easier ie [root].[mssql].[server1].[instance1].[schema ie dbo].[object name]  this would also make mapping a permanent link from one database to another easier as the remote tree would map onto a branch of the local tree.  

I would love to look at the code and do it myself, but, everytime I download the FB source code, I give up trying to figure out what each bit does (It has been years since I have had to read/work with C/C++)

Anyways, I am still getting the parser udr to compile, If I get that done, I will see about putting it all up on the web.  Should be fun.

Again, thanks for your help.

regards, 
Dalton


Alex Peshkoff

unread,
Jul 4, 2025, 6:21:29 AMJul 4
to firebir...@googlegroups.com
On 7/3/25 15:05, tony.whyman wrote:
> I've always wondered whether there are any other users of
> Firebird.pas, that is other than IBX for Lazarus. So it's interesting
> to see someone else come forward.
>
> For IBX, I always found it necessary to edit Firebird.pas, e.g. to
> allow IBX to continue to dynamically load the Firebird client, and to
> keep with legacy naming conventions on IBX, etc. I.e. I only ever took
> the Firebird.pas that came with Firebird as a starting point.
>
> The last time I looked the version of Firebird.pas shipped with
> Firebird would always crash on first use when compiled with fpc 3.3.1
> and later. It was broken.
>

Stable Gentoo is still using 3.2.2. I've fixed regressions due to
parameter named 'type' in some specific place.

I'll be at vacations since Monday, afterwards I can return to Records
instead Classes.

> This is because and starting with fpc 3.3.1, the object instance
> layout became incompatible with the cloop approach. This is due to an
> extra variable being added to the fpc object instance header. When I
> protested about this to the fpc devs, the response was that the object
> instance layout was an internal structure and its layout could thus
> change at any time. Only the layout of a record could be assumed to be
> unchanging.
>
> Given that it was not feasible to change the Firebird client library
> to align with the fpc change, I designed an approach for the Pascal
> side of the API using extended records instead of objects. This
> supports all versions of fpc and has been in operational use for over
> a year now. It also works with Delphi.
>
> The Firebird.pas shipped with IBX thus uses the extended record
> approach.  The code is very different in structure to the original
> Firebird pas, but there are only minor differences to the user and as
> documented in the distribution. Fortunately the syntax for using an
> API based on extended records is almost identical to an API using objects
>

What differences?

> I did offer to make my changes available to Firebird but got such a
> negative response that I really couldn't be bothered to engage with
> the problem. My updated Firebird.pas and cloop updates are available
> for anyone interested on github.
>
>
> https://github.com/mwasoftware/
>

Will look later.


Mark Rotteveel

unread,
Jul 4, 2025, 6:38:53 AMJul 4
to firebir...@googlegroups.com
On 03/07/2025 14:05, tony.whyman wrote:
> I did offer to make my changes available to Firebird but got such a
> negative response that I really couldn't be bothered to engage with the
> problem. My updated Firebird.pas and cloop updates are available for
> anyone interested on github.
I think you're referring to the discussion in "[firebird-devel] Proposed
update to Cloop" dated June 3rd, 2024, and this PR,
https://github.com/asfernandes/cloop/pull/9.

The problem was that it was against the wrong repository, i.e., not the
CLOOP code used by Firebird, but Adriano's version of it, which diverges
from the one in Firebird (basically, IIRC, the code in Firebird was
forked from it).

Mark
--
Mark Rotteveel

tony.whyman

unread,
Jul 4, 2025, 7:40:29 AMJul 4
to firebir...@googlegroups.com
I wrote a reader to explain what I did and listed the compatibility issues. See


The key differences from the API user viewpoint are:

1. "With" statements that reference an interface class (e.g. IMaster) need to
include a pointer dereference ("^" appended to identifier).

2. when there is a need for type coercion, typically from an implementation
object to the corresponding interface, this has now to use the explicit type
cocercion methods.



Sent from my Galaxy


-------- Original message --------
From: Alex Peshkoff <alexander...@gmail.com>
Date: 04/07/2025 11:21 (GMT+00:00)
Subject: Re: [firebird-devel] Re: Firebird.pas issue

--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages