Skip to content
  • Gopal Shankar's avatar
    2f3629a3
    WL#12571 Support fully qualified hostnames longer than 60 characters · 2f3629a3
    Gopal Shankar authored
    The WL enables support for long hostnames, with maximum of 255
    characters.
    
    There are several areas in MySQL that are changed. Following are
    the details:
    
    SERVER:
      * The following Dictionary columns are changed to use 288 char.
        definer is of the form <user_name>@<host_name> (32+1+255).
    
        mysql.servers.Host
        mysql.tables.definer
        mysql.events.definer
        mysql.routines.definer
        mysql.triggers.definer
    
        - DD version is increased due to above change.
    
      * The following INFORMATION_SCHEMA (I_S) table column size are increased
        to accomodate long hostname,
    
        I_S.USER_PRIVILEGES.GRANTEE
        I_S.SCHEMA_PRIVILEGE.GRANTEE
        I_S.TABLE_PRIVILEGE.GRANTEE
        I_S.COLUMN_PRIVILEGE.GRANTEE
        I_S.PROCESSLIST.Host
        I_S.CONNECTION_CONTROL_FAILED_ATTEMPTS.USERHOST
    
      * Changes to macros/constants:
    
        - Increase value of HOSTNAME_LENGTH from 60 to 255.
        - Removed MAX_HOSTNAME and used HOSTNAME_LENGTH instead.
        - Removed LIST_PROCESS_HOST_LEN and used HOSTNAME_LENGTH instead.
    
      * Temporary file creation to check for file system sensitivity
        now uses a predefined filename instead of using hostname in
        the file name. This avoids failure due to OS max file name
        limit of 255 char.
    
      * Error messages that display host names are changed to use
        %255s specifier instead of %64s.
    
    ACL:
      * The following ACL columns are changed to use 255 char.
        mysql.db.Host
        mysql.user.Host
        mysql.default_roles.HOST
        mysql.default_roles.DEFAULT_ROLE_HOST
        mysql.role_edges.FROM_HOST
        mysql.role_edges.TO_HOST
        mysql.global_grants.HOST
        mysql.password_history.HOST
        mysql.tables_priv.Host
        mysql.columns_priv.Host
        mysql.procs_priv.Host
        mysql.proxies_priv.Host
        mysql.proxies_priv.Proxied_host
    
      * The following ACL columns are changed to use 288 char.
        Grantor is of the form <user_name>@<host_name> (32+1+255).
    
        mysql.proxies_priv.Grantor
        mysql.procs_priv.Grantor
        mysql.tables_priv.Grantor
    
      * scripts/mysql_system_tables.sql is modified to increase the
        length of host name columns in of ACL dictionary tables.
    
      * scripts/mysql_system_tables_fix.sql is modified to fix the
        ACL table hostname columns to use new host name length upon
        a upgrade.
    
      * The hardcoded ACL table definitions in source are modified
        to use long hostname in there definitions. These definitions
        are used to check if ACL table definition is not corrupt.
    
      * The SHOW CREATE USER command buffer length is changed. This
        fixed a windows issue, where it attempts to use more bytes
        than allocated.
    
    PERFORMANCE SCHEMA:
      * Performance schema table columns which stores hostnames are
        modified to store 255 characters.
    
      * Performance schema version is changed, so that the upgrade
        re-creates the schema definitions.
    
      * The constant PSI_HOSTNAME_LENGTH is increased to 255.
    
    SYS SCHEMA:
      * sys.ps_is_account_enabled function parameter 'in_host' is
        changed to use 255 character.
    
      * sys.version is modified incrementing the version, so that the
        sys schema is re-created upon upgrade.
    
      * sys.ps_setup_save uses "CREATE TABLE ... SELECT ... LIMIT 0", instead
        of "CREATE TABLE ... LIKE ..." to force use of InnoDB engine for
        temporary table instead of MyISAM. This is required to avoid max key
        length issue in MyISAM.
    
    AUDIT_LOG_FILTER:
    
      * mysql.audit_log_user.HOST column length is increased to 255.
    
    REPLICATION:
      * Binlog event size takes the new length of hostname into account.
    
      * Implementation of SHOW SLAVE HOSTS command is changed to use
        long hostname.
    
      * mysql.slave_master_info.Host
    
    TESTS:
      We use debug variable to fake hostname within the server for testing.
    
      * main.hostname_length - Test ACL, DD, I_S
      * perfschema.hostname_length - Test P_S
      * rpl.rpl_long_invoker_hostname - Test long hostname in event long.
      * main.mysqlpump_long_hostname - Test mysqlpump and restore the schema.
      * main.mysql_80_inplace_upgrade is modified to use --skip-grant-tables
        options with --upgrade=MINIMAL option. This is required if ACL tables
        need upgrade.
      * rpl.rpl_long_invoker_hostname - Test invoker with long hostname.
      * rpl.rpl_lengthy_hostname - Basic replication using long report hostname.
      * rpl.gr_member_lengthy_hostname - Basic GR setup and PS tables.
      * connection_control.connection_control_long_hostname.
      * audit_log.audit_log_filter_long_hostname
    
    NDB:
      * Added a hostname check unit test in NdbTCP.cpp.
    
    UPGRADE:
      * Due to "WL#12971: Make MySQL stop if it can't source the privilege
        tables" the upgrade MINIMAL mode would fail if we don't use
        --skip-grant-tables option and if ACL tables are modified in current
        mysql version to which we are upgrading. The test case
        mysql_80_inplace_upgrade is updated.
    
    Change-Id: I9549c6ef188c107837b532c89fd4791e4557383d
    2f3629a3
    WL#12571 Support fully qualified hostnames longer than 60 characters
    Gopal Shankar authored
    The WL enables support for long hostnames, with maximum of 255
    characters.
    
    There are several areas in MySQL that are changed. Following are
    the details:
    
    SERVER:
      * The following Dictionary columns are changed to use 288 char.
        definer is of the form <user_name>@<host_name> (32+1+255).
    
        mysql.servers.Host
        mysql.tables.definer
        mysql.events.definer
        mysql.routines.definer
        mysql.triggers.definer
    
        - DD version is increased due to above change.
    
      * The following INFORMATION_SCHEMA (I_S) table column size are increased
        to accomodate long hostname,
    
        I_S.USER_PRIVILEGES.GRANTEE
        I_S.SCHEMA_PRIVILEGE.GRANTEE
        I_S.TABLE_PRIVILEGE.GRANTEE
        I_S.COLUMN_PRIVILEGE.GRANTEE
        I_S.PROCESSLIST.Host
        I_S.CONNECTION_CONTROL_FAILED_ATTEMPTS.USERHOST
    
      * Changes to macros/constants:
    
        - Increase value of HOSTNAME_LENGTH from 60 to 255.
        - Removed MAX_HOSTNAME and used HOSTNAME_LENGTH instead.
        - Removed LIST_PROCESS_HOST_LEN and used HOSTNAME_LENGTH instead.
    
      * Temporary file creation to check for file system sensitivity
        now uses a predefined filename instead of using hostname in
        the file name. This avoids failure due to OS max file name
        limit of 255 char.
    
      * Error messages that display host names are changed to use
        %255s specifier instead of %64s.
    
    ACL:
      * The following ACL columns are changed to use 255 char.
        mysql.db.Host
        mysql.user.Host
        mysql.default_roles.HOST
        mysql.default_roles.DEFAULT_ROLE_HOST
        mysql.role_edges.FROM_HOST
        mysql.role_edges.TO_HOST
        mysql.global_grants.HOST
        mysql.password_history.HOST
        mysql.tables_priv.Host
        mysql.columns_priv.Host
        mysql.procs_priv.Host
        mysql.proxies_priv.Host
        mysql.proxies_priv.Proxied_host
    
      * The following ACL columns are changed to use 288 char.
        Grantor is of the form <user_name>@<host_name> (32+1+255).
    
        mysql.proxies_priv.Grantor
        mysql.procs_priv.Grantor
        mysql.tables_priv.Grantor
    
      * scripts/mysql_system_tables.sql is modified to increase the
        length of host name columns in of ACL dictionary tables.
    
      * scripts/mysql_system_tables_fix.sql is modified to fix the
        ACL table hostname columns to use new host name length upon
        a upgrade.
    
      * The hardcoded ACL table definitions in source are modified
        to use long hostname in there definitions. These definitions
        are used to check if ACL table definition is not corrupt.
    
      * The SHOW CREATE USER command buffer length is changed. This
        fixed a windows issue, where it attempts to use more bytes
        than allocated.
    
    PERFORMANCE SCHEMA:
      * Performance schema table columns which stores hostnames are
        modified to store 255 characters.
    
      * Performance schema version is changed, so that the upgrade
        re-creates the schema definitions.
    
      * The constant PSI_HOSTNAME_LENGTH is increased to 255.
    
    SYS SCHEMA:
      * sys.ps_is_account_enabled function parameter 'in_host' is
        changed to use 255 character.
    
      * sys.version is modified incrementing the version, so that the
        sys schema is re-created upon upgrade.
    
      * sys.ps_setup_save uses "CREATE TABLE ... SELECT ... LIMIT 0", instead
        of "CREATE TABLE ... LIKE ..." to force use of InnoDB engine for
        temporary table instead of MyISAM. This is required to avoid max key
        length issue in MyISAM.
    
    AUDIT_LOG_FILTER:
    
      * mysql.audit_log_user.HOST column length is increased to 255.
    
    REPLICATION:
      * Binlog event size takes the new length of hostname into account.
    
      * Implementation of SHOW SLAVE HOSTS command is changed to use
        long hostname.
    
      * mysql.slave_master_info.Host
    
    TESTS:
      We use debug variable to fake hostname within the server for testing.
    
      * main.hostname_length - Test ACL, DD, I_S
      * perfschema.hostname_length - Test P_S
      * rpl.rpl_long_invoker_hostname - Test long hostname in event long.
      * main.mysqlpump_long_hostname - Test mysqlpump and restore the schema.
      * main.mysql_80_inplace_upgrade is modified to use --skip-grant-tables
        options with --upgrade=MINIMAL option. This is required if ACL tables
        need upgrade.
      * rpl.rpl_long_invoker_hostname - Test invoker with long hostname.
      * rpl.rpl_lengthy_hostname - Basic replication using long report hostname.
      * rpl.gr_member_lengthy_hostname - Basic GR setup and PS tables.
      * connection_control.connection_control_long_hostname.
      * audit_log.audit_log_filter_long_hostname
    
    NDB:
      * Added a hostname check unit test in NdbTCP.cpp.
    
    UPGRADE:
      * Due to "WL#12971: Make MySQL stop if it can't source the privilege
        tables" the upgrade MINIMAL mode would fail if we don't use
        --skip-grant-tables option and if ACL tables are modified in current
        mysql version to which we are upgrading. The test case
        mysql_80_inplace_upgrade is updated.
    
    Change-Id: I9549c6ef188c107837b532c89fd4791e4557383d
Loading