Bug #110937 checkForServerUpgrade does't check if rows will exceed 8126 bytes
Submitted: 5 May 2023 17:19 Modified: 6 May 2023 6:32
Reporter: Marcos Albe (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Shell Upgrade Checker Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[5 May 2023 17:19] Marcos Albe
Description:
In MySQL 5.7 one could create tables exceeding 8126 bytes:

SET sql_mode='';
SET innodb_strict_mode=OFF;

CREATE TABLE `CELL` (   `daytime` datetime  not null , `node_id` tinyint unsigned not null , `element_id` int unsigned not null , `b_0`mediumtext  null , `b_1`mediumtext  null , `b_2`mediumtext  null , `aa`mediumtext  null , `bb` tinyint unsigned null , `cc` int unsigned null , `dd` int unsigned null , `ee`mediumtext  null , `ff`mediumtext  null , `gg`mediumtext  null , `hh`mediumtext  null , `ii`mediumtext  null , `jj` int unsigned null , `kk`mediumtext  null , `c_0` int unsigned null , `c_1` int unsigned null , `c_10` tinyint unsigned null , `c_2` int unsigned null , `c_20` tinyint unsigned null , `c_21` tinyint unsigned null , `c_22` tinyint unsigned null , `c_23` tinyint unsigned null , `c_24` tinyint unsigned null , `c_25` tinyint unsigned null , `c_26` tinyint unsigned null , `c_27` tinyint unsigned null , `c_28` tinyint unsigned null , `c_29` tinyint unsigned null , `c_3` int unsigned null , `c_30` tinyint unsigned null , `c_31` tinyint unsigned null , `c_4` tinyint unsigned null , `c_5` tinyint unsigned null , `c_6` tinyint unsigned null , `c_7` tinyint unsigned null , `c_8` tinyint unsigned null , `c_9` tinyint unsigned null , `ll` int unsigned null , `mm` int unsigned null , `nn` int unsigned null , `oo` int unsigned null , `pp` int unsigned null , `qq` int unsigned null , `rr` int unsigned null , `ss` int unsigned null , `tt` int unsigned null , `uu` int unsigned null , `d_0` tinyint unsigned null , `d_1` tinyint unsigned null , `d_10` tinyint unsigned null , `d_11` tinyint unsigned null , `d_12` tinyint unsigned null , `d_13` tinyint unsigned null , `d_14` tinyint unsigned null , `d_15` tinyint unsigned null , `d_2` tinyint unsigned null , `d_3` tinyint unsigned null , `d_4` tinyint unsigned null , `d_5` tinyint unsigned null , `d_6` tinyint unsigned null , `d_7` tinyint unsigned null , `d_8` tinyint unsigned null , `d_9` tinyint unsigned null , `e_0` mediumtext  null , `e_1` mediumtext  null , `e_10` mediumtext  null , `e_11` mediumtext  null , `e_12` mediumtext  null , `e_13` mediumtext  null , `e_14` mediumtext  null , `e_15` mediumtext  null , `e_16` mediumtext  null , `e_17` mediumtext  null , `e_18` mediumtext  null , `e_19` mediumtext  null , `e_2` mediumtext  null , `e_20` mediumtext  null , `e_21` mediumtext  null , `e_22` mediumtext  null , `e_23` mediumtext  null , `e_24` mediumtext  null , `e_25` mediumtext  null , `e_26` mediumtext  null , `e_27` mediumtext  null , `e_28` mediumtext  null , `e_29` mediumtext  null , `e_3` mediumtext  null , `e_30` mediumtext  null , `e_31` mediumtext  null , `e_32` mediumtext  null , `e_33` mediumtext  null , `e_34` mediumtext  null , `e_35` mediumtext  null , `e_36` mediumtext  null , `e_37` mediumtext  null , `e_38` mediumtext  null , `e_39` mediumtext  null , `e_4` mediumtext  null , `e_40` mediumtext  null , `e_41` mediumtext  null , `e_42` mediumtext  null , `e_43` mediumtext  null , `e_44` mediumtext  null , `e_45` mediumtext  null , `e_46` mediumtext  null , `e_47` mediumtext  null , `e_48` mediumtext  null , `e_49` mediumtext  null , `e_5` mediumtext  null , `e_50` mediumtext  null , `e_51` mediumtext  null , `e_52` mediumtext  null , `e_53` mediumtext  null , `e_54` mediumtext  null , `e_55` mediumtext  null , `e_56` mediumtext  null , `e_57` mediumtext  null , `e_58` mediumtext  null , `e_59` mediumtext  null , `e_6` mediumtext  null , `e_60` mediumtext  null , `e_61` mediumtext  null , `e_62` mediumtext  null , `e_63` mediumtext  null , `e_7` mediumtext  null , `e_8` mediumtext  null , `e_9` mediumtext  null , `f_0` mediumtext  null , `f_1` mediumtext  null , `f_10` mediumtext  null , `f_11` mediumtext  null , `f_12` mediumtext  null , `f_13` mediumtext  null , `f_14` mediumtext  null , `f_15` mediumtext  null , `f_16` mediumtext  null , `f_17` mediumtext  null , `f_18` mediumtext  null , `f_19` mediumtext  null , `f_2` mediumtext  null , `f_20` mediumtext  null , `f_21` mediumtext  null , `f_22` mediumtext  null , `f_23` mediumtext  null , `f_24` mediumtext  null , `f_25` mediumtext  null , `f_26` mediumtext  null , `f_27` mediumtext  null , `f_28` mediumtext  null , `f_29` mediumtext  null , `f_3` mediumtext  null , `f_30` mediumtext  null , `f_31` mediumtext  null , `f_32` mediumtext  null , `f_33` mediumtext  null , `f_34` mediumtext  null , `f_35` mediumtext  null , `f_36` mediumtext  null , `f_37` mediumtext  null , `f_38` mediumtext  null , `f_39` mediumtext  null , `f_4` mediumtext  null , `f_40` mediumtext  null , `f_41` mediumtext  null , `f_42` mediumtext  null , `f_43` mediumtext  null , `f_44` mediumtext  null , `f_45` mediumtext  null , `f_46` mediumtext  null , `f_47` mediumtext  null , `f_48` mediumtext  null , `f_49` mediumtext  null , `f_5` mediumtext  null , `f_50` mediumtext  null , `f_51` mediumtext  null , `f_52` mediumtext  null , `f_53` mediumtext  null , `f_54` mediumtext  null , `f_55` mediumtext  null , `f_56` mediumtext  null , `f_57` mediumtext  null , `f_58` mediumtext  null , `f_59` mediumtext  null , `f_6` mediumtext  null , `f_60` mediumtext  null , `f_61` mediumtext  null , `f_62` mediumtext  null , `f_63` mediumtext  null , `f_7` mediumtext  null , `f_8` mediumtext  null , `f_9` mediumtext  null , `g_0` mediumtext  null , `g_1` mediumtext  null , `g_10` mediumtext  null , `g_11` mediumtext  null , `g_12` mediumtext  null , `g_13` mediumtext  null , `g_14` mediumtext  null , `g_15` mediumtext  null , `g_16` mediumtext  null , `g_17` mediumtext  null , `g_18` mediumtext  null , `g_19` mediumtext  null , `g_2` mediumtext  null , `g_20` mediumtext  null , `g_21` mediumtext  null , `g_22` mediumtext  null , `g_23` mediumtext  null , `g_24` mediumtext  null , `g_25` mediumtext  null , `g_26` mediumtext  null , `g_27` mediumtext  null , `g_28` mediumtext  null , `g_29` mediumtext  null , `g_3` mediumtext  null , `g_30` mediumtext  null , `g_31` mediumtext  null , `g_32` mediumtext  null , `g_33` mediumtext  null , `g_34` mediumtext  null , `g_35` mediumtext  null , `g_36` mediumtext  null , `g_37` mediumtext  null , `g_38` mediumtext  null , `g_39` mediumtext  null , `g_4` mediumtext  null , `g_40` mediumtext  null , `g_41` mediumtext  null , `g_42` mediumtext  null , `g_43` mediumtext  null , `g_44` mediumtext  null , `g_45` mediumtext  null , `g_46` mediumtext  null , `g_47` mediumtext  null , `g_48` mediumtext  null , `g_49` mediumtext  null , `g_5` mediumtext  null , `g_50` mediumtext  null , `g_51` mediumtext  null , `g_52` mediumtext  null , `g_53` mediumtext  null , `g_54` mediumtext  null , v1 varchar(255) null , v2 varchar(255) null , v3 varchar(255) null , v4 varchar(255) null , v5 varchar(255) null , v6 varchar(255) null , v7 varchar(255) null , v8 varchar(255) null , primary key (element_id, daytime)) ENGINE=InnoDB DEFAULT CHARSET=latin1;

And while I reckon that disabling strict mode is less than ideal, reality is there are thousands of deployments with tables like the above all over the world, and upgrades to 8.0 are plagued with warnings, so it seems like a good idea to check for tables that would violate the 8126 bytes limit when running in strict mode. 

How to repeat:
Disable InnoDB strict mode and create table as shown above in 5.7, then perform in-place upgrade of that 5.7 to 8.0

Suggested fix:
Have util.checkForServerUpgrade verify if any table will violate strict mode.
[6 May 2023 6:32] MySQL Verification Team
Hello Marcos,

Thank you for the feature request.

regards,
Umesh