[jOOQ/jOOQ#13818] MySQL DEFAULT CURRENT_TIMESTAMP column is generated as

computed column
This commit is contained in:
Lukas Eder 2022-07-22 10:52:26 +02:00
parent 78d1affb8f
commit 5711379dd9

View File

@ -113,7 +113,6 @@ public class MySQLTableDefinition extends AbstractTableDefinition {
boolean displayWidths = getDatabase().integerDisplayWidths();
// [#6492] MariaDB supports a standard IS_GENERATED, but MySQL doesn't (yet)
boolean generated = record.get(COLUMNS.EXTRA) != null && record.get(COLUMNS.EXTRA).toUpperCase().contains("GENERATED");
GenerationOption generationOption =
"VIRTUAL GENERATED".equalsIgnoreCase(record.get(COLUMNS.EXTRA))
? GenerationOption.VIRTUAL
@ -121,6 +120,9 @@ public class MySQLTableDefinition extends AbstractTableDefinition {
? GenerationOption.STORED
: null;
// [#13818] Some DEFAULT expressions (e.g. CURRENT_TIMESTAMP) produce a DEFAULT_GENERATED value in EXTRA
boolean generated = generationOption != null;
columnTypeFix:
if (unsigned || displayWidths) {
if (asList("tinyint", "smallint", "mediumint", "int", "bigint").contains(dataType.toLowerCase())) {