Bug #32478 Udf HAVING problem

Submitted: 18 Nov 2007 12:44 Modified: 19 Dec 2007 7:42
Reporter: ngs ngs Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[18 Nov 2007 12:44] ngs ngs
Description:
But when i use my own udf suma with clause HAVING -> killing server.
#create aggregate function suma returns integer soname 'sample.dll';

select x,suma(y) suma,count(*) from xy group by x #this work ok, but

select x,suma(y) suma,count(*) from xy group by x having suma>0;#problem!

How to repeat:
#5.0.45-community-nt-log

CREATE TABLE `xy` (
  `x` int(11) default NULL,
  `y` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

INSERT INTO xy  (x, y) VALUES  (1, 10);
INSERT INTO xy  (x, y) VALUES  (2, 20);
INSERT INTO xy  (x, y) VALUES  (2, 2);
INSERT INTO xy  (x, y) VALUES  (1, 1);
INSERT INTO xy  (x, y) VALUES  (3, 0);

#table xy
#x y
#1 10
#2 20
#2 2
#1 1
#3 0

select x,sum(y) suma,count(*)
from xy
group by x
having suma>0;

#result
#x suma count(*)
#1 11 2
#2 22 2

This is all ok .

select x,suma(y) suma,count(*)
from xy
group by x

#result
#x suma count(*) 
#1 11 2
#2 22 2
#3 0 1

This is all ok

 

But when i use my own udf suma with clause HAVING -> killing server.
#create aggregate function suma returns integer soname 'sample.dll';

select x,suma(y) suma,count(*)
from xy
group by x
having suma>0;#hier is problem!!!!!

Killing server;
Stop
Why?
[18 Nov 2007 16:57] ngs ngs
But when i use my own udf suma with clause HAVING -> killing server.
#create aggregate function suma returns integer soname 'sample.dll';
select x,suma(y) suma,count(*) from xy group by x #this work ok, but
select x,suma(y) suma,count(*) from xy group by x having
suma>0;#problem!
How to repeat:
#5.0.45-community-nt-log

In 5.1.11-beta version work
[19 Nov 2007 7:42] Sveta Smirnova
Thank you for the report.

Please provide sources for your function suma.
[20 Dec 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.