Hi, Yes! Glad you asked.
The error message numbers are organized by what part of the software raises them. Messages 1000 - 1999 are raised by the DDL code (core/sql/sqlcomp/* modules) -- use the enum in sqlcomp/CmpDDLCatErrorCodes.h Messages 2000 - 2999 are raised by the mainline code of the SQL compiler process (core/sql/arkcmp/* modules + the core/sql/sqlcomp/* modules that aren't DDL modules) Messages 3000 - 3999 are raised by the parser code (core/sql/parser/*) Messages 4000 - 4999 are raised by the binder code (core/sql/optimizer/Bind*) Messages 5000 - 5999 are raised by the normalizer code (core/sql/optimizer/Norm*) Messages 6000 - 6999 are raised by the optimizer code (core/sql/optimizer/ <everything else> ) -- use the enum in optimizer/opt_error.h Messages 7000 - 7999 are raised by the generator code (core/sql/generator/*) Messages 8000 - 8999 are raised by the executor code (core/sql/executor/* and core/sql/exp/*) -- use the enum in exp/ExpErrorEnums.h Messages 9200 - 9299 are raised by the update statistics code (core/sql/ustat/*) -- use the enum in ustat/hs_const.h Messages 10000 - 10049 are raised by the run-time sort code (core/sql/sort/*) -- use the enum in sort/SortError.h Messages 11100 - 11399 are raised by the UDR server and language manager code (core/sql/udrserv/*) -- use the num in udrserv/udrdefs.h As you can see, not all of the error message ranges have corresponding enum files; we did not have a unified convention for this when we originally wrote the code unfortunately. When you add an error message, be sure to also add a description to the SQL Messages Guide. See http://trafodion.apache.org/docs/messages_guide/index.html for the latest version. The source for it can be found in $TRAF_HOME/../../docs/messages_guide/src/asciidoc/_chapters. Dave -----Original Message----- From: Zhu, Wen-Jun <wenjun....@esgyn.cn> Sent: Tuesday, April 10, 2018 1:39 AM To: email@example.com 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?