Repository: typeorm/typeorm
File: src/driver/mysql/MysqlQueryRunner.ts (TypeScript)

Code before:
        if (
            isMariaDb &&
            column.asExpression &&
            ["VIRTUAL", "STORED"].includes(column.generatedType || "VIRTUAL")
        ) {
            // do nothing - MariaDB does not support NULL/NOT NULL expressions for VIRTUAL columns and STORED columns
        } else {
            if (!column.isNullable) c += " NOT NULL"
            if (column.isNullable) c += " NULL"
        }

        if (column.isPrimary && !skipPrimary) c += " PRIMARY KEY"
        if (column.isGenerated && column.generationStrategy === "increment")
            // don't use skipPrimary here since updates can update already exist primary without auto inc.
            c += " AUTO_INCREMENT"
        if (column.comment && column.comment.length > 0)
            c += ` COMMENT ${this.escapeComment(column.comment)}`
        if (column.default !== undefined && column.default !== null)
            c += ` DEFAULT ${column.default}`
        if (column.onUpdate) c += ` ON UPDATE ${column.onUpdate}`

        return c
    }

    async getVersion(): Promise<string> {
        const result = await this.query(`SELECT VERSION() AS \`version\``)
        const dbVersion = result[0]["version"]

        return this.driver.options.type === "mariadb"
            ? dbVersion.replace(/^([\d.]+).*$/, "$1")
            : dbVersion
    }

    /**
     * Checks if column display width is by default.
     */
    protected isDefaultColumnWidth(
        table: Table,
        column: TableColumn,
        width: number,
    ): boolean {
        // if table have metadata, we check if length is specified in column metadata
        if (this.connection.hasMetadata(table.name)) {
            const metadata = this.connection.getMetadata(table.name)
            const columnMetadata = metadata.findColumnWithDatabaseName(
                column.name,
            )
            if (columnMetadata && columnMetadata.width) return false
        }

        const defaultWidthForType =

Review comment (suggestion):
Would be nice to add a typing here, like `PostgresQueryRunner` has:

```suggestion
        const result: [{ version: string }] = await this.query(`SELECT VERSION() AS \`version\``)
```

Code after:
        if (
            isMariaDb &&
            column.asExpression &&
            ["VIRTUAL", "STORED"].includes(column.generatedType || "VIRTUAL")
        ) {
            // do nothing - MariaDB does not support NULL/NOT NULL expressions for VIRTUAL columns and STORED columns
        } else {
            if (!column.isNullable) c += " NOT NULL"
            if (column.isNullable) c += " NULL"
        }

        if (column.isPrimary && !skipPrimary) c += " PRIMARY KEY"
        if (column.isGenerated && column.generationStrategy === "increment")
            // don't use skipPrimary here since updates can update already exist primary without auto inc.
            c += " AUTO_INCREMENT"
        if (column.comment && column.comment.length > 0)
            c += ` COMMENT ${this.escapeComment(column.comment)}`
        if (column.default !== undefined && column.default !== null)
            c += ` DEFAULT ${column.default}`
        if (column.onUpdate) c += ` ON UPDATE ${column.onUpdate}`

        return c
    }

    async getVersion(): Promise<string> {
        const result: [{ version: string }] = await this.query(
            `SELECT VERSION() AS \`version\``,
        )

        // MariaDB: https://mariadb.com/kb/en/version/
        // - "10.2.27-MariaDB-10.2.27+maria~jessie-log"
        // MySQL: https://dev.mysql.com/doc/refman/8.4/en/information-functions.html#function_version
        // - "8.4.3"
        // - "8.4.4-standard"
        const versionString = result[0].version

        return versionString.replace(/^([\d.]+).*$/, "$1")
    }

    /**
     * Checks if column display width is by default.
     */
    protected isDefaultColumnWidth(
        table: Table,
        column: TableColumn,
        width: number,
    ): boolean {
        // if table have metadata, we check if length is specified in column metadata
        if (this.connection.hasMetadata(table.name)) {
            const metadata = this.connection.getMetadata(table.name)
            const columnMetadata = metadata.findColumnWithDatabaseName(