Skip to content

Commit 6b9bba4

Browse files
committed
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.
1 parent 12aeb9f commit 6b9bba4

File tree

13 files changed

+81
-550
lines changed

13 files changed

+81
-550
lines changed

extra/innochecksum.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,16 +1209,16 @@ static struct my_option innochecksum_options[] = {
12091209
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
12101210
};
12111211

1212-
/* Print out the Innodb version and machine information. */
1213-
static void print_version(void)
1212+
/** Print out the version and build information. */
1213+
static void print_version()
12141214
{
12151215
#ifdef DBUG_OFF
12161216
printf("%s Ver %s, for %s (%s)\n",
1217-
my_progname, INNODB_VERSION_STR,
1217+
my_progname, PACKAGE_VERSION,
12181218
SYSTEM_TYPE, MACHINE_TYPE);
12191219
#else
12201220
printf("%s-debug Ver %s, for %s (%s)\n",
1221-
my_progname, INNODB_VERSION_STR,
1221+
my_progname, PACKAGE_VERSION,
12221222
SYSTEM_TYPE, MACHINE_TYPE);
12231223
#endif /* DBUG_OFF */
12241224
}

extra/mariabackup/backup_copy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
14921492
}
14931493
}
14941494

1495-
if (have_flush_engine_logs && !opt_no_lock) {
1495+
if (!opt_no_lock) {
14961496
msg("Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...");
14971497
xb_mysql_query(mysql_connection,
14981498
"FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS", false);

extra/mariabackup/backup_mysql.cc

Lines changed: 11 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,13 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
6262
char *tool_name;
6363
char tool_args[2048];
6464

65-
/* mysql flavor and version */
66-
mysql_flavor_t server_flavor = FLAVOR_UNKNOWN;
67-
unsigned long mysql_server_version = 0;
65+
ulong mysql_server_version;
6866

6967
/* server capabilities */
7068
bool have_changed_page_bitmaps = false;
7169
bool have_backup_locks = false;
7270
bool have_lock_wait_timeout = false;
7371
bool have_galera_enabled = false;
74-
bool have_flush_engine_logs = false;
7572
bool have_multi_threaded_slave = false;
7673
bool have_gtid_slave = false;
7774

@@ -297,48 +294,13 @@ read_mysql_one_value(MYSQL *mysql, const char *query)
297294

298295
static
299296
bool
300-
check_server_version(unsigned long version_number,
301-
const char *version_string,
302-
const char *version_comment,
303-
const char *innodb_version)
297+
check_server_version(ulong version_number, const char *version_string)
304298
{
305-
bool version_supported = false;
306-
bool mysql51 = false;
307-
308-
mysql_server_version = version_number;
309-
310-
server_flavor = FLAVOR_UNKNOWN;
311-
if (strstr(version_comment, "Percona") != NULL) {
312-
server_flavor = FLAVOR_PERCONA_SERVER;
313-
} else if (strstr(version_comment, "MariaDB") != NULL ||
314-
strstr(version_string, "MariaDB") != NULL) {
315-
server_flavor = FLAVOR_MARIADB;
316-
} else if (strstr(version_comment, "MySQL") != NULL) {
317-
server_flavor = FLAVOR_MYSQL;
318-
}
319-
320-
mysql51 = version_number > 50100 && version_number < 50500;
321-
version_supported = version_supported
322-
|| (mysql51 && innodb_version != NULL);
323-
version_supported = version_supported
324-
|| (version_number > 50500 && version_number < 50700);
325-
version_supported = version_supported
326-
|| ((version_number > 100000)
327-
&& server_flavor == FLAVOR_MARIADB);
328-
329-
if (mysql51 && innodb_version == NULL) {
330-
msg("Error: Built-in InnoDB in MySQL 5.1 is not "
331-
"supported in this release. You can either use "
332-
"Percona XtraBackup 2.0, or upgrade to InnoDB "
333-
"plugin.");
334-
} else if (!version_supported) {
335-
msg("Error: Unsupported server version: '%s'. Please "
336-
"report a bug at "
337-
"https://bugs.launchpad.net/percona-xtrabackup",
338-
version_string);
339-
}
299+
if (strstr(version_string, "MariaDB") && version_number >= 100800)
300+
return true;
340301

341-
return(version_supported);
302+
msg("Error: Unsupported server version: '%s'.", version_string);
303+
return false;
342304
}
343305

344306
/*********************************************************************//**
@@ -348,8 +310,6 @@ bool get_mysql_vars(MYSQL *connection)
348310
{
349311
char *gtid_mode_var= NULL;
350312
char *version_var= NULL;
351-
char *version_comment_var= NULL;
352-
char *innodb_version_var= NULL;
353313
char *have_backup_locks_var= NULL;
354314
char *log_bin_var= NULL;
355315
char *lock_wait_timeout_var= NULL;
@@ -369,7 +329,7 @@ bool get_mysql_vars(MYSQL *connection)
369329
char *page_zip_level_var= NULL;
370330
char *ignore_db_dirs= NULL;
371331
char *endptr;
372-
unsigned long server_version= mysql_get_server_version(connection);
332+
ulong server_version= mysql_get_server_version(connection);
373333

374334
bool ret= true;
375335

@@ -379,8 +339,6 @@ bool get_mysql_vars(MYSQL *connection)
379339
{"lock_wait_timeout", &lock_wait_timeout_var},
380340
{"gtid_mode", &gtid_mode_var},
381341
{"version", &version_var},
382-
{"version_comment", &version_comment_var},
383-
{"innodb_version", &innodb_version_var},
384342
{"wsrep_on", &wsrep_on_var},
385343
{"slave_parallel_workers", &slave_parallel_workers_var},
386344
{"gtid_slave_pos", &gtid_slave_pos_var},
@@ -423,18 +381,13 @@ bool get_mysql_vars(MYSQL *connection)
423381
have_galera_enabled= true;
424382
}
425383

426-
/* Check server version compatibility and detect server flavor */
427-
428-
if (!(ret= check_server_version(server_version, version_var,
429-
version_comment_var, innodb_version_var)))
384+
/* Check server version compatibility */
385+
if (!(ret= check_server_version(server_version, version_var)))
430386
{
431387
goto out;
432388
}
433389

434-
if (server_version > 50500)
435-
{
436-
have_flush_engine_logs= true;
437-
}
390+
mysql_server_version= server_version;
438391

439392
if (slave_parallel_workers_var != NULL &&
440393
atoi(slave_parallel_workers_var) > 0)
@@ -565,16 +518,6 @@ detect_mysql_capabilities_for_backup()
565518

566519
have_changed_page_bitmaps = (atoi(innodb_changed_pages) == 1);
567520

568-
/* INNODB_CHANGED_PAGES are listed in
569-
INFORMATION_SCHEMA.PLUGINS in MariaDB, but
570-
FLUSH NO_WRITE_TO_BINLOG CHANGED_PAGE_BITMAPS
571-
is not supported for versions below 10.1.6
572-
(see MDEV-7472) */
573-
if (server_flavor == FLAVOR_MARIADB &&
574-
mysql_server_version < 100106) {
575-
have_changed_page_bitmaps = false;
576-
}
577-
578521
free_mysql_variables(vars);
579522
}
580523

@@ -1381,21 +1324,8 @@ bool
13811324
write_slave_info(MYSQL *connection)
13821325
{
13831326
String sql, comment;
1384-
bool show_all_slaves_status= false;
1385-
1386-
switch (server_flavor)
1387-
{
1388-
case FLAVOR_MARIADB:
1389-
show_all_slaves_status= mysql_server_version >= 100000;
1390-
break;
1391-
case FLAVOR_UNKNOWN:
1392-
case FLAVOR_MYSQL:
1393-
case FLAVOR_PERCONA_SERVER:
1394-
break;
1395-
}
13961327

1397-
if (Show_slave_status::get_slave_info(connection, show_all_slaves_status,
1398-
&sql, &comment))
1328+
if (Show_slave_status::get_slave_info(connection, true, &sql, &comment))
13991329
return false; // Error
14001330

14011331
if (!sql.length())

extra/mariabackup/backup_mysql.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33

44
#include <mysql.h>
55

6-
/* mysql flavor and version */
7-
enum mysql_flavor_t { FLAVOR_UNKNOWN, FLAVOR_MYSQL,
8-
FLAVOR_PERCONA_SERVER, FLAVOR_MARIADB };
9-
extern mysql_flavor_t server_flavor;
10-
extern unsigned long mysql_server_version;
6+
/* MariaDB version */
7+
extern ulong mysql_server_version;
118

129
/* server capabilities */
1310
extern bool have_changed_page_bitmaps;
1411
extern bool have_backup_locks;
1512
extern bool have_lock_wait_timeout;
1613
extern bool have_galera_enabled;
17-
extern bool have_flush_engine_logs;
1814
extern bool have_multi_threaded_slave;
1915
extern bool have_gtid_slave;
2016

mysql-test/suite/perfschema/t/show_sanity.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ insert into test.sanity values
496496
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_LOG_TRUNCATE"),
497497
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_UNDO_TABLESPACES"),
498498
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_USE_NATIVE_AIO"),
499-
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_VERSION"),
500499
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_WRITE_IO_THREADS"),
501500
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INTERNAL_TMP_DISK_STORAGE_ENGINE"),
502501
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "KEY_BUFFER_SIZE"),

mysql-test/suite/sys_vars/r/innodb_version_basic.result

Lines changed: 0 additions & 17 deletions
This file was deleted.

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
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
22
where variable_name like 'innodb%' and
33
variable_name not in (
4-
'innodb_version', # always the same as the server version
54
'innodb_numa_interleave', # only available WITH_NUMA
65
'innodb_evict_tables_on_commit_debug', # one may want to override this
76
'innodb_use_native_aio', # default value depends on OS

mysql-test/suite/sys_vars/t/innodb_version_basic.test

Lines changed: 0 additions & 30 deletions
This file was deleted.

mysql-test/suite/sys_vars/t/sysvars_innodb.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
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
99
where variable_name like 'innodb%' and
1010
variable_name not in (
11-
'innodb_version', # always the same as the server version
1211
'innodb_numa_interleave', # only available WITH_NUMA
1312
'innodb_evict_tables_on_commit_debug', # one may want to override this
1413
'innodb_use_native_aio', # default value depends on OS

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ static my_bool innobase_create_status_file;
202202
my_bool innobase_stats_on_metadata;
203203
static my_bool innodb_optimize_fulltext_only;
204204

205-
static char* innodb_version_str = (char*) INNODB_VERSION_STR;
206-
207205
extern uint srv_fil_crypt_rotate_key_age;
208206
extern uint srv_n_fil_crypt_iops;
209207

@@ -19433,10 +19431,6 @@ static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
1943319431
AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */
1943419432
AUTOINC_NO_LOCKING, 0); /* Maximum value */
1943519433

19436-
static MYSQL_SYSVAR_STR(version, innodb_version_str,
19437-
PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
19438-
"InnoDB version", NULL, NULL, INNODB_VERSION_STR);
19439-
1944019434
#ifdef HAVE_URING
1944119435
# include <sys/utsname.h>
1944219436
static utsname uname_for_io_uring;
@@ -19827,7 +19821,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
1982719821
MYSQL_SYSVAR(prefix_index_cluster_optimization),
1982819822
MYSQL_SYSVAR(tmpdir),
1982919823
MYSQL_SYSVAR(autoinc_lock_mode),
19830-
MYSQL_SYSVAR(version),
1983119824
MYSQL_SYSVAR(use_native_aio),
1983219825
#ifdef HAVE_LIBNUMA
1983319826
MYSQL_SYSVAR(numa_interleave),
@@ -19907,10 +19900,10 @@ maria_declare_plugin(innobase)
1990719900
PLUGIN_LICENSE_GPL,
1990819901
innodb_init, /* Plugin Init */
1990919902
NULL, /* Plugin Deinit */
19910-
INNODB_VERSION_SHORT,
19903+
MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR,
1991119904
innodb_status_variables_export,/* status variables */
1991219905
innobase_system_variables, /* system variables */
19913-
INNODB_VERSION_STR, /* string version */
19906+
PACKAGE_VERSION,
1991419907
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
1991519908
},
1991619909
i_s_innodb_trx,

0 commit comments

Comments
 (0)