From 6b9bba41e8949655152b3ce315357af51156908d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 25 May 2022 09:20:04 +0300 Subject: [PATCH] MDEV-28554: Remove innodb_version INNODB_VERSION_STR: Replaced with PACKAGE_VERSION (non-functional change). INNODB_VERSION_SHORT: Replaced with direct use of MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR. check_version(): Simplify the mariadb-backup version check, and require the server version to be MariaDB 10.8 or later, because that is when the InnoDB redo log format was last changed. --- extra/innochecksum.cc | 8 +- extra/mariabackup/backup_copy.cc | 2 +- extra/mariabackup/backup_mysql.cc | 92 +--- extra/mariabackup/backup_mysql.h | 8 +- .../suite/perfschema/t/show_sanity.test | 1 - .../sys_vars/r/innodb_version_basic.result | 17 - .../suite/sys_vars/r/sysvars_innodb.result | 1 - .../sys_vars/t/innodb_version_basic.test | 30 -- .../suite/sys_vars/t/sysvars_innodb.test | 1 - storage/innobase/handler/ha_innodb.cc | 11 +- storage/innobase/handler/i_s.cc | 436 +++--------------- storage/innobase/include/univ.i | 19 - storage/innobase/log/log0log.cc | 5 +- 13 files changed, 81 insertions(+), 550 deletions(-) delete mode 100644 mysql-test/suite/sys_vars/r/innodb_version_basic.result delete mode 100644 mysql-test/suite/sys_vars/t/innodb_version_basic.test diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index c0dd80cf02f..fc616f1aa14 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -1209,16 +1209,16 @@ static struct my_option innochecksum_options[] = { {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -/* Print out the Innodb version and machine information. */ -static void print_version(void) +/** Print out the version and build information. */ +static void print_version() { #ifdef DBUG_OFF printf("%s Ver %s, for %s (%s)\n", - my_progname, INNODB_VERSION_STR, + my_progname, PACKAGE_VERSION, SYSTEM_TYPE, MACHINE_TYPE); #else printf("%s-debug Ver %s, for %s (%s)\n", - my_progname, INNODB_VERSION_STR, + my_progname, PACKAGE_VERSION, SYSTEM_TYPE, MACHINE_TYPE); #endif /* DBUG_OFF */ } diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 49dd716f15f..77d26108bf7 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1492,7 +1492,7 @@ bool backup_start(CorruptedPages &corrupted_pages) } } - if (have_flush_engine_logs && !opt_no_lock) { + if (!opt_no_lock) { msg("Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS..."); xb_mysql_query(mysql_connection, "FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS", false); diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 2065711b9c2..28424f5cf32 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -62,16 +62,13 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA char *tool_name; char tool_args[2048]; -/* mysql flavor and version */ -mysql_flavor_t server_flavor = FLAVOR_UNKNOWN; -unsigned long mysql_server_version = 0; +ulong mysql_server_version; /* server capabilities */ bool have_changed_page_bitmaps = false; bool have_backup_locks = false; bool have_lock_wait_timeout = false; bool have_galera_enabled = false; -bool have_flush_engine_logs = false; bool have_multi_threaded_slave = false; bool have_gtid_slave = false; @@ -297,48 +294,13 @@ read_mysql_one_value(MYSQL *mysql, const char *query) static bool -check_server_version(unsigned long version_number, - const char *version_string, - const char *version_comment, - const char *innodb_version) +check_server_version(ulong version_number, const char *version_string) { - bool version_supported = false; - bool mysql51 = false; + if (strstr(version_string, "MariaDB") && version_number >= 100800) + return true; - mysql_server_version = version_number; - - server_flavor = FLAVOR_UNKNOWN; - if (strstr(version_comment, "Percona") != NULL) { - server_flavor = FLAVOR_PERCONA_SERVER; - } else if (strstr(version_comment, "MariaDB") != NULL || - strstr(version_string, "MariaDB") != NULL) { - server_flavor = FLAVOR_MARIADB; - } else if (strstr(version_comment, "MySQL") != NULL) { - server_flavor = FLAVOR_MYSQL; - } - - mysql51 = version_number > 50100 && version_number < 50500; - version_supported = version_supported - || (mysql51 && innodb_version != NULL); - version_supported = version_supported - || (version_number > 50500 && version_number < 50700); - version_supported = version_supported - || ((version_number > 100000) - && server_flavor == FLAVOR_MARIADB); - - if (mysql51 && innodb_version == NULL) { - msg("Error: Built-in InnoDB in MySQL 5.1 is not " - "supported in this release. You can either use " - "Percona XtraBackup 2.0, or upgrade to InnoDB " - "plugin."); - } else if (!version_supported) { - msg("Error: Unsupported server version: '%s'. Please " - "report a bug at " - "https://bugs.launchpad.net/percona-xtrabackup", - version_string); - } - - return(version_supported); + msg("Error: Unsupported server version: '%s'.", version_string); + return false; } /*********************************************************************//** @@ -348,8 +310,6 @@ bool get_mysql_vars(MYSQL *connection) { char *gtid_mode_var= NULL; char *version_var= NULL; - char *version_comment_var= NULL; - char *innodb_version_var= NULL; char *have_backup_locks_var= NULL; char *log_bin_var= NULL; char *lock_wait_timeout_var= NULL; @@ -369,7 +329,7 @@ bool get_mysql_vars(MYSQL *connection) char *page_zip_level_var= NULL; char *ignore_db_dirs= NULL; char *endptr; - unsigned long server_version= mysql_get_server_version(connection); + ulong server_version= mysql_get_server_version(connection); bool ret= true; @@ -379,8 +339,6 @@ bool get_mysql_vars(MYSQL *connection) {"lock_wait_timeout", &lock_wait_timeout_var}, {"gtid_mode", >id_mode_var}, {"version", &version_var}, - {"version_comment", &version_comment_var}, - {"innodb_version", &innodb_version_var}, {"wsrep_on", &wsrep_on_var}, {"slave_parallel_workers", &slave_parallel_workers_var}, {"gtid_slave_pos", >id_slave_pos_var}, @@ -423,18 +381,13 @@ bool get_mysql_vars(MYSQL *connection) have_galera_enabled= true; } - /* Check server version compatibility and detect server flavor */ - - if (!(ret= check_server_version(server_version, version_var, - version_comment_var, innodb_version_var))) + /* Check server version compatibility */ + if (!(ret= check_server_version(server_version, version_var))) { goto out; } - if (server_version > 50500) - { - have_flush_engine_logs= true; - } + mysql_server_version= server_version; if (slave_parallel_workers_var != NULL && atoi(slave_parallel_workers_var) > 0) @@ -565,16 +518,6 @@ detect_mysql_capabilities_for_backup() have_changed_page_bitmaps = (atoi(innodb_changed_pages) == 1); - /* INNODB_CHANGED_PAGES are listed in - INFORMATION_SCHEMA.PLUGINS in MariaDB, but - FLUSH NO_WRITE_TO_BINLOG CHANGED_PAGE_BITMAPS - is not supported for versions below 10.1.6 - (see MDEV-7472) */ - if (server_flavor == FLAVOR_MARIADB && - mysql_server_version < 100106) { - have_changed_page_bitmaps = false; - } - free_mysql_variables(vars); } @@ -1381,21 +1324,8 @@ bool write_slave_info(MYSQL *connection) { String sql, comment; - bool show_all_slaves_status= false; - switch (server_flavor) - { - case FLAVOR_MARIADB: - show_all_slaves_status= mysql_server_version >= 100000; - break; - case FLAVOR_UNKNOWN: - case FLAVOR_MYSQL: - case FLAVOR_PERCONA_SERVER: - break; - } - - if (Show_slave_status::get_slave_info(connection, show_all_slaves_status, - &sql, &comment)) + if (Show_slave_status::get_slave_info(connection, true, &sql, &comment)) return false; // Error if (!sql.length()) diff --git a/extra/mariabackup/backup_mysql.h b/extra/mariabackup/backup_mysql.h index 5e78281e1cb..291e55e3ea8 100644 --- a/extra/mariabackup/backup_mysql.h +++ b/extra/mariabackup/backup_mysql.h @@ -3,18 +3,14 @@ #include -/* mysql flavor and version */ -enum mysql_flavor_t { FLAVOR_UNKNOWN, FLAVOR_MYSQL, - FLAVOR_PERCONA_SERVER, FLAVOR_MARIADB }; -extern mysql_flavor_t server_flavor; -extern unsigned long mysql_server_version; +/* MariaDB version */ +extern ulong mysql_server_version; /* server capabilities */ extern bool have_changed_page_bitmaps; extern bool have_backup_locks; extern bool have_lock_wait_timeout; extern bool have_galera_enabled; -extern bool have_flush_engine_logs; extern bool have_multi_threaded_slave; extern bool have_gtid_slave; diff --git a/mysql-test/suite/perfschema/t/show_sanity.test b/mysql-test/suite/perfschema/t/show_sanity.test index 171bbfa8bd6..3ca88b556f8 100644 --- a/mysql-test/suite/perfschema/t/show_sanity.test +++ b/mysql-test/suite/perfschema/t/show_sanity.test @@ -496,7 +496,6 @@ insert into test.sanity values ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_LOG_TRUNCATE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_TABLESPACES"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_USE_NATIVE_AIO"), - ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_VERSION"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_WRITE_IO_THREADS"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INTERNAL_TMP_DISK_STORAGE_ENGINE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "KEY_BUFFER_SIZE"), diff --git a/mysql-test/suite/sys_vars/r/innodb_version_basic.result b/mysql-test/suite/sys_vars/r/innodb_version_basic.result deleted file mode 100644 index 759b5048512..00000000000 --- a/mysql-test/suite/sys_vars/r/innodb_version_basic.result +++ /dev/null @@ -1,17 +0,0 @@ -select @@global.innodb_version; -@@global.innodb_version -x.y.z -select @@session.innodb_version; -ERROR HY000: Variable 'innodb_version' is a GLOBAL variable -show global variables like 'innodb_version' disabled so to not change with every version; -show session variables like 'innodb_version' disabled so to not change with every version; -select VARIABLE_VALUE=@@global.innodb_version from information_schema.global_variables where variable_name='innodb_version'; -VARIABLE_VALUE=@@global.innodb_version -1 -select VARIABLE_VALUE=@@global.innodb_version from information_schema.session_variables where variable_name='innodb_version'; -VARIABLE_VALUE=@@global.innodb_version -1 -set global innodb_version=1; -ERROR HY000: Variable 'innodb_version' is a read only variable -set session innodb_version=1; -ERROR HY000: Variable 'innodb_version' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index e8573487ed7..2f193f5c96b 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1,7 +1,6 @@ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables where variable_name like 'innodb%' and variable_name not in ( -'innodb_version', # always the same as the server version 'innodb_numa_interleave', # only available WITH_NUMA 'innodb_evict_tables_on_commit_debug', # one may want to override this 'innodb_use_native_aio', # default value depends on OS diff --git a/mysql-test/suite/sys_vars/t/innodb_version_basic.test b/mysql-test/suite/sys_vars/t/innodb_version_basic.test deleted file mode 100644 index 182841048f7..00000000000 --- a/mysql-test/suite/sys_vars/t/innodb_version_basic.test +++ /dev/null @@ -1,30 +0,0 @@ - -# -# 2010-01-27 OBN - Added -# - ---source include/have_innodb.inc - -# -# show the global and session values; -# ---let $inno_ver= `select @@global.innodb_version` ---replace_result $inno_ver x.y.z -select @@global.innodb_version; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.innodb_version; ---echo show global variables like 'innodb_version' disabled so to not change with every version; ---echo show session variables like 'innodb_version' disabled so to not change with every version; ---disable_warnings -select VARIABLE_VALUE=@@global.innodb_version from information_schema.global_variables where variable_name='innodb_version'; -select VARIABLE_VALUE=@@global.innodb_version from information_schema.session_variables where variable_name='innodb_version'; ---enable_warnings - -# -# show that it's read-only -# ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -set global innodb_version=1; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -set session innodb_version=1; - diff --git a/mysql-test/suite/sys_vars/t/sysvars_innodb.test b/mysql-test/suite/sys_vars/t/sysvars_innodb.test index 15fd99e9984..b0a65eac8a8 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_innodb.test +++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test @@ -8,7 +8,6 @@ select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables where variable_name like 'innodb%' and variable_name not in ( - 'innodb_version', # always the same as the server version 'innodb_numa_interleave', # only available WITH_NUMA 'innodb_evict_tables_on_commit_debug', # one may want to override this 'innodb_use_native_aio', # default value depends on OS diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b19d3adefac..fe631b50c28 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -202,8 +202,6 @@ static my_bool innobase_create_status_file; my_bool innobase_stats_on_metadata; static my_bool innodb_optimize_fulltext_only; -static char* innodb_version_str = (char*) INNODB_VERSION_STR; - extern uint srv_fil_crypt_rotate_key_age; extern uint srv_n_fil_crypt_iops; @@ -19433,10 +19431,6 @@ static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode, AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */ AUTOINC_NO_LOCKING, 0); /* Maximum value */ -static MYSQL_SYSVAR_STR(version, innodb_version_str, - PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY, - "InnoDB version", NULL, NULL, INNODB_VERSION_STR); - #ifdef HAVE_URING # include static utsname uname_for_io_uring; @@ -19827,7 +19821,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(prefix_index_cluster_optimization), MYSQL_SYSVAR(tmpdir), MYSQL_SYSVAR(autoinc_lock_mode), - MYSQL_SYSVAR(version), MYSQL_SYSVAR(use_native_aio), #ifdef HAVE_LIBNUMA MYSQL_SYSVAR(numa_interleave), @@ -19907,10 +19900,10 @@ maria_declare_plugin(innobase) PLUGIN_LICENSE_GPL, innodb_init, /* Plugin Init */ NULL, /* Plugin Deinit */ - INNODB_VERSION_SHORT, + MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR, innodb_status_variables_export,/* status variables */ innobase_system_variables, /* system variables */ - INNODB_VERSION_STR, /* string version */ + PACKAGE_VERSION, MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ }, i_s_innodb_trx, diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 97f7013465c..cf69bd66f34 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -513,6 +513,9 @@ static struct st_mysql_information_schema i_s_info = MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; +/** version number reported by SHOW PLUGINS */ +constexpr unsigned i_s_version= MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR; + struct st_maria_plugin i_s_innodb_trx = { /* the plugin type (a MYSQL_XXX_PLUGIN value) */ @@ -547,19 +550,8 @@ struct st_maria_plugin i_s_innodb_trx = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; static const LEX_CSTRING lock_mode_values[] = @@ -762,19 +754,8 @@ struct st_maria_plugin i_s_innodb_locks = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -916,19 +897,8 @@ struct st_maria_plugin i_s_innodb_lock_waits = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; /*******************************************************************//** @@ -1204,19 +1174,8 @@ struct st_maria_plugin i_s_innodb_cmp = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; struct st_maria_plugin i_s_innodb_cmp_reset = @@ -1254,19 +1213,8 @@ struct st_maria_plugin i_s_innodb_cmp_reset = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -1510,19 +1458,8 @@ struct st_maria_plugin i_s_innodb_cmp_per_index = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; struct st_maria_plugin i_s_innodb_cmp_per_index_reset = @@ -1560,19 +1497,8 @@ struct st_maria_plugin i_s_innodb_cmp_per_index_reset = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -1755,19 +1681,8 @@ struct st_maria_plugin i_s_innodb_cmpmem = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; struct st_maria_plugin i_s_innodb_cmpmem_reset = @@ -1805,19 +1720,8 @@ struct st_maria_plugin i_s_innodb_cmpmem_reset = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -2237,19 +2141,8 @@ struct st_maria_plugin i_s_innodb_metrics = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -2346,19 +2239,8 @@ struct st_maria_plugin i_s_innodb_ft_default_stopword = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -2515,19 +2397,8 @@ struct st_maria_plugin i_s_innodb_ft_deleted = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; /*******************************************************************//** @@ -2598,19 +2469,8 @@ struct st_maria_plugin i_s_innodb_ft_being_deleted = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -2861,19 +2721,8 @@ struct st_maria_plugin i_s_innodb_ft_index_cache = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; /*******************************************************************//** @@ -3291,19 +3140,8 @@ struct st_maria_plugin i_s_innodb_ft_index_table = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -3484,19 +3322,8 @@ struct st_maria_plugin i_s_innodb_ft_config = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -3784,19 +3611,8 @@ struct st_maria_plugin i_s_innodb_buffer_stats = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; /** These must correspond to the first values of buf_page_state */ @@ -4320,19 +4136,8 @@ struct st_maria_plugin i_s_innodb_buffer_page = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -4673,19 +4478,8 @@ struct st_maria_plugin i_s_innodb_buffer_page_lru = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; /*******************************************************************//** @@ -4961,19 +4755,8 @@ struct st_maria_plugin i_s_innodb_sys_tables = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -5207,19 +4990,8 @@ struct st_maria_plugin i_s_innodb_sys_tablestats = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -5446,19 +5218,8 @@ struct st_maria_plugin i_s_innodb_sys_indexes = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -5659,19 +5420,8 @@ struct st_maria_plugin i_s_innodb_sys_columns = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -5846,19 +5596,8 @@ struct st_maria_plugin i_s_innodb_sys_virtual = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; @@ -6041,19 +5780,8 @@ struct st_maria_plugin i_s_innodb_sys_fields = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -6237,19 +5965,8 @@ struct st_maria_plugin i_s_innodb_sys_foreign = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -6433,19 +6150,8 @@ struct st_maria_plugin i_s_innodb_sys_foreign_cols = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -6639,19 +6345,8 @@ struct st_maria_plugin i_s_innodb_sys_tablespaces = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, - MariaDB_PLUGIN_MATURITY_STABLE, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, + MariaDB_PLUGIN_MATURITY_STABLE }; namespace Show { @@ -6866,17 +6561,6 @@ struct st_maria_plugin i_s_innodb_tablespaces_encryption = /* int (*)(void*); */ i_s_common_deinit, - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - INNODB_VERSION_SHORT, - - /* struct st_mysql_show_var* */ - NULL, - - /* struct st_mysql_sys_var** */ - NULL, - - /* Maria extension */ - INNODB_VERSION_STR, + i_s_version, nullptr, nullptr, PACKAGE_VERSION, MariaDB_PLUGIN_MATURITY_STABLE }; diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 8fe5c45bb8a..fe3de23351a 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -33,25 +33,6 @@ Created 1/20/1994 Heikki Tuuri #pragma once -/* aux macros to convert M into "123" (string) if M is defined like -#define M 123 */ -#define _IB_TO_STR(s) #s -#define IB_TO_STR(s) _IB_TO_STR(s) - -/* The following is the InnoDB version as shown in -SELECT plugin_version FROM information_schema.plugins; -calculated in make_version_string() in sql/sql_show.cc like this: -"version >> 8" . "version & 0xff" -because the version is shown with only one dot, we skip the last -component, i.e. we show M.N.P as M.N */ -#define INNODB_VERSION_SHORT \ - (MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR) - -#define INNODB_VERSION_STR \ - IB_TO_STR(MYSQL_VERSION_MAJOR) "." \ - IB_TO_STR(MYSQL_VERSION_MINOR) "." \ - IB_TO_STR(MYSQL_VERSION_PATCH) - /** How far ahead should we tell the service manager the timeout (time in seconds) */ #define INNODB_EXTEND_TIMEOUT_INTERVAL 30 diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index cd7de848940..47ea7f18094 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -261,10 +261,7 @@ void log_t::header_write(byte *buf, lsn_t lsn, bool encrypted) log_sys.FORMAT_10_8); mach_write_to_8(my_assume_aligned<8>(buf + LOG_HEADER_START_LSN), lsn); static constexpr const char LOG_HEADER_CREATOR_CURRENT[]= - "MariaDB " - IB_TO_STR(MYSQL_VERSION_MAJOR) "." - IB_TO_STR(MYSQL_VERSION_MINOR) "." - IB_TO_STR(MYSQL_VERSION_PATCH); + "MariaDB " PACKAGE_VERSION; strcpy(reinterpret_cast(buf) + LOG_HEADER_CREATOR, LOG_HEADER_CREATOR_CURRENT);