Unverified Commit e16b3010 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Optimization] Default value judgment for supplementary types (#3475)

parent e2070b74
......@@ -114,7 +114,10 @@ public class MySqlDriver extends AbstractJdbcDriver {
final String dv = column.getDefaultValue();
// If it defaults to a numeric type, there is no need to include single quotes or a bit type
String defaultValueTag = " DEFAULT '%s'";
if (NumberUtil.isNumber(dv) || columnType.startsWith("bit")) {
if (NumberUtil.isNumber(dv)
|| columnType.startsWith("bit")
|| (StrUtil.isNotEmpty(dv)
&& dv.toLowerCase().trim().matches("^current_timestamp.*"))) {
defaultValueTag = " DEFAULT %s";
}
String defaultValue = Asserts.isNotNull(dv)
......
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