diff --git a/sqlparser/seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/MySQLUpdateRecognizerTest.java b/sqlparser/seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/MySQLUpdateRecognizerTest.java index d8fdefb80b7..ad16c5bfea9 100644 --- a/sqlparser/seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/MySQLUpdateRecognizerTest.java +++ b/sqlparser/seata-sqlparser-druid/src/test/java/org/apache/seata/sqlparser/druid/MySQLUpdateRecognizerTest.java @@ -376,33 +376,4 @@ public void testGetUpdateColumns_2() { } } - @Test - public void testGetWhereColumns() { - String sql = "UPDATE t1 SET name1 = 'name1', name2 = 'name2' WHERE t1.id between ? and ? or `name1`= ? and name2= ?"; - - SQLStatement statement = getSQLStatement(sql); - - MySQLUpdateRecognizer mySQLUpdateRecognizer = new MySQLUpdateRecognizer(sql, statement); - List whereColumns = mySQLUpdateRecognizer.getWhereColumns(); - Assertions.assertEquals("id", whereColumns.get(0)); - Assertions.assertEquals("name1", whereColumns.get(1)); - Assertions.assertEquals("name2", whereColumns.get(2)); - sql = "UPDATE t1 SET name1 = 'name1', name2 = 'name2' WHERE id between ? and ?"; - - statement = getSQLStatement(sql); - - mySQLUpdateRecognizer = new MySQLUpdateRecognizer(sql, statement); - whereColumns = mySQLUpdateRecognizer.getWhereColumns(); - Assertions.assertEquals("id", whereColumns.get(0)); - - sql = "UPDATE t1 SET name1 = 'name1', name2 = 'name2' WHERE id in(?,? ) and createTime between ? and ?"; - - statement = getSQLStatement(sql); - - mySQLUpdateRecognizer = new MySQLUpdateRecognizer(sql, statement); - whereColumns = mySQLUpdateRecognizer.getWhereColumns(); - Assertions.assertEquals("id", whereColumns.get(0)); - Assertions.assertEquals("createTime", whereColumns.get(1)); - } - }