提交 2a271b0b 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> add tag?'key' in where logic

上级 258478ae
......@@ -4408,7 +4408,7 @@ static int32_t validateLikeExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_t
}
SSchema* pSchema = tscGetTableSchema(pTableMeta);
if ((!isTablenameToken(&pLeft->columnName)) && !IS_VAR_DATA_TYPE(pSchema[index].type)) {
if ((pLeft->tokenId != TK_ARROW) && (!isTablenameToken(&pLeft->columnName)) && !IS_VAR_DATA_TYPE(pSchema[index].type)) {
return invalidOperationMsg(msgBuf, msg2);
}
}
......@@ -4464,7 +4464,7 @@ static int32_t validateMatchExpr(tSqlExpr* pExpr, STableMeta* pTableMeta, int32_
}
SSchema* pSchema = tscGetTableSchema(pTableMeta);
if ((!isTablenameToken(&pLeft->columnName)) &&(pSchema[index].type != TSDB_DATA_TYPE_BINARY)) {
if ((pLeft->tokenId != TK_ARROW) && (!isTablenameToken(&pLeft->columnName)) && (pSchema[index].type != TSDB_DATA_TYPE_BINARY)) {
return invalidOperationMsg(msgBuf, msg2);
}
......
......@@ -2684,7 +2684,7 @@ static int32_t getAllTableList(STable* pSuperTable, SArray* list) {
while(pRecord){
SArray* tallistOld = *pRecord;
for (int i = 0; i < taosArrayGetSize(tallistOld); ++i) {
for (int i = 0; i < taosArrayGetSize(tallistOld); ++i) { // sort to elimate dumplicate
void* element = taosArrayGet(tallistOld, i);
void* pFind = taosArraySearch(tablist, element, tsdbCompareJsonMapValue, TD_EQ);
if(pFind == NULL){
......
......@@ -88,7 +88,11 @@ class TDTestCase:
tdSql.checkData(0, 0, "femail")
tdSql.checkRows(3)
tdSql.query("select *,tbname from db_json_tag_test.jsons1 where jtag->'location'='beijing'")
tdSql.checkRows(3)
tdSql.query("select *,tbname from db_json_tag_test.jsons1 where jtag->'num'=5 or jtag?'sex'")
tdSql.checkRows(2)
def stop(self):
tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册