提交 7d8d5889 编写于 作者: wmmhello's avatar wmmhello

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

上级 a6ac7d9f
...@@ -2685,10 +2685,15 @@ static int32_t getAllTableList(STable* pSuperTable, SArray* list) { ...@@ -2685,10 +2685,15 @@ static int32_t getAllTableList(STable* pSuperTable, SArray* list) {
while(pRecord){ while(pRecord){
SArray* tallistOld = *pRecord; SArray* tallistOld = *pRecord;
for (int i = 0; i < taosArrayGetSize(tallistOld); ++i) { for (int i = 0; i < taosArrayGetSize(tallistOld); ++i) {
void* p = taosArrayGet(tallistOld, i); void* element = taosArrayGet(tallistOld, i);
void* pFind = taosArraySearch(tablist, p, tsdbCompareJsonMapValue, TD_EQ); void* pFind = taosArraySearch(tablist, element, tsdbCompareJsonMapValue, TD_EQ);
if(pFind == NULL){ if(pFind == NULL){
taosArrayPush(tablist, p); void* p = taosArraySearch(tablist, element, tsdbCompareJsonMapValue, TD_GE);
if(p == NULL){
taosArrayPush(tablist, element);
}else{
taosArrayInsert(tablist, TARRAY_ELEM_IDX(tablist, p), element);
}
} }
} }
pRecord = taosHashIterate(pSuperTable->jsonKeyMap, pRecord); pRecord = taosHashIterate(pSuperTable->jsonKeyMap, pRecord);
......
...@@ -56,7 +56,7 @@ class TDTestCase: ...@@ -56,7 +56,7 @@ class TDTestCase:
tdSql.query("select * from db_json_tag_test.jsons1") tdSql.query("select * from db_json_tag_test.jsons1")
tdSql.checkRows(4) tdSql.checkRows(4)
tdSql.error("select * from db_json_tag_test.jsons1 where jtag->'location'=4") tdSql.error("select * from db_json_tag_test.jsons1 where jtag->'location'=4")
tdSql.query("select * from db_json_tag_test.jsons1 where jtag->'location'='beijing'") tdSql.query("select * from db_json_tag_test.jsons1 where jtag->'location'='beijing'")
...@@ -89,6 +89,7 @@ class TDTestCase: ...@@ -89,6 +89,7 @@ class TDTestCase:
tdSql.checkRows(3) tdSql.checkRows(3)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册