Pārlūkot izejas kodu

HPCC-14997 Error 'First parameter of FETCH should be a disk file'

Add check for required disk file parameter
Shamser Ahmed 9 gadi atpakaļ
vecāks
revīzija
cb4b28fe76
3 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 0 1
      ecl/hql/hqlerrors.hpp
  2. 2 1
      ecl/hqlcpp/hqlcerrors.hpp
  3. 2 0
      ecl/hqlcpp/hqlsource.cpp

+ 0 - 1
ecl/hql/hqlerrors.hpp

@@ -199,7 +199,6 @@
 #define ERR_ASSERT_WRONGSCOPING     2131 /* Incorrect assertion scoping */
 #define ERR_ASSERT_BOOLEXPECTED     2132 /* Assertion must be boolean */
 #define ERR_SCOPE_USEDATASETINEXPR  2133 /* Use dataset in expression without proper context */
-#define ERR_FETCH_NON_DATASET       2134 /* Parameter to fetch isn't a dataset */
 
 #define ERR_MODIFIER_ILLCOMB        2141 /* Illegal combination of modifiers */
 #define ERR_EXPORTSHARECONFLICT     2142 /* EXPORT and SHARED cannot be specified together */

+ 2 - 1
ecl/hqlcpp/hqlcerrors.hpp

@@ -69,7 +69,7 @@
 #define HQLERR_RowTooLarge                      4043
 #define HQLERR_ShouldHaveBeenHoisted            4044
 #define HQLERR_NoArgumentsInValidator           4045
-
+#define HQLERR_FetchNonDiskfile                 4046
 #define HQLERR_InputMergeNotSorted              4047
 #define HQLERR_TooComplicatedToPreload          4048
 #define HQLERR_KeyedNotKeyed                    4049
@@ -371,6 +371,7 @@
 #define HQLERR_RowTooLarge_Text                 "Row size %u exceeds the maximum specified (%u)"
 #define HQLERR_ShouldHaveBeenHoisted_Text       "Select expression should have been hoisted"
 #define HQLERR_NoArgumentsInValidator_Text      "%s() cannot have a parameter inside a VALIDATE"
+#define HQLERR_FetchNonDiskfile_Text            "First parameter of FETCH should be a disk file"
 #define HQLERR_InputMergeNotSorted_Text         "Input to MERGE does not appear to be sorted"
 #define HQLERR_TooComplicatedToPreload_Text     "Expression is too complicated to preload"
 #define HQLERR_KeyedNotKeyed_Text               "KEYED(%s) could not be looked up in a key."

+ 2 - 0
ecl/hqlcpp/hqlsource.cpp

@@ -7252,6 +7252,8 @@ ABoundActivity * HqlCppTranslator::doBuildActivityFetch(BuildCtx & ctx, IHqlExpr
 {
     IHqlExpression *fetch = queryFetch(expr);
     IHqlExpression *tableExpr = queryPhysicalRootTable(fetch->queryChild(0));
+    if (!tableExpr)
+        throwError(HQLERR_FetchNonDiskfile);
     FetchBuilder info(*this, tableExpr, tableExpr->queryChild(0), expr);
     info.gatherVirtualFields(false, true);//?needToSerializeRecord(mode)