Merge pull request #5081 from taosdata/hotfix/TD-2878
[TD-2878]taos crash when an id following like in query sql
This commit is contained in:
commit
4ceea4838b
|
@ -3440,6 +3440,7 @@ static int32_t getTagCondString(tSQLExpr* pExpr, char** str) {
|
||||||
|
|
||||||
static int32_t getTablenameCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExpr* pTableCond, SStringBuilder* sb) {
|
static int32_t getTablenameCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExpr* pTableCond, SStringBuilder* sb) {
|
||||||
const char* msg0 = "invalid table name list";
|
const char* msg0 = "invalid table name list";
|
||||||
|
const char* msg1 = "not string following like";
|
||||||
|
|
||||||
if (pTableCond == NULL) {
|
if (pTableCond == NULL) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -3457,6 +3458,10 @@ static int32_t getTablenameCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExpr*
|
||||||
if (pTableCond->nSQLOptr == TK_IN) {
|
if (pTableCond->nSQLOptr == TK_IN) {
|
||||||
ret = tablenameListToString(pRight, sb);
|
ret = tablenameListToString(pRight, sb);
|
||||||
} else if (pTableCond->nSQLOptr == TK_LIKE) {
|
} else if (pTableCond->nSQLOptr == TK_LIKE) {
|
||||||
|
if (pRight->nSQLOptr != TK_STRING) {
|
||||||
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
||||||
|
}
|
||||||
|
|
||||||
ret = tablenameCondToString(pRight, sb);
|
ret = tablenameCondToString(pRight, sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue