import com.mysql.jdbc.StringUtils; import com.mysql.jdbc.util.BaseBugReport; /** * @author hongjie.zhang * */ public class MyBugReport extends BaseBugReport{ @Override public void setUp() throws Exception {} @Override public void tearDown() throws Exception {} @Override public void runTest() throws Exception { String originalSql= "CALL a-bug.proc_stock(?,?)"; //mysql-connector-java 5.1.40 //com.mysql.jdbc.CallableStatement.extractProcedureName() String sanitizedSql = StringUtils.stripComments(originalSql, "`\"'", "`\"'", true, false, true, true); assertTrue("\""+sanitizedSql+"\" should be equal to \""+originalSql+"\"", originalSql.equals(sanitizedSql)); } public static void main(String[] args) throws Exception { new MyBugReport().run(); } }