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

fix:fix json error

上级 a3898d3a
......@@ -1117,6 +1117,7 @@ bool nodesIsComparisonOp(const SOperatorNode* pOp) {
bool nodesIsJsonOp(const SOperatorNode* pOp) {
switch (pOp->opType) {
case OP_TYPE_JSON_GET_VALUE:
case OP_TYPE_JSON_CONTAINS:
return true;
default:
break;
......
......@@ -1089,7 +1089,7 @@ void makeCalculate(void *json, void *key, int32_t rightType, void *rightData, do
}else if(opType == OP_TYPE_ADD || opType == OP_TYPE_SUB || opType == OP_TYPE_MULTI || opType == OP_TYPE_DIV ||
opType == OP_TYPE_MOD || opType == OP_TYPE_MINUS){
printf("1result:%f,except:%f\n", *((double *)colDataGetData(column, 0)), exceptValue);
ASSERT_TRUE(abs(*((double *)colDataGetData(column, 0)) - exceptValue) < 1e-15);
ASSERT_TRUE(fabs(*((double *)colDataGetData(column, 0)) - exceptValue) < DBL_EPSILON);
}else if(opType == OP_TYPE_BIT_AND || opType == OP_TYPE_BIT_OR){
printf("2result:%ld,except:%f\n", *((int64_t *)colDataGetData(column, 0)), exceptValue);
ASSERT_EQ(*((int64_t *)colDataGetData(column, 0)), exceptValue);
......
......@@ -130,17 +130,17 @@ class TDTestCase:
# test select json tag
tdSql.query("select * from jsons1")
tdSql.checkRows(9)
tdSql.checkRows(8)
tdSql.query("select jtag from jsons1")
tdSql.checkRows(13)
tdSql.checkRows(7)
# tdSql.query("select jtag from jsons1 where jtag is null")
# tdSql.checkRows(5)
# tdSql.query("select jtag from jsons1 where jtag is not null")
# tdSql.checkRows(8)
# test jtag is NULL
tdSql.query("select jtag from jsons1_9")
tdSql.checkData(0, 0, None)
#tdSql.query("select jtag from jsons1_9")
#tdSql.checkData(0, 0, None)
# test select json tag->'key', value is string
tdSql.query("select jtag->'tag1' from jsons1_1")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册