All Products
Search
Document Center

PolarDB:Syntax compatibility

Last Updated:Jul 02, 2024

This topic describes the compatibility when you execute related statements in a tenant. For more information, see documentation on the MySQL official website.

Compatibility

  • For the statements that cannot be executed by the privileged user in PolarDB for MySQL, such as ALTER INSTANCE and ALTER TABLESPACE, they cannot be executed even in multi-tenant mode. They are marked with N in the Compatible column and further information is added in the Remarks column in the following table.

  • For the statements whose execution results are independent of the tenant, such as SHOW VARIABLES, KILL, and SHOW ENGINES, they are marked with Y (tenant-independent) in the Compatible column in the following table.

  • For the statements whose execution results are dependent on the tenant, such as SHOW DATABASE, CREATE DATABASE, CREATE USER, and ALTER USER, they are marked with Y or N in the Compatible column and further information is added in the Remarks column in the following table.

Type

SQL statement

Compatible

Remarks

DDLs

Atomic DDLs

Y

ALTER DATABASE

Y

ALTER EVENT

Y

ALTER FUNCTION

Y

ALTER INSTANCE

N

The privileged account cannot execute the statement.

ALTER LOGFILE GROUP

N

The statement is supported only in NDB mode.

ALTER PROCEDURE

Y

ALTER SERVER

N

The privileged account cannot execute the statement.

ALTER TABLE

Y

ALTER TABLESPACE

N

The privileged account cannot execute the statement.

ALTER VIEW

Y

CREATE DATABASE

Y

CREATE EVENT

Y

CREATE FUNCTION

Y

CREATE INDEX

Y

CREATE LOGFILE GROUP

N

The statement is supported only in NDB mode.

CREATE PROCEDURE

CREATE FUNCTION

Y

CREATE SERVER

N

The privileged account cannot execute the statement.

CREATE SPATIAL REFERENCE SYSTEM

N

The privileged account cannot execute the statement.

CREATE TABLE

Y

CREATE TABLESPACE

N

The privileged account cannot execute the statement.

CREATE TRIGGER

Y

CREATE VIEW

Y

DROP DATABASE

Y

DROP EVENT

Y

DROP FUNCTION

Y

DROP INDEX

Y

DROP LOGFILE GROUP

N

The statement is supported only in NDB mode.

DROP PROCEDURE

DROP FUNCTION

Y

DROP SERVER

N

The privileged account cannot execute the statement.

DROP SPATIAL REFERENCE SYSTEM

N

The privileged account cannot execute the statement.

DROP TABLE

Y

DROP TABLESPACE

N

The privileged account cannot execute the statement.

DROP TRIGGER

Y

DROP VIEW

Y

RENAME TABLE

Y

TRUNCATE TABLE

Y

DMLs

CALL

Y

DELETE

Y

DO

Y

EXCEPT clause

N

It is not supported in PolarDB for MySQL 8.0.2.

HANDLER

Y

IMPORT TABLE

N

The privileged account cannot execute the statement.

INSERT

Y

INTERSECT clause

N

It is not supported in PolarDB for MySQL 8.0.2.

LOAD DATA

N

The privileged account cannot execute the statement to load files from the server.

LOAD XML

N

The privileged account cannot execute the statement to load files from the server.

The expression that contains parentheses

Y

REPLACE

Y

SELECT

Y

The SQL statement that contains UNION, INTERSECT, and EXCEPT

Y

Subqueries

Y

TABLE

N

It is not supported in PolarDB for MySQL 8.0.2.

UPDATE

Y

UNION clause

Y

VALUES

N

It is not supported in PolarDB for MySQL 8.0.2.

WITH (common table expressions)

Y

Transactional and locking statements

START TRANSACTION, COMMIT, and ROLLBACK

Y (tenant-independent)

The statement that cannot be rolled back

Y (tenant-independent)

The statement that is implicitly submitted

Y (tenant-independent)

SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT

Y (tenant-independent)

LOCK INSTANCE FOR BACKUP and UNLOCK INSTANCE

N

The privileged account cannot execute the statement.

LOCK TABLES and UNLOCK TABLES

Y

SET TRANSACTION

Y (tenant-independent)

eXtended Architecture (XA) transaction

Y (tenant-independent)

Replication statements to control source servers

PURGE BINARY LOGS

N

The privileged account cannot execute the statement.

RESET MASTER

Y (tenant-independent)

Only users who have the RELOAD permissions can execute the statement. However, we recommend that you do not grant the permissions to users.

SET sql_log_bin

N

The privileged account cannot execute the statement.

Replication statements to control replica servers

CHANGE MASTER TO

N

The privileged account cannot execute the statement.

CHANGE REPLICATION FILTER

N

The privileged account cannot execute the statement.

CHANGE REPLICATION SOURCE TO

N

The privileged account cannot execute the statement.

RESET REPLICA

Y (tenant-independent)

Only users who have the RELOAD permissions can execute the statement. However, we recommend that you do not grant the permissions to users.

RESET SLAVE

Y (tenant-independent)

Only users who have the RELOAD permissions can execute the statement. However, we recommend that you do not grant the permissions to users.

START REPLICA

N

The privileged account cannot execute the statement.

START SLAVE

N

The privileged account cannot execute the statement.

STOP REPLICA

N

The privileged account cannot execute the statement.

STOP SLAVE

N

The privileged account cannot execute the statement.

Replication statements to control group replication

START GROUP_REPLICATION

N

The privileged account cannot execute the statement.

STOP GROUP_REPLICATION

N

The privileged account cannot execute the statement.

Prepared statements

PREPARE

Y

EXECUTE

Y

DEALLOCATE PREPARE

Y

Compound statements

Compound statements

Y (tenant-independent)

This statement is supported in tenant mode. The SQL statements in the stored procedure are independent of the specific tenant.

Database administration statements: Account management statements

ALTER USER

Y

CREATE ROLE

Y

In tenant mode, you can add roles to a tenant. The privileged account cannot execute the GRANT ROLE statement.

CREATE USER

Y

DROP ROLE

Y

In tenant mode, you can add roles to a tenant. The privileged account cannot execute the GRANT ROLE statement.

DROP USER

Y

GRANT

Y

RENAME USER

Y

REVOKE

Y

SET DEFAULT ROLE

Y

SET PASSWORD

Y

SET ROLE

Y

Database administration statements: Resource group management statements

Resource group management statements

N

You cannot enable resource groups online.

Database administration statements: Table maintenance statements

ANALYZE TABLE

Y

CHECK TABLE

Y

CHECKSUM TABLE

Y

OPTIMIZE TABLE

Y

REPAIR TABLE

Y

Database administration statements: component, plug-in, and loadable function statements

CREATE FUNCTION statement for loadable functions

Y

This statement is supported when you have the INSERT or DELETE permission on tables in a MySQL database. However, we recommend that you do not grant the permissions to users that belong to the tenant.

DROP FUNCTION statement for loadable functions

Y

INSTALL COMPONENT

Y (tenant-independent)

INSTALL PLUGIN

Y (tenant-independent)

UNINSTALL COMPONENT

Y (tenant-independent)

UNINSTALL PLUGIN

Y (tenant-independent)

Database administration statements

CLONE

N

The privileged account cannot execute the statement.

Database administration statements: SET statements

SET statement

Y (tenant-independent)

You can modify only variables in the current session.

SET CHARACTER

Y (tenant-independent)

SET NAMES

Y (tenant-independent)

Database administration statements: SHOW statements

SHOW BINARY LOGS

Y (tenant-independent)

Only users who have the REPLICATION CLIENT permissions can execute the statement.

SHOW BINLOG EVENTS

Y (tenant-independent)

Only users who have the REPLICATION SLAVE permission can execute this statement.

SHOW CHARACTER SET

Y (tenant-independent)

SHOW COLLATION

Y (tenant-independent)

SHOW COLUMNS

Y

SHOW CREATE DATABASE

Y

SHOW CREATE EVENT

Y

SHOW CREATE PROCEDURE

Y

SHOW CREATE TABLE

Y

SHOW CREATE TRIGGER

Y

SHOW CREATE USER

Y

SHOW CREATE VIEW

Y

SHOW DATABASES

Y

SHOW ENGINE

Y (tenant-independent)

Only users who have the PROCESS permissions can execute the statement. However, we recommend that you do not grant the permissions to users that belong to the tenant.

SHOW ENGINES

Y (tenant-independent)

SHOW ERRORS

Y (tenant-independent)

SHOW EVENTS

Y

The SHOW EVENT statement filters out the tenant information on the database and user.

SHOW FUNCTION CODE

Y

SHOW FUNCTION STATUS

Y (tenant-independent)

The tenant information is not filtered out.

SHOW GRANTS

Y

Only users who have the SELECT permissions can execute the statement.

SHOW INDEX

Y

SHOW MASTER STATUS

Y (tenant-independent)

Only users who have the REPLICATION CLIENT permissions can execute the statement.

SHOW OPEN TABLES

Y

SHOW PLUGINS

Y (tenant-independent)

SHOW PRIVILEGES

Y (tenant-independent)

SHOW PROCEDURE CODE

Y

SHOW PROCEDURE STATUS

Y (tenant-independent)

The tenant information is not filtered out.

SHOW PROCESSLIST

Y

SHOW PROFILE

Y (tenant-independent)

SHOW PROFILES

Y (tenant-independent)

SHOW RELAYLOG EVENTS

N

The privileged account cannot execute the statement.

SHOW REPLICAS

N

It is not supported in PolarDB for MySQL 8.0.2.

SHOW SLAVE HOSTS | SHOW REPLICAS

N

It is not supported in PolarDB for MySQL 8.0.2.

SHOW REPLICA STATUS

N

It is not supported in PolarDB for MySQL 8.0.2.

SHOW SLAVE | REPLICA STATUS

Y (tenant-independent)

Only users who have the REPLICATION CLIENT permissions can execute the statement.

SHOW STATUS

Y (tenant-independent)

SHOW TABLE STATUS

Y

SHOW TABLES

Y

SHOW TRIGGERS

Y

SHOW VARIABLES

Y (tenant-independent)

SHOW WARNINGS

Y (tenant-independent)

Database administration statements: Other administrative statements

BINLOG

N

The privileged account cannot execute the statement.

CACHE INDEX

Y

FLUSH

Y

Most FLUSH operations require the RELOAD permission. However, we recommend that you do not grant the RELOAD permission to users that belong to the tenant.

KILL

Y (tenant-independent)

LOAD INDEX INTO CACHE

Y

RESET

Y (tenant-independent)

Only users who have the RELOAD permissions can execute the statement.

RESET PERSIST

N

The privileged account cannot execute the statement.

RESTART

N

The privileged account cannot execute the statement.

SHUTDOWN

N

The privileged account cannot execute the statement.

Utility statements

DESCRIBE

Y

EXPLAIN

Y

HELP

Y (tenant-independent)

USE

Y