fix(GOV-012): 拒绝 MariaDB 伪装版本
This commit is contained in:
@@ -62,7 +62,8 @@ export function quoteIdentifier(identifier) {
|
||||
* `SHOW CREATE` 文本在不兼容语义下被误认为可恢复的 Schema 快照。
|
||||
*/
|
||||
export function assertMysql57ServerMetadata(metadata) {
|
||||
if (!/^5\.7\.\d+(?:[-+].*)?$/.test(metadata?.serverVersion ?? '')) {
|
||||
const serverVersion = metadata?.serverVersion ?? '';
|
||||
if (!/^5\.7\.\d+(?:[-+].*)?$/.test(serverVersion) || /mariadb/i.test(serverVersion)) {
|
||||
throw new SchemaExportError('UNSUPPORTED_SERVER_VERSION', 'MySQL 服务端必须为 5.7.x');
|
||||
}
|
||||
if (metadata.databaseCharset !== 'utf8mb4') {
|
||||
|
||||
Reference in New Issue
Block a user