Skip to content

Commit

Permalink
0003484: MySQL tinyint columns can be sent as boolean columns through
Browse files Browse the repository at this point in the history
DDL statements
  • Loading branch information
jumpmind-josh committed Mar 9, 2018
1 parent 3bfc5aa commit c8abc97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Expand Up @@ -428,6 +428,8 @@ private ParameterConstants() {

public final static String NODE_LOAD_ONLY = "load.only";

public final static String MYSQL_TINYINT_DDL_TO_BOOLEAN = "mysql.tinyint.ddl.to.boolean";

public static Map<String, ParameterMetaData> getParameterMetaData() {
return parameterMetaData;
}
Expand Down
Expand Up @@ -2255,6 +2255,14 @@ public CsvData next() {
}

}
if (parameterService.is(ParameterConstants.MYSQL_TINYINT_DDL_TO_BOOLEAN, false)) {
for (Column column : copyTargetTable.getColumns()) {
if (column.getJdbcTypeCode() == Types.TINYINT) {
column.setJdbcTypeCode(Types.BOOLEAN);
column.setMappedTypeCode(Types.BOOLEAN);
}
}
}
data.setRowData(CsvUtils.escapeCsvData(DatabaseXmlUtil.toXml(db)));
}
}
Expand Down
Expand Up @@ -1852,6 +1852,13 @@ mssql.lock.escalation.disabled=true
# Type: boolean
mssql.include.catalog.in.triggers=true

# Allows MySQL columns of type tinyint to be sent to other platforms as boolean in ddl statements
#
# DatabaseOverridable: true
# Tags: mysql
# Type: boolean
mysql.tinyint.ddl.to.boolean=false

# For Sql Server, work around "Implicit conversion of varchar" issues by explicitly collating varchar
# columns in the database trigger. Relevant when the default database collation does not match the
# collation of the varchar columns of a table
Expand Down

0 comments on commit c8abc97

Please sign in to comment.