Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Deal the information_schema.TABLES columns where the value could be NULL when the table type is VIEW

天舟a10db667ab94
diff --git a/db/mysql.go b/db/mysql.go
index 887029d9a3..43c5cc8fa4 100644
--- a/db/mysql.go
+++ b/db/mysql.go
@@ -79,11 +79,11 @@ func (driver *MySQLDriver) SyncSchema(ctx context.Context) ([]*DBSchema, error)
TABLE_NAME,
UNIX_TIMESTAMP(CREATE_TIME),
IFNULL(UNIX_TIMESTAMP(UPDATE_TIME), 0),
- ENGINE,
- TABLE_COLLATION,
- TABLE_ROWS,
- DATA_LENGTH,
- INDEX_LENGTH
+ IFNULL(ENGINE, ''),
+ IFNULL(TABLE_COLLATION, ''),
+ IFNULL(TABLE_ROWS, 0),
+ IFNULL(DATA_LENGTH, 0),
+ IFNULL(INDEX_LENGTH, 0)
FROM information_schema.TABLES
WHERE `+tableWhere,
)