Merge pull request #124 from feitian124/ming

parser: 解析出错时打印出错的行信息
This commit is contained in:
Moshow郑锴 2021-10-31 00:48:51 +08:00 committed by GitHub
commit 7e93e91478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,7 +173,13 @@ public class TableParseUtil {
String columnName = "";
columnLine = columnLine.replaceAll("`", " ").replaceAll("\"", " ").replaceAll("'", "").replaceAll(" ", " ").trim();
//如果遇到username varchar(65) default '' not null,这种情况判断第一个空格是否比第一个引号前
columnName = columnLine.substring(0, columnLine.indexOf(" "));
try {
columnName = columnLine.substring(0, columnLine.indexOf(" "));
} catch (StringIndexOutOfBoundsException e) {
System.out.println("err happened: " + columnLine);
throw e;
}
// field Name
// 2019-09-08 yj 添加是否下划线转换为驼峰的判断
String fieldName = null;