PolarDB-X 1.0is highly compatible with the MySQL protocol and the Structured Query Language (SQL) syntax of MySQL. However, some limits are imposed on the SQL statements for PolarDB-X 1.0. This is because the architecture of distributed databases differs from that of single-instance databases. This topic describes the limits of SQL statements in PolarDB-X 1.0.

General limits on the SQL statements

  • PolarDB-X 1.0 does not support custom data types or custom functions.
  • PolarDB-X 1.0 does not support stored procedures, triggers, or cursors.
  • PolarDB-X 1.0 does not support temporary tables.
  • PolarDB-X 1.0 does not support compound statements, such as BEGIN...END, LOOP...END LOOP, REPEAT...UNTIL...END REPEAT, and WHILE...DO...END WHILE.
  • PolarDB-X 1.0 does not support flow control statements, such as IF and WHILE statements.
  • PolarDB-X 1.0 does not support foreign key.

Limits on the SQL syntax

  • DDL
    • You cannot execute the CREATE TABLE tbl_name LIKE old_tbl_name statement for table sharding.
    • You cannot execute the CREATE TABLE tbl_name SELECT statements for table sharding.
    • You cannot execute the RENAME statement to rename multiple tables at a time.
    • You cannot execute the ALTER TABLE statement to change shard key fields.
    • PolarDB-X 1.0 does not support data definition language (DDL) operations across schemas, such as CREATE TABLE db_name.tbl_name (...).

    For more information about DDL statements, see DDL.

  • DML
    • PolarDB-X 1.0 does not support the following statements: SELECT INTO OUTFILE, INTO DUMPFILE, and INTO var_name.
    • PolarDB-X 1.0 does not support STRAIGHT_JOIN or NATURAL JOIN operations.
    • PolarDB-X 1.0 does not support subqueries in UPDATE SET clauses.
    • PolarDB-X 1.0 does not support INSERT DELAYED statements.
    • PolarDB-X 1.0 does not support variable references and operations in SQL statements. For example, you cannot execute the following statement: SET @c=1, @d=@c+1; SELECT @c, @d.
    • You cannot perform the INSERT, REPLACE, UPDATE, or DELETE operations on broadcast tables in flexible transactions.

    For more information about data manipulation language (DML) statements, see DML.

  • Subqueries
    • PolarDB-X 1.0 does not support subqueries in HAVING or JOIN ON clauses.
    • PolarDB-X 1.0 does not support the ROW functions in the scalar subqueries that use equal signs (=) as operators.

    For more information about subqueries, see Subqueries.

  • Database management
    • PolarDB-X 1.0 does not support the combination of LIMIT and COUNT in SHOW WARNINGS statements.
    • PolarDB-X 1.0 does not support the combination of LIMIT and COUNT in SHOW ERRORS statements.
  • Operators that are not supported by PolarDB-X 1.0

    PolarDB-X 1.0 does not support the assignment operators ':='

    For more information about operators, see Operators.

  • Functions that are not supported by PolarDB-X 1.0

    For more information about functions, see Functions.

  • Keywords that are not supported by PolarDB-X 1.0
    • MILLISECOND
    • MICROSECOND