DB2 - Problem description
| Problem IC99128 | Status: Closed |
DB2 MAY TRAP IF AGGREGATE FUNCTION NAME IS USED AS AN ARGUMENT TO NESTED PROCEDURE CALL STATEMENT | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
| Problem description: | |
The DB2 instance may crash when attempting to create a stored
procedure that contains a CALL statement that includes an
aggregate function as an argument. This could happen if the
aggregate function was meant to be defined as a variable but was
not properly declared.
For example, the following CREATE PROCEDURE statement could
cause this failure:
CREATE PROCEDURE P2()
BEGIN
CALL P1(COUNT);
END
A trap file will be produced containing a stack trace that looks
like this:
_Z25ossDumpStackTraceInternalmR11OSSTrapFileiP7siginfoPvmm +
0x020a
ossDumpStackTraceV98 + 0x002b
_ZN11OSSTrapFile6dumpExEmiP7siginfoPvm + 0x0103
sqlo_trce + 0x0407
sqloEDUCodeTrapHandler + 0x0277
address: 0x00002AAAAABD4D60 ; dladdress: 0x00002AAAAABC7000 ;
offset in lib: 0x000000000000DD60 ;
_ZNK17sqlnq_expprdchild2ppEv + 0x0000
_Z17sqlnq_psm_sem_actPP8stknode_i10actiontypePhP3loc + 0xb751
_Z12sqlnp_smactnP8sqlnp_cbi + 0x0a3b
_Z12sqlnp_parserP8sqlnp_cb + 0x0221
_Z10sqlnp_mainP12sqlnq_stringbP3locPP9sqlnq_qur + 0x08e4
_Z10sqlnn_cmplP8sqeAgentP11sqlrrstrings17sqlnn_compileModesP14sq
lrr_cmpl_enviiPP9sqlnq_qur + 0x0b21
_Z10sqlnn_cmplP8sqeAgentP11sqlrrstrings17sqlnn_compileModesP14sq
lrr_cmpl_env + 0x0021
_Z17sqlra_compile_varP8sqlrr_cbP14sqlra_cmpl_envPhitiiiiiP14SQLP
_LOCK_INFOP16sqlra_cached_varPi + 0x0822
_Z14sqlra_find_varP8sqlrr_cbP17sqlra_cached_stmt13sqlra_stmt_idj
jPhjthP14sqlra_cmpl_env15sqlra_fill_modePiiS8_iiiS8_P14SQLP_LOCK
_INFOPP16sqlra_cached_varS8_b + 0x05f0
_Z13sqlra_get_varP8sqlrr_cbiibPbS1_ + 0x08a2
_Z21sqlri_ddl_get_sectionP8sqlrr_cb + 0x005c
_Z16sqlri_ddl_commonP8sqlrr_cb + 0x0361
_Z8sqlriddlP8sqlrr_cb + 0x0027
_Z15sqlriSectInvokeP8sqlrr_cbP12sqlri_opparm + 0x01ad
_Z23sqlrr_execute_immediateP8sqlrr_cbi + 0x04bd
_Z14sqlrr_execimmdP14db2UCinterfaceP16db2UCprepareInfo + 0x0135
_Z19sqljs_ddm_excsqlimmP14db2UCinterfaceP13sqljDDMObject +
0x05ac
_Z21sqljsParseRdbAccessedP13sqljsDrdaAsCbP13sqljDDMObjectP14db2U
Cinterface + 0x03a6
_Z10sqljsParseP13sqljsDrdaAsCbP14db2UCinterfaceP8sqeAgentb +
0x0377
With this APAR, DB2 will instead return a proper error message
on the CREATE PROCEDURE statement.
For example, it will now return:
SQL0120N Invalid use of an aggregate function or OLAP function.
SQLSTATE=42903 | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.1, Fixpack 4 * **************************************************************** | |
| Local Fix: | |
Modify the stored procedure to remove the aggregate function as an argument to the nested stored procedure. | |
| available fix packs: | |
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows | |
| Solution | |
First fixed in DB2 Version 10.1, Fixpack 4 | |
| Workaround | |
see Local Fix | |
| BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC99129 IC99130 follow-up : | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 03.02.2014 24.06.2014 24.06.2014 |
| Problem solved at the following versions (IBM BugInfos) | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 10.1.0.4 |
|