[TD-6011]<fix>: where clause including 'bool' Keyword causes core dump

This commit is contained in:
Ganlin Zhao 2021-08-18 17:31:20 +08:00
parent fa9f76fc9d
commit 34f4f8ca01
1 changed files with 4 additions and 4 deletions

View File

@ -38,12 +38,12 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
switch (token->type) {
case TSDB_DATA_TYPE_BOOL: {
int32_t k = strncasecmp(token->z, "true", 4);
if (k == 0) {
if (strncasecmp(token->z, "true", 4) == 0) {
pVar->i64 = TSDB_TRUE;
} else {
assert(strncasecmp(token->z, "false", 5) == 0);
} else if (strncasecmp(token->z, "false", 5) == 0) {
pVar->i64 = TSDB_FALSE;
} else {
return;
}
break;