Skip to content

Commit 3d23adb

Browse files
committed
Merge 10.6 into 10.11
2 parents 27c7e73 + 7d4077c commit 3d23adb

File tree

397 files changed

+6217
-4218
lines changed

Some content is hidden

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

397 files changed

+6217
-4218
lines changed

client/mysql.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,6 +3442,9 @@ static int com_charset(String *, char *line)
34423442
MYF(MY_UTF8_IS_UTF8MB3 | MY_WME));
34433443
if (new_cs)
34443444
{
3445+
if (new_cs->mbminlen > 1)
3446+
return put_info("Character sets with mbminlen>1 are not supported",
3447+
INFO_ERROR, 0);
34453448
charset_info= new_cs;
34463449
mysql_set_character_set(&mysql, charset_info->cs_name.str);
34473450
default_charset= (char *)charset_info->cs_name.str;

client/mysqldump.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -849,11 +849,11 @@ static void write_footer(FILE *sql_file)
849849
} /* write_footer */
850850

851851

852-
uchar* get_table_key(const char *entry, size_t *length,
853-
my_bool not_used __attribute__((unused)))
852+
const uchar *get_table_key(const void *entry, size_t *length,
853+
my_bool not_used __attribute__((unused)))
854854
{
855855
*length= strlen(entry);
856-
return (uchar*) entry;
856+
return entry;
857857
}
858858

859859

@@ -1088,11 +1088,11 @@ static int get_options(int *argc, char ***argv)
10881088
load_defaults_or_exit("my", load_default_groups, argc, argv);
10891089
defaults_argv= *argv;
10901090

1091-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0, 0,
1092-
(my_hash_get_key) get_table_key, my_free, 0))
1091+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0,
1092+
0, get_table_key, my_free, 0))
10931093
return(EX_EOM);
10941094
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_table, charset_info, 16, 0, 0,
1095-
(my_hash_get_key) get_table_key, my_free, 0))
1095+
get_table_key, my_free, 0))
10961096
return(EX_EOM);
10971097
/* Don't copy internal log tables */
10981098
if (my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED,
@@ -1108,7 +1108,7 @@ static int get_options(int *argc, char ***argv)
11081108
return(EX_EOM);
11091109

11101110
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_data, charset_info, 16, 0, 0,
1111-
(my_hash_get_key) get_table_key, my_free, 0))
1111+
get_table_key, my_free, 0))
11121112
return(EX_EOM);
11131113

11141114
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
@@ -1798,7 +1798,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
17981798
query_length= my_snprintf(query_buffer,
17991799
sizeof (query_buffer),
18001800
"SET SESSION character_set_results = '%s'",
1801-
(const char *) cs_name);
1801+
cs_name);
18021802

18031803
return mysql_real_query(mysql, query_buffer, (ulong)query_length);
18041804
}

client/mysqltest.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,13 +2400,12 @@ static void strip_parentheses(struct st_command *command)
24002400

24012401
C_MODE_START
24022402

2403-
static uchar *get_var_key(const uchar* var, size_t *len,
2404-
my_bool __attribute__((unused)) t)
2403+
static const uchar *get_var_key(const void *var, size_t *len, my_bool)
24052404
{
24062405
char* key;
2407-
key = ((VAR*)var)->name;
2408-
*len = ((VAR*)var)->name_len;
2409-
return (uchar*)key;
2406+
key= (static_cast<const VAR *>(var))->name;
2407+
*len= (static_cast<const VAR *>(var))->name_len;
2408+
return reinterpret_cast<const uchar *>(key);
24102409
}
24112410

24122411

@@ -12233,8 +12232,10 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val)
1223312232
keep_header If header should not be sorted
1223412233
*/
1223512234

12236-
static int comp_lines(const char **a, const char **b)
12235+
static int comp_lines(const void *a_, const void *b_)
1223712236
{
12237+
auto a= static_cast<const char *const *>(a_);
12238+
auto b= static_cast<const char *const *>(b_);
1223812239
return (strcmp(*a,*b));
1223912240
}
1224012241

cmake/maintainer.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,23 @@ SET(MY_WARNING_FLAGS
4040
-Wsuggest-override
4141
-Wvla
4242
-Wwrite-strings
43+
-Wcast-function-type-strict
44+
)
45+
46+
# Warning flags that are in testing before moving
47+
# to MY_WARNING_FLAGS if stable.
48+
SET(MY_WARNING_FLAGS_NON_FATAL
4349
)
4450

4551
FOREACH(F ${MY_WARNING_FLAGS})
4652
MY_CHECK_AND_SET_COMPILER_FLAG(${F} DEBUG RELWITHDEBINFO)
4753
ENDFOREACH()
4854

55+
FOREACH(F ${MY_WARNING_FLAGS_NON_FATAL})
56+
MY_CHECK_AND_SET_COMPILER_FLAG(-W${F} DEBUG RELWITHDEBINFO)
57+
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-error=${F} DEBUG RELWITHDEBINFO)
58+
ENDFOREACH()
59+
4960
SET(MY_ERROR_FLAGS -Werror -fno-operator-names)
5061

5162
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")

extra/innochecksum.cc

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ static my_bool do_leaf;
7474
static my_bool per_page_details;
7575
static ulint n_merge;
7676
static ulint physical_page_size; /* Page size in bytes on disk. */
77+
static ulint extent_size;
78+
static ulint xdes_size;
7779
ulong srv_page_size;
7880
uint32_t srv_page_size_shift;
7981
/* Current page number (0 based). */
@@ -98,7 +100,7 @@ char* log_filename = NULL;
98100
FILE* log_file = NULL;
99101
/* Enabled for log write option. */
100102
static bool is_log_enabled = false;
101-
103+
static bool skip_freed_pages;
102104
static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX];
103105
const byte *field_ref_zero = field_ref_zero_buf;
104106

@@ -266,6 +268,8 @@ static void init_page_size(const byte* buf)
266268
srv_page_size_shift = UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize;
267269
srv_page_size = 512U << ssize;
268270
physical_page_size = srv_page_size;
271+
extent_size = FSP_EXTENT_SIZE;
272+
xdes_size = XDES_SIZE;
269273
return;
270274
}
271275

@@ -277,6 +281,8 @@ static void init_page_size(const byte* buf)
277281

278282
srv_page_size = fil_space_t::logical_size(flags);
279283
physical_page_size = fil_space_t::physical_size(flags);
284+
extent_size = FSP_EXTENT_SIZE;
285+
xdes_size = XDES_SIZE;
280286
}
281287

282288
#ifdef _WIN32
@@ -549,8 +555,8 @@ bool
549555
is_page_doublewritebuffer(
550556
const byte* page)
551557
{
552-
if ((cur_page_num >= FSP_EXTENT_SIZE)
553-
&& (cur_page_num < FSP_EXTENT_SIZE * 3)) {
558+
if ((cur_page_num >= extent_size)
559+
&& (cur_page_num < extent_size * 3)) {
554560
/* page is doublewrite buffer. */
555561
return (true);
556562
}
@@ -751,8 +757,8 @@ static inline bool is_page_free(const byte *xdes, ulint physical_page_size,
751757
{
752758
const byte *des=
753759
xdes + XDES_ARR_OFFSET +
754-
XDES_SIZE * ((page_no & (physical_page_size - 1)) / FSP_EXTENT_SIZE);
755-
return xdes_is_free(des, page_no % FSP_EXTENT_SIZE);
760+
xdes_size * ((page_no & (physical_page_size - 1)) / extent_size);
761+
return xdes_is_free(des, page_no % extent_size);
756762
}
757763

758764
/*
@@ -780,6 +786,16 @@ parse_page(
780786

781787
/* Check whether page is doublewrite buffer. */
782788
str = skip_page ? "Double_write_buffer" : "-";
789+
page_no = mach_read_from_4(page + FIL_PAGE_OFFSET);
790+
if (skip_freed_pages) {
791+
const byte *des= xdes + XDES_ARR_OFFSET +
792+
xdes_size * ((page_no & (physical_page_size - 1))
793+
/ extent_size);
794+
if (mach_read_from_4(des) != XDES_FSEG &&
795+
xdes_is_free(des, page_no % extent_size)) {
796+
return;
797+
}
798+
}
783799

784800
switch (fil_page_get_type(page)) {
785801

@@ -1205,6 +1221,9 @@ static struct my_option innochecksum_options[] = {
12051221
&do_leaf, &do_leaf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
12061222
{"merge", 'm', "leaf page count if merge given number of consecutive pages",
12071223
&n_merge, &n_merge, 0, GET_ULONG, REQUIRED_ARG, 0, 0, (longlong)10L, 0, 1, 0},
1224+
{"skip-freed-pages", 'r', "skip freed pages for the tablespace",
1225+
&skip_freed_pages, &skip_freed_pages, 0, GET_BOOL, NO_ARG,
1226+
0, 0, 0, 0, 0, 0},
12081227

12091228
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
12101229
};
@@ -1228,7 +1247,7 @@ static void usage(void)
12281247
print_version();
12291248
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
12301249
printf("InnoDB offline file checksum utility.\n");
1231-
printf("Usage: %s [-c] [-s <start page>] [-e <end page>] "
1250+
printf("Usage: %s [-c] [-r] [-s <start page>] [-e <end page>] "
12321251
"[-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] "
12331252
"[-S] [-D <page type dump>] "
12341253
"[-l <log>] [-l] [-m <merge pages>] <filename or [-]>\n", my_progname);
@@ -1241,8 +1260,8 @@ static void usage(void)
12411260
extern "C" my_bool
12421261
innochecksum_get_one_option(
12431262
const struct my_option *opt,
1244-
const char *argument MY_ATTRIBUTE((unused)),
1245-
const char *)
1263+
const char *IF_DBUG(argument,),
1264+
const char *)
12461265
{
12471266
switch (opt->id) {
12481267
#ifndef DBUG_OFF
@@ -1267,15 +1286,6 @@ innochecksum_get_one_option(
12671286
my_end(0);
12681287
exit(EXIT_SUCCESS);
12691288
break;
1270-
case 'n':
1271-
no_check = true;
1272-
break;
1273-
case 'a':
1274-
case 'S':
1275-
break;
1276-
case 'w':
1277-
do_write = true;
1278-
break;
12791289
case 'D':
12801290
page_type_dump = true;
12811291
break;
@@ -1322,8 +1332,8 @@ get_options(
13221332
*/
13231333
static bool check_encryption(const char* filename, const byte* page)
13241334
{
1325-
ulint offset = FSP_HEADER_OFFSET + XDES_ARR_OFFSET + XDES_SIZE *
1326-
physical_page_size / FSP_EXTENT_SIZE;
1335+
ulint offset = FSP_HEADER_OFFSET + XDES_ARR_OFFSET + xdes_size *
1336+
physical_page_size / extent_size;
13271337

13281338
if (memcmp(page + offset, CRYPT_MAGIC, MAGIC_SZ) != 0) {
13291339
return false;
@@ -1855,7 +1865,7 @@ int main(
18551865
printf("page " UINT32PF " ", cur_page_num);
18561866
}
18571867

1858-
if (page_get_page_no(buf) % physical_page_size == 0) {
1868+
if (cur_page_num % physical_page_size == 0) {
18591869
memcpy(xdes, buf, physical_page_size);
18601870
}
18611871

extra/mariabackup/encryption_plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const char *encryption_plugin_get_config()
203203
return encryption_plugin_config.c_str();
204204
}
205205

206-
extern int finalize_encryption_plugin(st_plugin_int *plugin);
206+
extern int finalize_encryption_plugin(void *plugin);
207207

208208

209209
void encryption_plugin_prepare_init(int argc, char **argv)

extra/mariabackup/xbstream.cc

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -360,22 +360,23 @@ file_entry_new(extract_ctxt_t *ctxt, const char *path, uint pathlen,
360360
}
361361

362362
static
363-
uchar *
364-
get_file_entry_key(file_entry_t *entry, size_t *length,
365-
my_bool not_used __attribute__((unused)))
363+
const uchar *
364+
get_file_entry_key(const void *entry_, size_t *length, my_bool)
366365
{
367-
*length = entry->pathlen;
368-
return (uchar *) entry->path;
366+
const file_entry_t *entry= static_cast<const file_entry_t *>(entry_);
367+
*length= entry->pathlen;
368+
return reinterpret_cast<const uchar *>(entry->path);
369369
}
370370

371371
static
372372
void
373-
file_entry_free(file_entry_t *entry)
373+
file_entry_free(void *entry_)
374374
{
375-
pthread_mutex_destroy(&entry->mutex);
376-
ds_close(entry->file);
377-
my_free(entry->path);
378-
my_free(entry);
375+
file_entry_t *entry= static_cast<file_entry_t *>(entry_);
376+
pthread_mutex_destroy(&entry->mutex);
377+
ds_close(entry->file);
378+
my_free(entry->path);
379+
my_free(entry);
379380
}
380381

381382
static
@@ -547,14 +548,15 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
547548
pthread_mutex_t mutex;
548549
int ret = 0;
549550

550-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
551-
START_FILE_HASH_SIZE, 0, 0, (my_hash_get_key) get_file_entry_key,
552-
(my_hash_free_key) file_entry_free, MYF(0))) {
553-
msg("%s: failed to initialize file hash.", my_progname);
554-
return 1;
555-
}
551+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
552+
START_FILE_HASH_SIZE, 0, 0, get_file_entry_key,
553+
file_entry_free, MYF(0)))
554+
{
555+
msg("%s: failed to initialize file hash.", my_progname);
556+
return 1;
557+
}
556558

557-
if (pthread_mutex_init(&mutex, NULL)) {
559+
if (pthread_mutex_init(&mutex, NULL)) {
558560
msg("%s: failed to initialize mutex.", my_progname);
559561
my_hash_free(&filehash);
560562
return 1;

0 commit comments

Comments
 (0)