Skip to content

Commit 17f0118

Browse files
committed
Merge 10.11 into 11.4
2 parents 437550b + 28b2958 commit 17f0118

File tree

473 files changed

+4734
-3152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+4734
-3152
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ENDIF()
3131
# in RPM's:
3232

3333
#set(CPACK_RPM_SPEC_MORE_DEFINE "%define __spec_install_post /bin/true")
34-
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0074 CMP0075 CMP0069 CMP0135)
34+
FOREACH(p CMP0022 CMP0046 CMP0040 CMP0048 CMP0054 CMP0067 CMP0074 CMP0075 CMP0069 CMP0135)
3535
IF(POLICY ${p})
3636
CMAKE_POLICY(SET ${p} NEW)
3737
ENDIF()

client/mysql.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5334,6 +5334,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
53345334
}
53355335
if (!opt_silent || info_type == INFO_ERROR)
53365336
{
5337+
report_progress_end();
5338+
fflush(stdout);
5339+
53375340
if (!inited)
53385341
{
53395342
#ifdef HAVE_SETUPTERM

extra/mariabackup/backup_mysql.cc

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,12 @@ bool get_mysql_vars(MYSQL *connection)
459459

460460
msg("Using server version %s", version_var);
461461

462-
if (!(ret= detect_mysql_capabilities_for_backup()))
462+
if (opt_galera_info && !have_galera_enabled)
463463
{
464-
goto out;
464+
msg("--galera-info is specified on the command "
465+
"line, but the server does not support Galera "
466+
"replication. Ignoring the option.");
467+
opt_galera_info= false;
465468
}
466469

467470
/* make sure datadir value is the same in configuration file */
@@ -554,30 +557,6 @@ bool get_mysql_vars(MYSQL *connection)
554557
return (ret);
555558
}
556559

557-
/*********************************************************************//**
558-
Query the server to find out what backup capabilities it supports.
559-
@return true on success. */
560-
bool
561-
detect_mysql_capabilities_for_backup()
562-
{
563-
/* do some sanity checks */
564-
if (opt_galera_info && !have_galera_enabled) {
565-
msg("--galera-info is specified on the command "
566-
"line, but the server does not support Galera "
567-
"replication. Ignoring the option.");
568-
opt_galera_info = false;
569-
}
570-
571-
if (opt_slave_info && have_multi_threaded_slave &&
572-
!have_gtid_slave) {
573-
msg("The --slave-info option requires GTID enabled for a "
574-
"multi-threaded slave.");
575-
return(false);
576-
}
577-
578-
return(true);
579-
}
580-
581560
static
582561
bool
583562
select_incremental_lsn_from_history(lsn_t *incremental_lsn)

extra/mariabackup/backup_mysql.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ backup_cleanup();
4343
bool
4444
get_mysql_vars(MYSQL *connection);
4545

46-
bool
47-
detect_mysql_capabilities_for_backup();
48-
4946
MYSQL *
5047
xb_mysql_connect();
5148

extra/mariabackup/fil_cur.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ xb_fil_cur_open(
186186
}
187187
#else
188188
err = fstat(cursor->file.m_file, &cursor->statinfo);
189+
MSAN_STAT_WORKAROUND(&cursor->statinfo);
189190
#endif
190191
if (max_file_size < (ulonglong)cursor->statinfo.st_size) {
191192
cursor->statinfo.st_size = (ulonglong)max_file_size;

extra/mariabackup/xtrabackup.cc

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -916,13 +916,15 @@ datafiles_iter_next(datafiles_iter_t *it)
916916
fil_system.space_list.begin() :
917917
std::next(it->space);
918918

919-
while (it->space != fil_system.space_list.end() &&
920-
(it->space->purpose != FIL_TYPE_TABLESPACE ||
921-
UT_LIST_GET_LEN(it->space->chain) == 0))
919+
while (it->space != fil_system.space_list.end()
920+
&& UT_LIST_GET_LEN(it->space->chain) == 0)
922921
++it->space;
923922
if (it->space == fil_system.space_list.end())
924923
goto end;
925924

925+
ut_ad(!it->space->is_temporary());
926+
ut_ad(!it->space->is_being_imported());
927+
926928
it->node = UT_LIST_GET_FIRST(it->space->chain);
927929

928930
end:
@@ -1114,7 +1116,8 @@ static void backup_file_op(uint32_t space_id, int type,
11141116
std::string space_name = filename_to_spacename(name, len);
11151117
ddl_tracker.id_to_name[space_id] = space_name;
11161118
ddl_tracker.delete_defer(space_id, space_name);
1117-
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
1119+
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
1120+
space_id, int(len), name);
11181121
}
11191122
break;
11201123
case FILE_MODIFY:
@@ -1130,15 +1133,16 @@ static void backup_file_op(uint32_t space_id, int type,
11301133
ddl_tracker.id_to_name[space_id] = new_space_name;
11311134
ddl_tracker.rename_defer(space_id, old_space_name,
11321135
new_space_name);
1133-
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
1136+
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
11341137
space_id, int(len), name, int(new_len), new_name);
11351138
}
11361139
break;
11371140
case FILE_DELETE:
11381141
ddl_tracker.drops.insert(space_id);
11391142
ddl_tracker.delete_defer(
11401143
space_id, filename_to_spacename(name, len));
1141-
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
1144+
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
1145+
space_id, int(len), name);
11421146
break;
11431147
default:
11441148
ut_ad(0);
@@ -1189,13 +1193,14 @@ static void backup_file_op_fail(uint32_t space_id, int type,
11891193
const std::string spacename{filename_to_spacename(name, len)};
11901194
switch (type) {
11911195
case FILE_CREATE:
1192-
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
1196+
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
1197+
space_id, int(len), name);
11931198
fail = !check_if_skip_table(spacename.c_str());
11941199
break;
11951200
case FILE_MODIFY:
11961201
break;
11971202
case FILE_RENAME:
1198-
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
1203+
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
11991204
space_id, int(len), name, int(new_len), new_name);
12001205
fail = !check_if_skip_table(spacename.c_str())
12011206
|| !check_if_skip_table(
@@ -1204,7 +1209,8 @@ static void backup_file_op_fail(uint32_t space_id, int type,
12041209
case FILE_DELETE:
12051210
fail = !check_if_skip_table(spacename.c_str())
12061211
&& !check_if_fts_table(spacename.c_str());
1207-
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
1212+
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
1213+
space_id, int(len), name);
12081214
break;
12091215
default:
12101216
ut_ad(0);
@@ -1225,7 +1231,7 @@ static void backup_undo_trunc(uint32_t space_id)
12251231

12261232
/* Function to store the space id of page0 INIT_PAGE
12271233
@param space_id space id which has page0 init page */
1228-
static void backup_first_page_op(space_id_t space_id)
1234+
static void backup_first_page_op(uint32_t space_id)
12291235
{
12301236
first_page_init_ids.insert(space_id);
12311237
}
@@ -3955,8 +3961,8 @@ static void xb_load_single_table_tablespace(const char *dirname,
39553961
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
39563962
mysql_mutex_lock(&fil_system.mutex);
39573963
space = fil_space_t::create(
3958-
file->space_id(), file->flags(),
3959-
FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */,
3964+
uint32_t(file->space_id()), file->flags(), false,
3965+
nullptr/* TODO: crypt_data */,
39603966
FIL_ENCRYPTION_DEFAULT,
39613967
file->handle() != OS_FILE_CLOSED);
39623968
ut_ad(space);
@@ -4173,6 +4179,7 @@ os_file_readdir_next_file(
41734179
return(-1);
41744180
}
41754181

4182+
MSAN_STAT_WORKAROUND(&statinfo);
41764183
info->size = statinfo.st_size;
41774184

41784185
if (S_ISDIR(statinfo.st_mode)) {
@@ -5691,8 +5698,8 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
56915698
iter != ddl_tracker.tables_in_backup.end();
56925699
iter++) {
56935700

5694-
const std::string name = iter->second;
56955701
uint32_t id = iter->first;
5702+
const std::string &name = iter->second;
56965703

56975704
if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) {
56985705
dropped_tables.insert(name);
@@ -5719,7 +5726,7 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
57195726
iter++) {
57205727

57215728
uint32_t id = iter->first;
5722-
std::string name = iter->second;
5729+
const std::string &name = iter->second;
57235730

57245731
if (ddl_tracker.tables_in_backup.find(id) != ddl_tracker.tables_in_backup.end()) {
57255732
/* already processed above */
@@ -6016,8 +6023,8 @@ xb_delta_open_matching_space(
60166023

60176024
char tmpname[FN_REFLEN];
60186025

6019-
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%u",
6020-
dbname, fil_space->id);
6026+
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%"
6027+
PRIu32, dbname, fil_space->id);
60216028

60226029
msg("mariabackup: Renaming %s to %s.ibd",
60236030
fil_space->chain.start->name, tmpname);
@@ -6072,8 +6079,8 @@ xb_delta_open_matching_space(
60726079
ut_ad(fil_space_t::physical_size(flags) == info.page_size);
60736080

60746081
mysql_mutex_lock(&fil_system.mutex);
6075-
fil_space_t* space = fil_space_t::create(info.space_id, flags,
6076-
FIL_TYPE_TABLESPACE, 0,
6082+
fil_space_t* space = fil_space_t::create(uint32_t(info.space_id),
6083+
flags, false, 0,
60776084
FIL_ENCRYPTION_DEFAULT, true);
60786085
mysql_mutex_unlock(&fil_system.mutex);
60796086
if (space) {
@@ -6866,7 +6873,8 @@ static bool xtrabackup_prepare_func(char** argv)
68666873
srv_max_dirty_pages_pct_lwm = srv_max_buf_pool_modified_pct;
68676874
}
68686875

6869-
if (innodb_init()) {
6876+
recv_sys.recovery_on = false;
6877+
if (innodb_init()) {
68706878
goto error;
68716879
}
68726880

include/handler_ername.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,7 @@
7878
{ "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" },
7979
{ "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" },
8080
{ "HA_ERR_INCOMPATIBLE_DEFINITION", HA_ERR_INCOMPATIBLE_DEFINITION, "" },
81-
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, "" },
8281
{ "HA_ERR_COMMIT_ERROR", HA_ERR_COMMIT_ERROR, "" },
82+
{ "HA_ERR_PARTITION_LIST", HA_ERR_PARTITION_LIST, ""},
83+
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, ""},
84+
{ "HA_ERR_ROLLBACK", HA_ERR_ROLLBACK, "" },

include/heap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ typedef struct st_heap_block
105105
uint recbuffer; /* Length of one saved record */
106106
ulong records_in_block; /* Records in one heap-block */
107107
ulong last_allocated; /* number of records there is allocated space for */
108+
size_t alloc_size; /* Allocate blocks of this size */
108109
} HP_BLOCK;
109110

110111
struct st_heap_info; /* For reference */

include/my_base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ enum ha_base_keytype {
543543
#define HA_ERR_COMMIT_ERROR 197
544544
#define HA_ERR_PARTITION_LIST 198
545545
#define HA_ERR_NO_ENCRYPTION 199
546-
#define HA_ERR_LAST 199 /* Copy of last error nr * */
546+
#define HA_ERR_ROLLBACK 200 /* Automatic rollback done */
547+
#define HA_ERR_LAST 200 /* Copy of last error nr * */
547548

548549
/* Number of different errors */
549550
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

include/my_global.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
679679
*/
680680
#define IO_SIZE 4096U
681681
/*
682-
How much overhead does malloc have. The code often allocates
682+
How much overhead does malloc/my_malloc have. The code often allocates
683683
something like 1024-MALLOC_OVERHEAD bytes
684684
*/
685-
#define MALLOC_OVERHEAD 8
685+
#define MALLOC_OVERHEAD (8+24)
686686

687687
/* get memory in huncs */
688688
#define ONCE_ALLOC_INIT (uint) 4096

0 commit comments

Comments
 (0)