The database engine is also known as the database kernel. PolarDB for MySQL provides three major engine versions: 5.6, 5.7, and 8.0.

The following figure shows the position of the PolarDB for MySQL engine in the PolarDB for MySQL architecture. 1

Components of the engine version and their relationships

A complete engine version of PolarDB for MySQL consists of three parts: major version, minor version, and revision version. The following figure shows the relationship among the three parts. In the following example, the major version of PolarDB for MySQL is 8.0.Components of the engine version

The major version is the most important part that is used to identify an engine version of PolarDB for MySQL. A major version may have one or more minor versions. For example, major version 5.6 has only a single minor version, 5.6.16, while major version 8.0 has two minor versions, 8.0.1 and 8.0.2. Features of different minor versions are significantly different. We recommend that you pay special attention to the selection of minor versions. In most cases, a minor version has multiple revision versions. A revision version provides optimizations and improvements to their corresponding minor version or delivers new features. Newer minor and revision versions also deliver stronger security protection and better performance.

Note In PolarDB for MySQL, newer versions are backward compatible with the older ones. Therefore, you do not need to modify your applications after you upgrade engine versions. For more information about how to upgrade the engine version, see Upgrade the engine version.

Release notes of engine versions

Alibaba Cloud provides release notes for each version, in which new features, modified features, and fixed issues are listed. For more information, see the following topics:

Compatibility of engine versions

The compatibility of engine versions of PolarDB for MySQL:
  • Complies with ANSI and ISO SQL standards. PolarDB for MySQL allows you to enable the ANSI session mode by setting the sql_mode parameter of your cluster to ANSI. For more information about how to modify the cluster parameters, see Specify cluster and node parameters.
  • Supports Open Database Connectivity (ODBC) versions 0 to 3.51.
  • Supports XML features that comply with W3C and XPath standards.
  • PolarDB for MySQL 5.7 and 8.0 support the native JSON data types that comply with RFC 7159 and ECMA-262 standards.
The following table lists the correspondence between different versions of PolarDB for MySQL and MySQL Community Edition:
Engine versionFully compatible MySQL minor version
8.0.28.0.18 and earlier
8.0.18.0.13 and earlier
5.75.7.28 and earlier
5.65.6.16 and earlier

Compatibility between PolarDB for MySQL 8.0.2.2.0 or later and MySQL

PolarDB for MySQL 8.0.2.2.0 or later may have syntax compatibility issues with other MySQL databases. This section provides solutions to these issues.

create table

To make PolarDB for MySQL 8.0.2.2.0 or later compatible with the CREATE TABLE statement, you can use the SHOW CREATE TABLE statement, mysqldump tool, and binary log synchronization to automatically add the CREATE TABLE statement.
  • Method 1: Execute the SHOW CREATE TABLE statement. Example:
    CREATE TABLE `t1` (c1 int) ENGINE=InnoDB UNIQUE CHECK IGNORE=1
    PARTITION BY HASH (`c1`) PARTITIONS 4;
    
    -- result
    SHOW CREATE TABLE t1;
    Table Create Table
    t1  CREATE TABLE `t1` (
      `c1` int(11) DEFAULT NULL
    ) /*!99990 800020200 UNIQUE CHECK IGNORE=1 */ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
    /*!50100 PARTITION BY HASH (`c1`)
    PARTITIONS 4 */
  • Method 2: Use the mysqldump tool. Example:
    CREATE TABLE `t1` (c1 int) UNIQUE CHECK IGNORE=1 ENGINE=InnoDB
    DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci PARTITION BY HASH (`c1`);
    --result
    mysqldump --compact test t1
    
    include/mysqlbinlog.inc
    /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
    /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
    DELIMITER /*!*/;
    ROLLBACK/*!*/;
    # [empty]
    # original_commit_timestamp= MICROSECONDS-FROM-EPOCH (YYYY-MM-DD HOURS:MINUTES:SECONDS TZ)
    # immediate_commit_timestamp= MICROSECONDS-FROM-EPOCH (YYYY-MM-DD HOURS:MINUTES:SECONDS TZ)
    /*!80001 SET @@session.original_commit_timestamp= MICROSECONDS-FROM-EPOCH*//*!*/;
    /*!80014 SET @@session.original_server_version= ORIGINAL_SERVER_VERSION*//*!*/;
    /*!80014 SET @@session.immediate_server_version= IMMEDIATE_SERVER_VERSION*//*!*/;
    SET @@SESSION.GTID_NEXT= '#'/*!*/;
    use `test`/*!*/;
    SET TIMESTAMP=#/*!*/;
    SET @@session.pseudo_thread_id=#/*!*/;
    SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
    SET @@session.sql_mode=1168113696/*!*/;
    SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
    /*!\C utf8mb4 *//*!*/;
    SET @@session.character_set_client=255,@@session.collation_connection=255,@@session.collation_server=255/*!*/;
    SET @@session.lc_time_names=0/*!*/;
    SET @@session.collation_database=DEFAULT/*!*/;
    /*!80011 SET @@session.default_collation_for_utf8mb4=255*//*!*/;
    /*!80013 SET @@session.sql_require_primary_key=0*//*!*/;
    CREATE TABLE `t1` (
      `c1` int(11) DEFAULT NULL
    ) /*!99990 800020200 UNIQUE CHECK IGNORE=1 */ ENGINE=InnoDB
    /*!50100 PARTITION BY HASH (`c1`)
    PARTITIONS 4 */
    /*!*/;
    ......
  • Method 3: Use binary log synchronization.
    In the following example, binary logs are synchronized from PolarDB for MySQL 8.0.2.2.0 to MySQL 8.0.27.
    1. Use DTS to synchronize PolarDB for MySQL binary logs to another MySQL database. For more information, see Synchronize data from a PolarDB for MySQL cluster to an ApsaraDB RDS for MySQL instance.
    2. View the binary log synchronization result on PolarDB for MySQL 8.0.2.2.0 and on the destination MySQL database.
      Sample result on PolarDB for MySQL:
      Sample result on the destination MySQL database:MySQLAs shown in the preceding figures, the features provided by PolarDB for MySQL are not displayed in the result on the destination MySQL database.
      Note After PolarDB for MySQL data is synchronized to other MySQL databases, the features provided by PolarDB for MySQL are no longer available.

DDL statements other than CREATE TABLE

For DDL statements other than CREATE TABLE, you must manually add comments in PolarDB for MySQL statements to ensure compatibility. Syntax:
/*!99990 800020200 Special new PolarDB Syntax SQL supported >= version 2.2.0 */
Example:
CREATE TABLE `t1` (c1 int)
/*!99990 900020200 UNIQUE CHECK IGNORE=1 */
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
/*!50100 PARTITION BY HASH (`c1`) */;
SHOW CREATE TABLE t1;
DROP TABLE `t1`;

Query the engine version

You can use the following methods to query the engine version of a cluster:

  • Log on to the PolarDB console. On the Overview page of the cluster whose engine version you want to query, check the value of the Kernel Version parameter. 1
  • Execute the show variables like "%polardb_version%"; or show variables like '%rds_release_date%'; statement to query the engine version.
    Note
    • You can execute only the show variables like '%rds_release_date%'; statement to query the engine version of a PolarDB for MySQL 5.6 cluster.
    • For more information about the components of the PolarDB for MySQL engine version, see Components of the engine version and their relationships.

Upgrade the engine version

  • Upgrade major versions and minor versions
    • Upgrade DB versions

      Major version upgrades allow you to upgrade DB versions, such as from PolarDB for MySQL 5.6 to PolarDB for MySQL 8.0.

    • Upgrade minor versions

      In PolarDB for MySQL, you cannot upgrade minor versions. However, you can use DTS to migrate or synchronize data from the cluster of the source version to the cluster of the destination version. For more information about how to migrate or synchronize data, see Overview.

  • Upgrade revision versions

    For more information about how to upgrade revision versions, see Upgrade the revision version.