-
Praveenkumar Hulakund authored
Metadata of a user defined function(UDF) is stored in the data-dictionary external system(DDES) table 'mysql.func'. In 8.0, mysql.func is created in the transactional storage engine(SE) InnoDB. DDL operation to create a UDF is atomic. But user is still allowed to change engine of mysql.func to MyISAM(non-transctional SE). Attempt to create a UDF in this case hits the assert condition related to atomic operation. In 8.0 data-dictionary tables are stored in the InnoDB. Storing DDES tables in other engine is not supported. Ideally, creating or moving DDES table to MyISAM should not be allowed. But creating a DDES table in MyISAM is allowed to support only Logical Upgrade. Logical upgrade contains following steps, > mysql < data-for-upgrade.sql (data-for-upgrade.sql contains DROP and CREATE TABLE operations to create DDES tables and INSERT operations to populate table) > mysqld --upgrade=FORCE (contains steps to move DDES to InnoDB SE). CREATE TABLE in MyISAM engine and INSERT operation to populate DDES table is allowed to support logical upgrade. Following changes are done as part of this patch to fix the issue without altering support for the Logical upgrade, 1. Creation of DDES tables in MyISAM SE is allowed. Warning is reported for DDES tables. 2. Altering DDES table's SE to MyISAM is not allowed. 3. INSERT operation on DDES table in MyISAM table is allowed to support Logical upgrade. But similar to ACL operations, functionality specific operations are not allowed. For example, If ACL table 'mysql.user' is in MyISAM SE, then CREATE USER operation is is not allowed. Similarly, following operations are not allowed if DDES table related to operation is in MyISAM engine, UDF: ---- 3.1 CREATE FUNCTION <UDF_name> RETURNS INTEGER SONAME <so_name>; 3.2 DROP FUNCTION <UDF_name> Plugin: ------- 3.3 INSTALL PLUGIN 3.4 UNINSTALL PLUGIN Server: ------- 3.5 CREATE SERVER 3.6 ALTER SERVER 3.7 DROP SERVER Component: ---------- 3.8 INSTALL COMPONENT 3.9 UNINSTALL COMPONENT INSERT and other DML operations are still allowed on DDES tables. But using these operations on DDES tables are not recommended and may result in unexpected behavior which is a known fact. 4. If DDES table is re-created with different structure in any SE then DDL operations are not allowed as mentioned in 3. 5. Creation of DDES tables in CSV SE is allowed. Warning is reported for DDES tables. Some DDES tables related to backup tool are created in CSV engine. 6. Altering DDES table's SE to CSV is not allowed. 7. INSERT operation on DDES table in CSV table is allowed to support Logical upgrade. Change-Id: If63f5fc1a9238a58530df827c0657b675377b735
Praveenkumar Hulakund authoredMetadata of a user defined function(UDF) is stored in the data-dictionary external system(DDES) table 'mysql.func'. In 8.0, mysql.func is created in the transactional storage engine(SE) InnoDB. DDL operation to create a UDF is atomic. But user is still allowed to change engine of mysql.func to MyISAM(non-transctional SE). Attempt to create a UDF in this case hits the assert condition related to atomic operation. In 8.0 data-dictionary tables are stored in the InnoDB. Storing DDES tables in other engine is not supported. Ideally, creating or moving DDES table to MyISAM should not be allowed. But creating a DDES table in MyISAM is allowed to support only Logical Upgrade. Logical upgrade contains following steps, > mysql < data-for-upgrade.sql (data-for-upgrade.sql contains DROP and CREATE TABLE operations to create DDES tables and INSERT operations to populate table) > mysqld --upgrade=FORCE (contains steps to move DDES to InnoDB SE). CREATE TABLE in MyISAM engine and INSERT operation to populate DDES table is allowed to support logical upgrade. Following changes are done as part of this patch to fix the issue without altering support for the Logical upgrade, 1. Creation of DDES tables in MyISAM SE is allowed. Warning is reported for DDES tables. 2. Altering DDES table's SE to MyISAM is not allowed. 3. INSERT operation on DDES table in MyISAM table is allowed to support Logical upgrade. But similar to ACL operations, functionality specific operations are not allowed. For example, If ACL table 'mysql.user' is in MyISAM SE, then CREATE USER operation is is not allowed. Similarly, following operations are not allowed if DDES table related to operation is in MyISAM engine, UDF: ---- 3.1 CREATE FUNCTION <UDF_name> RETURNS INTEGER SONAME <so_name>; 3.2 DROP FUNCTION <UDF_name> Plugin: ------- 3.3 INSTALL PLUGIN 3.4 UNINSTALL PLUGIN Server: ------- 3.5 CREATE SERVER 3.6 ALTER SERVER 3.7 DROP SERVER Component: ---------- 3.8 INSTALL COMPONENT 3.9 UNINSTALL COMPONENT INSERT and other DML operations are still allowed on DDES tables. But using these operations on DDES tables are not recommended and may result in unexpected behavior which is a known fact. 4. If DDES table is re-created with different structure in any SE then DDL operations are not allowed as mentioned in 3. 5. Creation of DDES tables in CSV SE is allowed. Warning is reported for DDES tables. Some DDES tables related to backup tool are created in CSV engine. 6. Altering DDES table's SE to CSV is not allowed. 7. INSERT operation on DDES table in CSV table is allowed to support Logical upgrade. Change-Id: If63f5fc1a9238a58530df827c0657b675377b735
Loading