瀏覽代碼

Internal: OQL error reporting

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4717 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 年之前
父節點
當前提交
4988d1d8d7
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      core/dbobjectsearch.class.php

+ 2 - 0
core/dbobjectsearch.class.php

@@ -411,12 +411,14 @@ class DBObjectSearch extends DBSearch
 
 		case "IN":
 			if (!is_array($value)) $value = array($value);
+			if (count($value) === 0) throw new Exception('AddCondition '.$sOpCode.': Value cannot be an empty array.');
 			$sListExpr = '('.implode(', ', CMDBSource::Quote($value)).')';
 			$sOQLCondition = $oField->Render()." IN $sListExpr";
 			break;
 
 		case "NOTIN":
 			if (!is_array($value)) $value = array($value);
+            if (count($value) === 0) throw new Exception('AddCondition '.$sOpCode.': Value cannot be an empty array.');
 			$sListExpr = '('.implode(', ', CMDBSource::Quote($value)).')';
 			$sOQLCondition = $oField->Render()." NOT IN $sListExpr";
 			break;