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

View File

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