All Products
Search
Document Center

PolarDB:Engine versions 5.6, 5.7, and 8.0

Last Updated:Mar 19, 2024

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

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

Components of the engine version and their relationships

A complete engine version number of PolarDB for MySQL consists of three parts: the major version (DB version) number, the minor version number, and the revision version number. The following figure shows the relationship among the three parts, using PolarDB for MySQL version 8.0 as an example.版本号说明

The major version number is the key identifier for a PolarDB for MySQL database engine version. In most cases, a major version includes one or more minor versions. For example, major version 5.6 contains only one minor version 5.6.16, while major version 8.0 contains two minor versions 8.0.1 and 8.0.2. The features of different minor versions may significantly vary. Select a minor version based on your business requirements. In most cases, a minor version has multiple revision versions. A revision version optimizes or improves existing features, or adds new features. Later minor and revision versions deliver stronger security protection and better performance.

Note

Later engine versions of PolarDB for MySQL include all features of the earlier versions and are fully backward compatible with the earlier versions. Therefore, after an engine version upgrade, you can continue to use your applications without the need for modifications. For more information about how to upgrade engine versions, see Update engine versions.

Release notes of engine versions

Alibaba Cloud provides release notes for each engine version. The release notes include new features, modified features, and fixed issues. For more information, see the following topics:

Compatibility of engine versions

The following section provides the compatibility information of PolarDB for MySQL engine versions:

  • Complies with ANSI and ISO SQL standards. You can set the sql_mode parameter of your cluster to ANSI to enable the ANSI session mode. For more information about how to modify the cluster parameters, see Specify cluster and node parameters.

  • Supports Open Database Connectivity (ODBC) versions from 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 compatibility between PolarDB for MySQL engine versions and MySQL community editions.

Engine version

Fully compatible MySQL minor version

8.0.2

8.0.18 and earlier

8.0.1

8.0.13 and earlier

5.7

5.7.28 and earlier

5.6

5.6.16 and earlier

SQL syntax for new features in PolarDB for MySQL

CREAT TABLE

To ensure that PolarDB for MySQL is 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. Take note of the following items:

  • Method 1: Execute the SHOW CREATE TABLE statement. Example:

    CREATE TABLE `t1` (c1 int, KEY(c1) GLOBAL) ENGINE=InnoDB PARTITION BY HASH (`c1`) PARTITIONS 4;
    Query OK, 0 rows affected (0.06 sec)
    
    SHOW CREATE TABLE t1;
    +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table | Create Table                                                                                                                                                                                                         |
    +-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | t1    | CREATE TABLE `t1` (
      `c1` int(11) DEFAULT NULL,
      KEY `c1` (`c1`) /*!99990 800020207 GLOBAL */
    ) 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, KEY(c1) GLOBAL) ENGINE=InnoDB PARTITION BY HASH (`c1`) PARTITIONS 4;
    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,
      KEY `c1` (`c1`) /*!99990 800020207 GLOBAL */
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
    /*!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 Data Transmission Service (DTS) to synchronize binary logs from PolarDB for MySQL 8.0.2.2.0 to MySQL 8.0.27. 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 MySQL 8.0.27.

      Sample result on PolarDB for MySQL 8.0.2.2.0:

      Sample result on MySQL 8.0.27: MySQLAs shown in the preceding figures, the new features provided in PolarDB for MySQL do not appear in the MySQL result.

      Note

      After data is synchronized from PolarDB for MySQL 8.0.2.2.0 to MySQL 8.0.27, the new features provided in PolarDB for MySQL are no longer available in MySQL.

DDL statements other than CREATE TABLE

For DDL statements other than CREATE TABLE, you must manually add comments to 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(11) DEFAULT NULL,
KEY `c1` (`c1`) /*!99990 800020207 GLOBAL */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
/*!50100 PARTITION BY HASH (`c1`)
PARTITIONS 4 */

Query an engine version

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

  • Log on to the PolarDB console. On the Basic Information 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

Upgrade engine versions

  • Upgrade major versions and update minor versions

    • Upgrade major versions

      PolarDB for MySQL supports major engine version upgrades. For example, you can upgrade PolarDB for MySQL 5.6 to PolarDB for MySQL 8.0. For more information about major version upgrades, see Overview.

    • Update minor versions

      In PolarDB for MySQL, you cannot update 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 revision versions.