mariadb/scripts
Lorna Luo acfb5dfd97 MDEV-22683: Ensure system tables are correctly upgraded in MariaDB 10.4
Running mysql_upgrade should end up with the exact same system tables as fresh
installations have after running mysql_install_db. To ensure the upgrade is
correct and complete:

- Remove the redundant modification of thread_id`. On 5.5 version, the
  `general_log` table was created as `CREATE TABLE IF NOT EXISTS general_log
  (..., thread_id INTEGER NOT NULL, ...)`, and starting from 10.0+, the table is
  created as `CREATE TABLE IF NOT EXISTS general_log (..., thread_id BIGINT(21)
  UNSIGNED NOT NULL, ...)`, but mysql_upgrade is not properly upgrading the
  table. It modifies the `thread_id` twice in one query, which could leave the
  table not modified and lead to other potential error when upgrading from
  MariaDB 5.5 or older.

- Update `servers` to ensure `Host` and `User` has correct data type if
  upgrading from 10.1 or older. On versions 10.0 and 10.1, the `servers` table
  was created as `CREATE TABLE IF NOT EXISTS servers (..., Host char(64) NOT
  NULL DEFAULT , ..., Owner char(64) NOT NULL DEFAULT , ...)`, and starting
  from 10.2, the table is created as `CREATE TABLE IF NOT EXISTS servers (...,
  Host varchar(2048) NOT NULL DEFAULT , ..., Owner varchar(512) NOT NULL
  DEFAULT , ...)`.

All new code of the whole pull request, including one or several files that
are either new files or modified ones, are contributed under the BSD-new license.
I am contributing on behalf of my employer Amazon Web Services, Inc.
2023-03-02 09:06:35 +11:00
..
CMakeLists.txt
comp_sql.c
convert-debug-for-diff.sh
dheadgen.pl
fill_help_tables.sql
galera_new_cluster.sh
galera_recovery.sh
maria_add_gis_sp.sql.in
mariadb-service-convert
msql2mysql.sh
mysql_config.pl.in
mysql_config.sh
mysql_convert_table_format.sh
mysql_find_rows.sh
mysql_fix_extensions.sh
mysql_install_db.sh
mysql_performance_tables.sql
mysql_secure_installation.sh
mysql_setpermission.sh
mysql_system_tables.sql
mysql_system_tables_data.sql
mysql_system_tables_fix.sql
mysql_test_data_timezone.sql
mysql_test_db.sql
mysqlaccess.conf
mysqlaccess.sh
mysqld_multi.sh
mysqld_safe.sh
mysqldumpslow.sh
mysqlhotcopy.sh
mytop.sh
wsrep_sst_backup.sh
wsrep_sst_common.sh
wsrep_sst_mariabackup.sh
wsrep_sst_mysqldump.sh
wsrep_sst_rsync.sh