fix parser stack overflow issue
This commit is contained in:
parent
f5ce8c9df8
commit
6aece12755
|
@ -15,11 +15,15 @@
|
|||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define ALLOW_FORBID_FUNC
|
||||
|
||||
#include "functionMgt.h"
|
||||
#include "nodes.h"
|
||||
#include "parToken.h"
|
||||
#include "ttokendef.h"
|
||||
#include "parAst.h"
|
||||
|
||||
#define YYSTACKDEPTH 0
|
||||
}
|
||||
|
||||
%syntax_error {
|
||||
|
|
|
@ -76,28 +76,8 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
|||
int32_t inputSize = (NULL != pParam->length ? *(pParam->length) : tDataTypes[pParam->buffer_type].bytes);
|
||||
pVal->node.resType.type = pParam->buffer_type;
|
||||
pVal->node.resType.bytes = inputSize;
|
||||
|
||||
switch (pParam->buffer_type) {
|
||||
case TSDB_DATA_TYPE_BOOL:
|
||||
pVal->datum.b = *((bool*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_TINYINT:
|
||||
pVal->datum.i = *((int8_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_SMALLINT:
|
||||
pVal->datum.i = *((int16_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_INT:
|
||||
pVal->datum.i = *((int32_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_BIGINT:
|
||||
pVal->datum.i = *((int64_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_FLOAT:
|
||||
pVal->datum.d = *((float*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_DOUBLE:
|
||||
pVal->datum.d = *((double*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_VARCHAR:
|
||||
case TSDB_DATA_TYPE_VARBINARY:
|
||||
pVal->datum.p = taosMemoryCalloc(1, pVal->node.resType.bytes + VARSTR_HEADER_SIZE + 1);
|
||||
|
@ -124,28 +104,13 @@ static int32_t setValueByBindParam(SValueNode* pVal, TAOS_MULTI_BIND* pParam) {
|
|||
pVal->node.resType.bytes = output + VARSTR_HEADER_SIZE;
|
||||
break;
|
||||
}
|
||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||
pVal->datum.i = *((int64_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_UTINYINT:
|
||||
pVal->datum.u = *((uint8_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_USMALLINT:
|
||||
pVal->datum.u = *((uint16_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_UINT:
|
||||
pVal->datum.u = *((uint32_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_UBIGINT:
|
||||
pVal->datum.u = *((uint64_t*)pParam->buffer);
|
||||
break;
|
||||
case TSDB_DATA_TYPE_JSON:
|
||||
case TSDB_DATA_TYPE_DECIMAL:
|
||||
case TSDB_DATA_TYPE_BLOB:
|
||||
case TSDB_DATA_TYPE_MEDIUMBLOB:
|
||||
// todo
|
||||
default:
|
||||
default: {
|
||||
int32_t code = nodesSetValueNodeValue(pVal, pParam->buffer);
|
||||
if (code) {
|
||||
return code;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pVal->translate = true;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue