提交 b76db21a 编写于 作者: S shenglian zhou

change MACRO name that represent num of scalar functions

上级 f1c1501b
......@@ -70,7 +70,7 @@ struct SSchema;
#define TSDB_FUNC_SCALAR_LTRIM (TSDB_FUNC_FLAG_SCALAR | 0x0014)
#define TSDB_FUNC_SCALAR_RTRIM (TSDB_FUNC_FLAG_SCALAR | 0x0015)
#define TSDB_FUNC_SCALAR_SUBSTR (TSDB_FUNC_FLAG_SCALAR | 0x0016)
#define TSDB_FUNC_SCALAR_MAX_NUM 23
#define TSDB_FUNC_SCALAR_NUM_FUNCTIONS 23
#define TSDB_FUNC_SCALAR_NAME_MAX_LEN 16
......@@ -92,7 +92,7 @@ typedef struct tScalarFunctionInfo{
} tScalarFunctionInfo;
/* global scalar sql functions array */
extern struct tScalarFunctionInfo aScalarFunctions[TSDB_FUNC_SCALAR_MAX_NUM];
extern struct tScalarFunctionInfo aScalarFunctions[TSDB_FUNC_SCALAR_NUM_FUNCTIONS];
typedef bool (*__result_filter_fn_t)(const void *, void *);
......
......@@ -1854,7 +1854,7 @@ void vectorMathFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn
_expr_scalar_function_t getExprScalarFunction(uint16_t funcId) {
assert(TSDB_FUNC_IS_SCALAR(funcId));
int16_t scalaIdx = TSDB_FUNC_SCALAR_INDEX(funcId);
assert(scalaIdx>=0 && scalaIdx <= TSDB_FUNC_SCALAR_MAX_NUM);
assert(scalaIdx>=0 && scalaIdx <= TSDB_FUNC_SCALAR_NUM_FUNCTIONS);
return aScalarFunctions[scalaIdx].scalarFunc;
}
......
......@@ -513,7 +513,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
// TODO use hash table
int32_t isValidFunction(const char* name, int32_t len) {
for (int32_t i = 0; i < TSDB_FUNC_SCALAR_MAX_NUM; ++i) {
for (int32_t i = 0; i < TSDB_FUNC_SCALAR_NUM_FUNCTIONS; ++i) {
int32_t nameLen = (int32_t) strlen(aScalarFunctions[i].name);
if (len != nameLen) {
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册