提交 004ca0fe 编写于 作者: X xywang

feat(query): shift allowed for columns

上级 06b88467
......@@ -5266,10 +5266,6 @@ static int32_t validateSQLExprItemOperatorExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, S
pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH ||
pExpr->tokenId == TK_CONTAINS || pExpr->tokenId == TK_IN) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "unsupported filtering operations");
} else if (pExpr->tokenId == TK_LSHIFT || pExpr->tokenId == TK_RSHIFT) {
if (rightType != SQLEXPR_TYPE_VALUE) {
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "non numeric right operand");
}
}
} else {
*type = SQLEXPR_TYPE_SCALAR;
......
此差异已折叠。
......@@ -261,10 +261,10 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
if (sptr != NULL) {
// select ... where col >> n op m ...;
match = regex_match(sptr + 2, "^\\s*[0-9]{1,}\\s*[\\>|\\<|\\<=|\\>=|=|!=]\\s*.*;\\s*$", REG_EXTENDED | REG_ICASE);
match = regex_match(sptr + 2, "^\\s*.{1,}\\s*[\\>|\\<|\\<=|\\>=|=|!=]\\s*.{1,};\\s*$", REG_EXTENDED | REG_ICASE);
if (match == 0) {
// select col >> n from ...;
match = regex_match(sptr + 2, "^\\s*[0-9]{1,}\\s*.*;\\s*$", REG_EXTENDED | REG_ICASE);
match = regex_match(sptr + 2, "^\\s*.{1,}\\s{1,}.{1,};\\s*$", REG_EXTENDED | REG_ICASE);
if (match == 0) {
cptr = tstrstr(command, ";", true);
if (cptr != NULL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册