Skip to content

Commit

Permalink
5126 fix extra column info for mariadb database
Browse files Browse the repository at this point in the history
  • Loading branch information
LonwoLonwo committed Oct 26, 2023
1 parent 84ab156 commit ad33006
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ private void readDefaultValueForMysqlDatabase(CachedRow columnMetadataResultSet,
"WHERE TABLE_SCHEMA = '" + column.getSchema().getName() + "'\n" +
"AND TABLE_NAME = '" + column.getRelation().getName() + "'\n" +
"AND COLUMN_NAME = '" + column.getName() + "'"), String.class);
if (extraValue != null && extraValue.startsWith(MYSQL_DEFAULT_GENERATED + " ")) {
if (extraValue != null && !extraValue.isEmpty() &&
(extraValue.startsWith(MYSQL_DEFAULT_GENERATED + " ") || extraValue.toLowerCase(Locale.ENGLISH).contains("on update"))
) {
columnMetadataResultSet.set(COLUMN_DEF_COL,
String.format("%s %s", columnMetadataResultSet.get(COLUMN_DEF_COL), extraValue.replace(MYSQL_DEFAULT_GENERATED, "").trim()));
}
Expand Down

0 comments on commit ad33006

Please sign in to comment.