fix(query): fix invalid read.
This commit is contained in:
parent
d18dd3067b
commit
b92de1e9e6
|
@ -850,8 +850,7 @@ static SSDataBlock* createTagValBlockForFilter(SArray* pColList, int32_t numOfTa
|
|||
tagVal.cid = pColInfo->info.colId;
|
||||
if (p1->pTagVal == NULL) {
|
||||
colDataSetNULL(pColInfo, i);
|
||||
}
|
||||
|
||||
} else {
|
||||
const char* p = metaGetTableTagVal(p1->pTagVal, pColInfo->info.type, &tagVal);
|
||||
|
||||
if (p == NULL || (pColInfo->info.type == TSDB_DATA_TYPE_JSON && ((STag*)p)->nTag == 0)) {
|
||||
|
@ -880,6 +879,7 @@ static SSDataBlock* createTagValBlockForFilter(SArray* pColList, int32_t numOfTa
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pResBlock;
|
||||
}
|
||||
|
|
|
@ -2101,9 +2101,9 @@ void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal) {
|
|||
case TSDB_DATA_TYPE_NCHAR:
|
||||
case TSDB_DATA_TYPE_VARCHAR:
|
||||
case TSDB_DATA_TYPE_VARBINARY:
|
||||
pVal->pz = taosMemoryMalloc(pVal->nLen + VARSTR_HEADER_SIZE + 1);
|
||||
memcpy(pVal->pz, pNode->datum.p, pVal->nLen + VARSTR_HEADER_SIZE);
|
||||
pVal->pz[pVal->nLen + VARSTR_HEADER_SIZE] = 0;
|
||||
pVal->pz = taosMemoryMalloc(pVal->nLen + 1);
|
||||
memcpy(pVal->pz, pNode->datum.p, pVal->nLen);
|
||||
pVal->pz[pVal->nLen] = 0;
|
||||
break;
|
||||
case TSDB_DATA_TYPE_JSON:
|
||||
pVal->nLen = getJsonValueLen(pNode->datum.p);
|
||||
|
|
|
@ -98,6 +98,7 @@ SWords shellCommands[] = {
|
|||
{"describe <all_table>", 0, 0, NULL},
|
||||
{"delete from <all_table> where ", 0, 0, NULL},
|
||||
{"drop database <db_name>", 0, 0, NULL},
|
||||
{"drop index <anyword>", 0, 0, NULL},
|
||||
{"drop table <all_table>", 0, 0, NULL},
|
||||
{"drop dnode <dnode_id>", 0, 0, NULL},
|
||||
{"drop mnode on dnode <dnode_id> ;", 0, 0, NULL},
|
||||
|
@ -384,7 +385,7 @@ void showHelp() {
|
|||
create table <tb_name> using <stb_name> tags ...\n\
|
||||
create database <db_name> <db_options> ...\n\
|
||||
create dnode \"fqdn:port\" ...\n\
|
||||
create index ...\n\
|
||||
create index <index_name> on <stb_name> (tag_column_name);\n\
|
||||
create mnode on dnode <dnode_id> ;\n\
|
||||
create qnode on dnode <dnode_id> ;\n\
|
||||
create stream <stream_name> into <stb_name> as select ...\n\
|
||||
|
@ -404,6 +405,7 @@ void showHelp() {
|
|||
drop consumer group ... \n\
|
||||
drop topic <topic_name> ;\n\
|
||||
drop stream <stream_name> ;\n\
|
||||
drop index <index_name>;\n\
|
||||
----- E ----- \n\
|
||||
explain select clause ...\n\
|
||||
----- F ----- \n\
|
||||
|
@ -534,7 +536,7 @@ SWord* addWord(const char* p, int32_t len, bool pattern) {
|
|||
word->len = len;
|
||||
|
||||
// check format
|
||||
if (pattern) {
|
||||
if (pattern && len > 0) {
|
||||
word->type = wordType(p, len);
|
||||
} else {
|
||||
word->type = WT_TEXT;
|
||||
|
@ -1724,6 +1726,9 @@ bool matchEnd(TAOS* con, SShellCmd* cmd) {
|
|||
if (strlen(last) == 0) {
|
||||
goto _return;
|
||||
}
|
||||
if (strcmp(last, " ") == 0) {
|
||||
goto _return;
|
||||
}
|
||||
|
||||
// match database
|
||||
if (elast == NULL) {
|
||||
|
|
Loading…
Reference in New Issue