[Firebird-devel] Universal datatype was: ODP: User-defined aggregate functions

2018-09-28 Thread Leyne, Sean
Adriano, > I like your opinion to not limit to only one input parameters. This limitation > seems to not have sense. I agree. But then, would you agree that it is finally time for us to solve the problem of having to create multiple versions of a function to handle different data types. Why

Re: [Firebird-devel] ODP: User-defined aggregate functions

2018-09-28 Thread Adriano dos Santos Fernandes
Karol, If user code something wrongly or create inifinite loops, wrongly results he/she will have, no matter how things are defined. I like your opinion to not limit to only one input parameters. This limitation seems to not have sense. Adriano On 28/09/2018 16:33, Karol Bieniaszewski wrote:

[Firebird-devel] ODP: User-defined aggregate functions

2018-09-28 Thread Karol Bieniaszewski
Hi, First – good concept  But, how this will work? In every WHILE loop, engine will lock loop until next row is „fetched” and susspend is called? I do not know if you understand me? What if function will do not call susspend at all or do not run while loop properly? Maybe this can be done

[Firebird-devel] [FB-Tracker] Created: (CORE-5929) Bug: Reverse like-search with '%' not working

2018-09-28 Thread Rajko Thon (JIRA)
Bug: Reverse like-search with '%' not working - Key: CORE-5929 URL: http://tracker.firebirdsql.org/browse/CORE-5929 Project: Firebird Core Issue Type: Bug Affects Versions: 3.0.2

Re: [Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Adriano dos Santos Fernandes
On 28/09/2018 15:04, Leyne, Sean wrote: > >> -Original Message- >> From: Adriano dos Santos Fernandes >> Sent: Friday, September 28, 2018 1:55 PM >> To: firebird-devel@lists.sourceforge.net >> Subject: Re: [Firebird-devel] User-defined aggregate functions >> >> On 28/09/2018 14:35, Leyne,

Re: [Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Leyne, Sean
> -Original Message- > From: Adriano dos Santos Fernandes > Sent: Friday, September 28, 2018 1:55 PM > To: firebird-devel@lists.sourceforge.net > Subject: Re: [Firebird-devel] User-defined aggregate functions > > On 28/09/2018 14:35, Leyne, Sean wrote: > > > > How would this work

Re: [Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Adriano dos Santos Fernandes
On 28/09/2018 14:35, Leyne, Sean wrote: > > How would this work within a GROUP BY context? > > I see how it works within a flat list, but when there are intermediate > levels, I don't see this working. > > Engine does all the work for groups. Each group makes the function start - suspend (n

Re: [Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Leyne, Sean
> -- Works as standard AVG. > create aggregate function custom_avg (i double precision) returns (o double > precision) as >     declare count integer = 0; >     declare accumulated double precision = 0; begin >     while (not agg_finished) >     do >     begin >         if (i is not null) then >

Re: [Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Dimitry Sibiryakov
28.09.2018 18:34, Adriano dos Santos Fernandes wrote: Design is open if good alternatives are presented. Initially I think: Why not simply borrow Oracle concepts as you did with packages? -- WBR, SD. Firebird-Devel mailing list, web interface at

[Firebird-devel] User-defined aggregate functions

2018-09-28 Thread Adriano dos Santos Fernandes
Hi! I propose creation of user-defined aggregate functions. Lets initially define the requirements for it: - It should work with empty data set too, in case of use without GROUP BY clause: i.e., COUNT results in 0, while most others functions result in NULL - It should also produce "running (or