The enums are just a way to access the error codes symbolically. Usually, the error codes in
Trafodion have ranges assigned to different components of the Trafodion engine. The errors
originating in catalog manager component are expected to be CmpDDLCatErrorCodes.h and the
errors originating in executor component are in exp/ExpErrorEnums.h. However, these grouping
are not strictly enforced. At times, the error codes are used without enums (symbolic names).
There are many helper functions to populate the diagnostics area. Most often used functions
are
ExRaiseSqlErrors
DgSqlCode DgString, DgInt
ExRaiseSqlError is used in executor and mostly in work method of operators. It can be used
when diagnostics area is not already allocated. This method allocates the diagnostics area
and passes back to the caller.
DgSqlCode concept is used in other areas of Trafodion when diagnostics area is already allocated
and available.
See https://issues.apache.org/jira/browse/TRAFODION-3009 and https://issues.apache.org/jira/browse/TRAFODION-2853
for details of the change that streamlined this concept to some extent.
Selva
-----Original Message-----
From: Zhu, Wen-Jun <wenjun.zhu@esgyn.cn>
Sent: Tuesday, April 10, 2018 1:39 AM
To: dev@trafodion.apache.org
Subject: issues on error message
Hi,
I am trying to add some error message in SqlciErrors.txt when new error happens.
As far as I know, it uses message catalog, and the error number is a enum in CmpDDLCatErrorCodes.h.
I guess there is a map between these two files, but it is not exactly mapped.
Are there rules about this? Like feed DgSqlCode constructor with enum, not magic number, or
something like this And what should I take care of?
|