bug fixed for big or

This commit is contained in:
温少
2012-05-23 08:08:51 +08:00
parent 2d60fef9ed
commit a25096c211
3 changed files with 92 additions and 45 deletions
@@ -0,0 +1,23 @@
package com.alibaba.druid.bvt.sql;
import java.util.List;
import junit.framework.TestCase;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
public class BigOrTest extends TestCase {
public void testBigOr() throws Exception {
StringBuilder buf = new StringBuilder();
buf.append("SELECT * FROM T WHERE FID = ?");
for (int i = 0; i < 10000; ++i) {
buf.append(" OR FID = " + i);
}
String sql = buf.toString();
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, null);
String text = SQLUtils.toSQLString(stmtList.get(0));
System.out.println(text);
}
}