未验证 提交 ab8743e8 编写于 作者: L Liao Lanyu 提交者: GitHub

Change Expression priority in IoTDBSqlparser.g4

上级 1c0c4e75
......@@ -223,4 +223,22 @@ public class IoTDBArithmeticIT {
assertTrue(throwable.getMessage().contains("Invalid input expression data type."));
}
}
@Test
public void testNot() {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("select not(s5), !s5 from root.sg.d1"); ) {
String[] retArray = new String[] {"true", "true", "false", "false", "false"};
int cnt = 0;
while (resultSet.next()) {
assertEquals(retArray[cnt], resultSet.getString(2));
assertEquals(retArray[cnt], resultSet.getString(3));
cnt++;
}
assertEquals(retArray.length, cnt);
} catch (SQLException throwable) {
fail();
}
}
}
......@@ -1137,9 +1137,9 @@ expression
| time=(TIME | TIMESTAMP)
| caseWhenThenExpression
| fullPathInExpression
| (PLUS | MINUS | operator_not) expressionAfterUnaryOperator=expression
| scalarFunctionExpression
| functionName LR_BRACKET expression (COMMA expression)* RR_BRACKET
| (PLUS | MINUS | operator_not) expressionAfterUnaryOperator=expression
| leftExpression=expression (STAR | DIV | MOD) rightExpression=expression
| leftExpression=expression (PLUS | MINUS) rightExpression=expression
| leftExpression=expression (OPERATOR_GT | OPERATOR_GTE | OPERATOR_LT | OPERATOR_LTE | OPERATOR_SEQ | OPERATOR_DEQ | OPERATOR_NEQ) rightExpression=expression
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册