[jOOQ/jOOQ#17344] MetaImpl and code generator should ignore MySQL's
dummy REMARKS column on DatabaseMetaData::getTables for views
This commit is contained in:
parent
6b007ad73e
commit
7d2432dd2d
@ -576,7 +576,9 @@ public class MySQLDatabase extends AbstractDatabase implements ResultQueryDataba
|
||||
for (Record record : create().select(
|
||||
TABLES.TABLE_SCHEMA,
|
||||
TABLES.TABLE_NAME,
|
||||
TABLES.TABLE_COMMENT,
|
||||
|
||||
// [#17344] MySQL's INFORMATION_SCHEMA.TABLES.TABLE_COMMENT just adds a dummy 'VIEW' REMARK to all views, which we should ignore
|
||||
when(TABLES.TABLE_TYPE.ne(inline("VIEW")), TABLES.TABLE_COMMENT).as(TABLES.TABLE_COMMENT),
|
||||
when(TABLES.TABLE_TYPE.eq(inline("VIEW")), inline(TableType.VIEW.name()))
|
||||
.else_(inline(TableType.TABLE.name())).as("table_type"))
|
||||
.from(TABLES)
|
||||
|
||||
@ -563,6 +563,20 @@ final class MetaImpl extends AbstractMeta {
|
||||
: TableType.TABLE;
|
||||
|
||||
|
||||
switch (dsl().family()) {
|
||||
|
||||
|
||||
case MYSQL:
|
||||
case MARIADB: {
|
||||
|
||||
// [#17344] MySQL's INFORMATION_SCHEMA.TABLES.TABLE_COMMENT just adds a dummy 'VIEW' REMARK to all views, which we should ignore
|
||||
if (tableType == TableType.VIEW)
|
||||
remarks = null;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new MetaTable(
|
||||
name,
|
||||
this,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user