Syntax Compatibility
Scenarios
This section outlines the SQL syntax compatibility in multi-tenant mode, based on official MySQL syntax specification.
Syntax Compatibility
- Statements that cannot be executed by privileged users, such as ALTER INSTANCE and ALTER TABLESPACE, also cannot be executed in multi-tenant mode. These statements are marked as N in the following table's Compatible with TaurusDB column, with additional details provided in the Remarks column.
- Statements whose execution results are independent of tenants, such as SHOW VARIABLES, KILL, and SHOW ENGINES, are marked as Y-Not isolated per tenant in the Compatible with TaurusDB column.
- Statements whose execution results depend on tenants, such as SHOW DATABASE, CREATE DATABASE, CREATE USER, and ALTER USER, are marked as Y or N in the Compatible with TaurusDB column, with additional details provided in the Remarks column.
| SQL Type | SQL Syntax | Compatible with TaurusDB | Remarks |
|---|---|---|---|
| DDL statements | Atomic DDL | Y | Target objects are isolated per tenant. |
| ALTER DATABASE | Y |
| |
| ALTER EVENT | Y | Target objects of this statement are isolated per tenant. | |
| ALTER FUNCTION | Y | Target objects of this statement are isolated per tenant. | |
| ALTER INSTANCE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| ALTER LOGFILE GROUP | N | TaurusDB does not support NDB mode. | |
| ALTER PROCEDURE | Y | Target objects of this statement are isolated per tenant. | |
| ALTER SERVER | Y | Regular tenant users can execute this statement only after being granted the SUPER privilege. | |
| ALTER TABLE | Y | Target objects of this statement are isolated per tenant. | |
| ALTER TABLESPACE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| ALTER VIEW | Y | Target objects of this statement are isolated per tenant. | |
| CREATE DATABASE | Y | Database names are automatically suffixed with tenant names. Regular tenants can only create databases under their own tenant. | |
| CREATE EVENT | Y | Database names are automatically suffixed with tenant names. Regular tenants can only view databases under their own tenant. | |
| CREATE FUNCTION | Y | Target objects of this statement are isolated per tenant. | |
| CREATE INDEX | Y | Target objects of this statement are isolated per tenant. | |
| CREATE LOGFILE GROUP | N | TaurusDB does not support NDB mode. | |
| CREATE PROCEDURE | Y | Target objects of this statement are isolated per tenant. | |
| CREATE SERVER | Y | Regular tenant users can execute this statement only after being granted the SUPER privilege. | |
| CREATE SPATIAL REFERENCE SYSTEM | Y | Regular tenant users can execute this statement only after being granted the SUPER privilege. | |
| CREATE TABLE | Y | Target objects of this statement are isolated per tenant. | |
| CREATE TABLESPACE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| CREATE TRIGGER | Y | Target objects of this statement are isolated per tenant. | |
| CREATE VIEW | Y | Target objects of this statement are isolated per tenant. | |
| DROP DATABASE | Y | Database names are automatically suffixed with tenant names. Regular tenants can only delete databases under their own tenant. | |
| DROP EVENT | Y | Database names are automatically suffixed with tenant names. Regular tenants can only delete databases under their own tenant. | |
| DROP FUNCTION | Y | Target objects of this statement are isolated per tenant. | |
| DROP INDEX | Y | Target objects of this statement are isolated per tenant. | |
| DROP LOGFILE GROUP | N | TaurusDB does not support NDB mode. | |
| DROP PROCEDURE | Y | Target objects of this statement are isolated per tenant. | |
| DROP SERVER | Y | Regular tenant users can execute this statement only after being granted the SUPER privilege. | |
| DROP SPATIAL REFERENCE SYSTEM | Y | Regular tenant users can execute this statement only after being granted the SUPER privilege. | |
| DROP TABLE | Y | Target objects of this statement are isolated per tenant. | |
| DROP TABLESPACE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| DROP TRIGGER | Y | Target objects of this statement are isolated per tenant. | |
| DROP VIEW | Y | Target objects of this statement are isolated per tenant. | |
| RENAME TABLE | Y | Target objects of this statement are isolated per tenant. | |
| TRUNCATE TABLE | Y | Target objects of this statement are isolated per tenant. | |
| DML statements | CALL | Y | Target objects of this statement are isolated per tenant. |
| DELETE | Y | Target objects of this statement are isolated per tenant. | |
| DO | Y-Not isolated per tenant | Tenant isolation does not apply. | |
| EXCEPT clause | N | TaurusDB does not support this syntax. | |
| HANDLER | Y | Target objects of this statement are isolated per tenant. | |
| IMPORT TABLE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| INSERT | Y | Target objects of this statement are isolated per tenant. | |
| INTERSECT clause | N | TaurusDB does not support this syntax. | |
| LOAD DATA | Y | Target objects of LOAD DATA LOCAL are not restricted by tenants. Non-LOCAL operations require the FILE privilege, which is not recommended for regular tenant users. | |
| LOAD XML | Y | Target objects of LOAD XML LOCAL are not restricted by tenants. Non-LOCAL operations require the FILE privilege, which is not recommended for regular tenant users. | |
| Expressions with parentheses | Y | Target objects of this statement are isolated per tenant. | |
| REPLACE | Y | Target objects of this statement are isolated per tenant. | |
| SELECT | Y | Target objects of this statement are isolated per tenant. | |
| Subqueries | Y | Target objects of this statement are isolated per tenant. | |
| TABLE | Y | Target objects of this statement are isolated per tenant. | |
| UPDATE | Y | Target objects of this statement are isolated per tenant. | |
| UNION clause | Y | Target objects of this statement are isolated per tenant. | |
| VALUES | Y | Target objects of this statement are isolated per tenant. | |
| WITH (common table expressions) | Y | Target objects of this statement are isolated per tenant. | |
| Transactional and locking statements | START TRANSACTION, COMMIT, and ROLLBACK | Y-Not isolated per tenant | Target objects of transactional statements are not isolated per tenant in multi-tenant mode. The statement behavior is identical to standard MySQL. |
| Statements that cannot be rolled back | Y-Not isolated per tenant | Target objects of statements that cannot be rolled back are not isolated per tenant in multi-tenant mode. The statement behavior is identical to standard MySQL. | |
| Statements that cause an implicit commit | Y-Not isolated per tenant | Target objects of statements that cause an implicit commit are not isolated per tenant in multi-tenant mode. The statement behavior is identical to standard MySQL. | |
| SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT | Y-Not isolated per tenant | Target objects of SAVEPOINT are not isolated per tenant in multi-tenant mode. The statement behavior is identical to standard MySQL. | |
| LOCK INSTANCE FOR BACKUP and UNLOCK INSTANCE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| LOCK TABLES and UNLOCK TABLES | Y | Target objects of the LOCK TABLES statement are isolated per tenant database. This statement can only lock tables within the same tenant. | |
| SET TRANSACTION | Y-Not isolated per tenant | Target objects of the SET TRANSACTION statement are not isolated per tenant in multi-tenant mode. The statement behavior is identical to standard MySQL. | |
| XA transactions | Y-Not isolated per tenant | Target objects of XA transactions are not isolated per tenant in multi-tenant mode. The transaction behavior is identical to standard MySQL. | |
| Replication statements: SQL statements for controlling source servers | PURGE BINARY LOGS | Y | Regular tenant users can execute this statement only after being granted the SUPER or BINLOG_ADMIN privilege. |
| RESET MASTER | N | TaurusDB does not support this statement in multi-tenant mode. | |
| SET sql_log_bin | Y | Regular tenant users can execute this statement only after being granted the SUPER, SYSTEM_VARIABLES_ADMIN, or SESSION_VARIABLES_ADMIN privilege. | |
| Replication statements: SQL statements for controlling replica servers | CHANGE MASTER TO | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. |
| CHANGE REPLICATION FILTER | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| CHANGE REPLICATION SOURCE TO | N | TaurusDB does not support the CHANGE REPLICATION SOURCE TO statement. Use CHANGE MASTER TO instead. | |
| RESET REPLICA | N | TaurusDB does not support this statement in multi-tenant mode. | |
| RESET SLAVE | N | TaurusDB does not support this statement in multi-tenant mode. | |
| START REPLICA | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| START SLAVE | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| STOP REPLICA | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| STOP SLAVE | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| Replication statement: SQL statement for controlling group replication | START GROUP_REPLICATION | Y | Regular tenant users can execute this statement only after being granted the SUPER or GROUP_REPLICATION_ADMIN privilege. |
| STOP GROUP_REPLICATION | Y | Regular tenant users can execute this statement only after being granted the SUPER or GROUP_REPLICATION_ADMIN privilege. | |
| Prepared statements | PREPARE | Y | Target objects of this statement are isolated per tenant. |
| EXECUTE | Y | Target objects of this statement are isolated per tenant. | |
| DEALLOCATE PREPARE | Y | Target objects of this statement are isolated per tenant. | |
| Compound statements | Compound statements | Y | Target objects of this statement are isolated per tenant. |
| Database administration statements: account management statements | ALTER USER | Y | Target objects are isolated per tenant. This statement can only operate on users within the same tenant. |
| CREATE ROLE | Y | CREATE ROLE creates roles under the current tenant in multi-tenant mode. | |
| CREATE USER | Y | Target objects are isolated per tenant. Created users belong to the current tenant. | |
| DROP ROLE | Y | DROP ROLE deletes roles under the current tenant in multi-tenant mode. | |
| DROP USER | Y | Target objects are isolated per tenant. This statement can only delete users within the same tenant. | |
| GRANT | Y | Target objects are isolated per tenant. This statement can only grant permissions within the same tenant. | |
| RENAME USER | Y | Target objects are isolated per tenant. This statement can only operate on users within the same tenant. | |
| REVOKE | Y | Target objects are isolated per tenant. This statement can only revoke permissions within the same tenant. | |
| SET DEFAULT ROLE | Y | SET DEFAULT ROLE can only set roles under the current tenant in multi-tenant mode. | |
| SET PASSWORD | Y | Target objects are isolated per tenant. This statement can only change the passwords of users under the same tenant. | |
| SET ROLE | Y | In multi-tenant mode, this statement can only set roles belonging to the current tenant. | |
| Database administration statements: resource group management statements | Resource group management statements | N | Resource groups cannot be enabled. |
| Database administration statements: table maintenance statements | ANALYZE TABLE | Y | Target objects are isolated per tenant. This statement can only operate on tables within the same tenant. |
| CHECK TABLE | Y | Target objects are isolated per tenant. This statement can only operate on tables within the same tenant. | |
| CHECKSUM TABLE | Y | Target objects are isolated per tenant. This statement can only operate on tables within the same tenant. | |
| OPTIMIZE TABLE | Y | Target objects are isolated per tenant. This statement can only operate on tables within the same tenant. | |
| REPAIR TABLE | Y | Target objects are isolated per tenant. This statement can only operate on tables within the same tenant. | |
| Database administration statements: component, plug-in, and loadable function statements | CREATE FUNCTION statement for loadable functions | Y | This statement is supported when the user has the INSERT privilege on tables in the MySQL database. However, granting this privilege to tenant users is not recommended. |
| DROP FUNCTION statement for loadable functions | Y | This statement is supported when the user has the DELETE privilege on tables in the MySQL database. However, granting this privilege to tenant users is not recommended. | |
| INSTALL COMPONENT | N | TaurusDB does not support this statement in multi-tenant mode. | |
| INSTALL PLUGIN | N | TaurusDB does not support this statement in multi-tenant mode. | |
| UNINSTALL COMPONENT | N | TaurusDB does not support this statement in multi-tenant mode. | |
| UNINSTALL PLUGIN | N | TaurusDB does not support this statement in multi-tenant mode. | |
| Database administration statements | CLONE | N | TaurusDB does not support this statement in multi-tenant mode. |
| Database administration statements: SET statements | SET Syntax | Y | It can modify only variables in the current session. Modifying global variables requires the SYSTEM_VARIABLES_ADMIN privilege. |
| SET CHARACTER | Y-Not isolated per tenant | Target objects of the SET CHARACTER statement are not isolated per tenant in multi-tenant mode. This statement applies only to the current session. | |
| SET NAMES | Y-Not isolated per tenant | Target objects of the SET NAMES statement are not isolated per tenant in multi-tenant mode. This statement applies only to the current session. | |
| Database administration statements: SHOW statements | SHOW BINARY LOGS | Y | Only users with the SUPER or REPLICATION CLIENT privilege can execute this statement. |
| SHOW BINLOG EVENTS | N | The REPLICATION SLAVE privilege is required. TaurusDB does not support this statement in multi-tenant mode. | |
| SHOW CHARACTER SET | Y-Not isolated per tenant | Target objects of the SHOW CHARACTER SET statement are not isolated per tenant in multi-tenant mode. | |
| SHOW COLLATION | Y-Not isolated per tenant | Target objects of the SHOW COLLATION statement are not isolated per tenant in multi-tenant mode. | |
| SHOW COLUMNS | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE DATABASE | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE EVENT | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE FUNCTION | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE PROCEDURE | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE TABLE | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE TRIGGER | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE USER | Y | Target objects of this statement are isolated per tenant. | |
| SHOW CREATE VIEW | Y | Target objects of this statement are isolated per tenant. | |
| SHOW DATABASES | Y | Target objects are isolated per tenant. Regular tenants can only view databases within their own tenant. | |
| SHOW ENGINE | Y | This statement can be used only by users with the PROCESS privilege. However, granting this privilege to users under a tenant is not recommended. | |
| SHOW ENGINES | Y-Not isolated per tenant | Target objects of the SHOW ENGINES statement are not isolated per tenant in multi-tenant mode. | |
| SHOW ERRORS | Y-Not isolated per tenant | SHOW ERRORS displays error information of the current session only. Target objects of this statement are not isolated per tenant in multi-tenant mode. | |
| SHOW EVENTS | Y | When SHOW EVENTS is executed for a query, tenant information on databases and users is removed. | |
| SHOW FUNCTION CODE | Y | Target objects of this statement are isolated per tenant. | |
| SHOW FUNCTION STATUS | Y | Target objects of this statement are isolated per tenant. | |
| SHOW GRANTS | Y | Viewing own privileges does not require the SELECT privilege. Viewing privileges of other users requires the SELECT privilege on the mysql.user table. | |
| SHOW INDEX | Y | Target objects of the SHOW INDEX statement are isolated per tenant database. | |
| SHOW MASTER STATUS | Y | Only users with the SUPER or REPLICATION CLIENT privilege can execute this statement. | |
| SHOW OPEN TABLES | Y | Target objects of the SHOW OPEN TABLES statement are isolated per tenant database. | |
| SHOW PLUGINS | Y-Not isolated per tenant | Target objects of the SHOW PLUGINS statement are not isolated per tenant in multi-tenant mode. | |
| SHOW PRIVILEGES | Y-Not isolated per tenant | Target objects of the SHOW PRIVILEGES statement are not isolated per tenant in multi-tenant mode. | |
| SHOW PROCEDURE CODE | Y | Target objects of this statement are isolated per tenant. | |
| SHOW PROCEDURE STATUS | Y | Target objects of this statement are isolated per tenant. | |
| SHOW PROCESSLIST | Y | Target objects of the SHOW PROCESSLIST statement are isolated per tenant user. Regular tenants can only view threads within their own tenant. | |
| SHOW PROFILE | Y-Not isolated per tenant | Target objects of the SHOW PROFILE statement are not isolated per tenant in multi-tenant mode. | |
| SHOW PROFILES | Y-Not isolated per tenant | Target objects of the SHOW PROFILES statement are not isolated per tenant in multi-tenant mode. | |
| SHOW RELAYLOG EVENTS | N | TaurusDB does not support this statement in multi-tenant mode. | |
| SHOW REPLICAS | N | TaurusDB does not support this statement in multi-tenant mode. | |
| SHOW SLAVE HOSTS | SHOW REPLICAS | N | TaurusDB does not support this statement in multi-tenant mode. | |
| SHOW REPLICA STATUS | Y | Only users with the SUPER or REPLICATION CLIENT privilege can execute this statement. | |
| SHOW SLAVE | REPLICA STATUS | Y | Only users with the SUPER or REPLICATION CLIENT privilege can execute this statement. | |
| SHOW STATUS | Y-Not isolated per tenant | Target objects of the SHOW STATUS statement are not isolated per tenant in multi-tenant mode. | |
| SHOW TABLE STATUS | Y | Target objects of this statement are isolated per tenant. | |
| SHOW TABLES | Y | Target objects are isolated per tenant. Regular tenants can only view tables within their own tenant. | |
| SHOW TRIGGERS | Y | Target objects of this statement are isolated per tenant. | |
| SHOW VARIABLES | Y-Not isolated per tenant | Target objects of the SHOW VARIABLES statement are not isolated per tenant in multi-tenant mode. | |
| SHOW WARNINGS | Y-Not isolated per tenant | SHOW WARNINGS displays warning information of the current session only. Target objects of this statement are not isolated per tenant in multi-tenant mode. | |
| Database administration statements: other statements | BINLOG | Y | Regular tenant users can execute this statement only after being granted the SUPER or BINLOG_ADMIN privilege. |
| CACHE INDEX | Y | Target objects of this statement are isolated per tenant. | |
| FLUSH | N | TaurusDB does not support this statement in multi-tenant mode. | |
| KILL | Y | Target objects are isolated per tenant. Regular tenants can only view and terminate threads within their own tenant. | |
| LOAD INDEX INTO CACHE | Y | Target objects of the LOAD INDEX INTO CACHE statement are isolated per tenant database. | |
| RESET | N | TaurusDB does not support this statement in multi-tenant mode. | |
| RESET PERSIST | N | Only system tenant users can execute this statement due to permission control. | |
| RESTART | N | TaurusDB does not support this statement in multi-tenant mode. | |
| SHUTDOWN | N | TaurusDB does not support this statement in multi-tenant mode. | |
| Utility statements | DESCRIBE | Y | Target objects of this statement are isolated per tenant. |
| EXPLAIN | Y | Target objects of this statement are isolated per tenant. | |
| HELP | Y-Not isolated per tenant | Target objects of the HELP statement are not isolated per tenant in multi-tenant mode. | |
| USE | Y | Target objects are isolated per tenant. Regular tenants can only switch to databases within their own tenant. | |
| Statements added in TaurusDB | CALL dbms_outln.* | Y | There is no permission restriction on query statements (dbms_outln.show_outline and preview_outline). Administration statements (dbms_outln.add_index_outline, add_optimizer_outline, flush_outline, and del_outline) require the SUPER privilege or the root account. |
| SHOW PBS STATUS | Y-Not isolated per tenant | There is no permission restriction. Regular tenant users can execute this statement. | |
| SHOW REPLICA STATUS USING REDO | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION CLIENT privilege. | |
| SHOW SLOWIO STATUS | Y-Not isolated per tenant | Regular tenant users can execute this statement. | |
| CHANGE MASTER USING REDO | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION_SLAVE_ADMIN privilege. | |
| SHOW SLICEID | Y-Not isolated per tenant | There is no permission restriction. Regular tenant users can execute this statement. | |
| SHOW SPACEUSAGE | Y-Not isolated per tenant | There is no permission restriction. Regular tenant users can execute this statement. | |
| CALL dbms_recyclebin.* | Y | The recycle bin feature supports multi-tenancy. Database names are automatically suffixed with tenant names. | |
| CALL dbms_recyclebin.show_tables() | Y-Not isolated per tenant | There is no permission restriction. Regular tenant users can execute this statement. | |
| SHOW LSNINFO | Y-Not isolated per tenant | Regular tenant users can execute this statement. | |
| CALL dbms_sqlfilter.* | Y | There is no permission restriction on query statements (dbms_sqlfilter.show_sql_filter). Administration statements (dbms_sqlfilter.add_sql_filter, del_sql_filter, and flush_sql_filter) require the SUPER privilege. | |
| RDS_TAC | N | TaurusDB does not support this statement in multi-tenant mode. | |
| CALL dbms_xxx.* | Y | NATIVE PACKAGE is supported in multi-tenant mode. Permission requirements vary with subpackage. There is no permission restriction on query statements, and administration statements require the SUPER privilege. | |
| SHOW GLOBAL REPLICA STATUS | Y | Regular tenant users can execute this statement only after being granted the SUPER or REPLICATION CLIENT privilege. | |
| RDS_GDB_CTRL | N | TaurusDB does not support this statement in multi-tenant mode. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot