Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1504#discussion_r178932278
--- Diff: core/sql/executor/ExExeUtilCommon.cpp ---
@@ -669,7 +669,9 @@ short ExExeUtilTcb::executeQuery(char * task,
char * stringParam1 = NULL;
Lng32 intParam1 = ComDiags_UnInitialized_Int;
- retcode =
(short)cliInterface()->retrieveSQLDiagnostics(getDiagsArea());
+
setDiagsArea(cliInterface()->allocAndRetrieveSQLDiagnostics(getDiagsArea()));
+ if (getDiagsArea() != NULL)
+ retcode = 0;
--- End diff --
Yes. We can rely on that assumption. It is strange that the earlier code
sets the sqlcode to the return code of SQL_EXEC_MergeDiagnosticsInternal to be
the sqlcode. See line 700 below. When we are able to obtain the diagnostics
area, the sqlcode is set the main error code
---