Bug #10382 Database instance killed by sql statement with function
Submitted: 5 May 2005 12:01 Modified: 5 Nov 2007 15:49
Reporter: Ties Meyer-Jark Email Updates:
Status: Closed Impact on me:
None 
Category:MaxDB Severity:S2 (Serious)
Version:7.5 OS:Windows (w2k)
Assigned to: Ulf Wendel CPU Architecture:Any

[5 May 2005 12:01] Ties Meyer-Jark
Description:
The following statement kills the database instance.
Select distinct dg.name, dg.id from dba.dienstgruppen dg left outer join 
dba.mapdigruperson mdg on
mdg.digruid = dg.id left outer join 
dba.person pe on 
mdg.personalid = pe.id left outer join 
domain.users du on
du.user_id = mdg.personalid
where dg.nurplanung = false and 
(du.username= 'JSCHO' or dba.adgp(dg.id))

Otherwise this one does not:
Select distinct dg.name, dg.id from dba.dienstgruppen dg left outer join 
dba.mapdigruperson mdg on
mdg.digruid = dg.id left outer join 
dba.person pe on 
mdg.personalid = pe.id left outer join 
domain.users du on
du.user_id = mdg.personalid
where dg.nurplanung = false and 
(du.username= 'JSCHO' or adgp(dg.id))

The function adgp always returns a boolean depending on the current user in the session but indepently of the value in brakes.
The function is as follows:
CREATE FUNCTION ADGP(ID INTEGER) RETURNS BOOLEAN AS
VAR 
CHECK BOOLEAN;
SELECT BE.ALLEDIENSTGRUPPENPLANEN FROM DBA.BERECHTIGUNGEN BE JOIN
DOMAIN.USERS DU ON 
DU.USER_ID = BE.ID WHERE DU.USERNAME = USER;
FETCH INTO :check;
RETURN CHECK;

the catalog is provided as file.

How to repeat:
Just do it again.

Suggested fix:
Dont use scheme.
[12 May 2005 9:37] Ulf Wendel
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

Ties,

I'm afraid I the catalog is not enough to reproduce your problem. I need the exact version number of the database and - more important - the definition of all SQL elements referenced in your dump file (some SP's are missing) plus the underlying data.

Regards,
Ulf
[12 May 2005 22:23] Ulf Wendel
Ties,

thanks for the additional informations. The alternative would have been to take a kernel trace of the crash, but that's usually not _that_ helpful.

I haven't looked into you files, did you provide the exact database version including the build number? Is it 7.5.00.16, 7.5.00.19, ...

Regards,
Ulf
[5 Nov 2007 15:49] Ulf Wendel
Meanwhile MaxDB is maintained by SAP. Please report the issue at SAP, see https://www.sdn.sap.com/irj/sdn/maxdb .