Commit 57f62d2c authored by wenmo's avatar wenmo

fix bug metabase

parent 5cd8b3a7
......@@ -129,10 +129,10 @@ public class Table implements Serializable, Comparable<Table> {
sb.append(",");
}
String columnComment= columns.get(i).getComment();
if(columnComment.contains("\'") | columnComment.contains("\"")) {
columnComment = columnComment.replaceAll("\"|'","");
}
if(Asserts.isNotNullString(columnComment)){
if (columnComment.contains("\'") | columnComment.contains("\"")) {
columnComment = columnComment.replaceAll("\"|'", "");
}
sb.append("`"+columns.get(i).getName() + "` -- " + columnComment + " \n");
}else {
sb.append("`"+columns.get(i).getName() + "` \n");
......
......@@ -208,7 +208,7 @@ public abstract class AbstractJdbcDriver extends AbstractDriver {
if(columnList.contains(dbQuery.columnType())) {
field.setType(results.getString(dbQuery.columnType()));
}
if(columnList.contains(dbQuery.columnComment())) {
if(columnList.contains(dbQuery.columnComment())&& Asserts.isNotNull(results.getString(dbQuery.columnComment()))) {
String columnComment = results.getString(dbQuery.columnComment()).replaceAll("\"|'", "");
field.setComment(columnComment);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment