Skip to content

Commit 33907f9

Browse files
committed
Merge 11.4 into 11.7
2 parents 4d95488 + 2719cc4 commit 33907f9

File tree

449 files changed

+6778
-4295
lines changed

Some content is hidden

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

449 files changed

+6778
-4295
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# along with this program; if not, write to the Free Software
1515
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
1616

17-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
17+
CMAKE_MINIMUM_REQUIRED(VERSION 3.12.0)
1818

1919
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
2020
# Setting build type to RelWithDebInfo as none was specified.

client/mysql.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3454,6 +3454,9 @@ static int com_charset(String *, char *line)
34543454
MYF(MY_UTF8_IS_UTF8MB3 | MY_WME));
34553455
if (new_cs)
34563456
{
3457+
if (new_cs->mbminlen > 1)
3458+
return put_info("Character sets with mbminlen>1 are not supported",
3459+
INFO_ERROR, 0);
34573460
charset_info= new_cs;
34583461
mysql_set_character_set(&mysql, charset_info->cs_name.str);
34593462
default_charset= (char *)charset_info->cs_name.str;

client/mysqlbinlog.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
#include "sql_priv.h"
4444
#include "sql_basic_types.h"
4545
#include <atomic>
46+
#if 0 /* FIXME: the following is broken for now */
47+
# include "mariadb_rpl.h"
48+
#else
49+
enum Item_result {STRING_RESULT,REAL_RESULT,INT_RESULT,ROW_RESULT,DECIMAL_RESULT};
50+
#endif
4651
#include "log_event.h"
4752
#include "compat56.h"
4853
#include "sql_common.h"

client/mysqldump.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -877,11 +877,10 @@ static void write_footer(FILE *sql_file)
877877
} /* write_footer */
878878

879879

880-
uchar* get_table_key(const char *entry, size_t *length,
881-
my_bool not_used __attribute__((unused)))
880+
const uchar *get_table_key(const void *entry, size_t *length, my_bool)
882881
{
883-
*length= strlen(entry);
884-
return (uchar*) entry;
882+
*length= strlen(static_cast<const char*>(entry));
883+
return static_cast<const uchar*>(entry);
885884
}
886885

887886

@@ -1121,11 +1120,11 @@ static int get_options(int *argc, char ***argv)
11211120
load_defaults_or_exit("my", load_default_groups, argc, argv);
11221121
defaults_argv= *argv;
11231122

1124-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0, 0,
1125-
(my_hash_get_key) get_table_key, my_free, 0))
1123+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0,
1124+
0, get_table_key, my_free, 0))
11261125
return(EX_EOM);
11271126
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_table, charset_info, 16, 0, 0,
1128-
(my_hash_get_key) get_table_key, my_free, 0))
1127+
get_table_key, my_free, 0))
11291128
return(EX_EOM);
11301129
/* Don't copy internal log tables */
11311130
if (my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED,
@@ -1141,7 +1140,7 @@ static int get_options(int *argc, char ***argv)
11411140
return(EX_EOM);
11421141

11431142
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_data, charset_info, 16, 0, 0,
1144-
(my_hash_get_key) get_table_key, my_free, 0))
1143+
get_table_key, my_free, 0))
11451144
return(EX_EOM);
11461145

11471146
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
@@ -1865,7 +1864,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
18651864
query_length= my_snprintf(query_buffer,
18661865
sizeof (query_buffer),
18671866
"SET SESSION character_set_results = '%s'",
1868-
(const char *) cs_name);
1867+
cs_name);
18691868

18701869
return mysql_real_query(mysql, query_buffer, (ulong)query_length);
18711870
}

client/mysqltest.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,6 @@ pthread_handler_t connection_thread(void *arg)
998998
cn->mysql= 0;
999999
cn->query_done= 1;
10001000
mysql_thread_end();
1001-
pthread_exit(0);
10021001
DBUG_RETURN(0);
10031002
}
10041003

@@ -2411,13 +2410,12 @@ static void strip_parentheses(struct st_command *command)
24112410

24122411
C_MODE_START
24132412

2414-
static uchar *get_var_key(const uchar* var, size_t *len,
2415-
my_bool __attribute__((unused)) t)
2413+
static const uchar *get_var_key(const void *var, size_t *len, my_bool)
24162414
{
24172415
char* key;
2418-
key = ((VAR*)var)->name;
2419-
*len = ((VAR*)var)->name_len;
2420-
return (uchar*)key;
2416+
key= (static_cast<const VAR *>(var))->name;
2417+
*len= (static_cast<const VAR *>(var))->name_len;
2418+
return reinterpret_cast<const uchar *>(key);
24212419
}
24222420

24232421

@@ -12282,8 +12280,10 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val)
1228212280
keep_header If header should not be sorted
1228312281
*/
1228412282

12285-
static int comp_lines(const char **a, const char **b)
12283+
static int comp_lines(const void *a_, const void *b_)
1228612284
{
12285+
auto a= static_cast<const char *const *>(a_);
12286+
auto b= static_cast<const char *const *>(b_);
1228712287
return (strcmp(*a,*b));
1228812288
}
1228912289

cmake/maintainer.cmake

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

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

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

5061
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
@@ -76,6 +76,8 @@ static my_bool do_leaf;
7676
static my_bool per_page_details;
7777
static ulint n_merge;
7878
static ulint physical_page_size; /* Page size in bytes on disk. */
79+
static ulint extent_size;
80+
static ulint xdes_size;
7981
ulong srv_page_size;
8082
uint32_t srv_page_size_shift;
8183
/* Current page number (0 based). */
@@ -100,7 +102,7 @@ char* log_filename = NULL;
100102
FILE* log_file = NULL;
101103
/* Enabled for log write option. */
102104
static bool is_log_enabled = false;
103-
105+
static bool skip_freed_pages;
104106
static byte field_ref_zero_buf[UNIV_PAGE_SIZE_MAX];
105107
const byte *field_ref_zero = field_ref_zero_buf;
106108

@@ -268,6 +270,8 @@ static void init_page_size(const byte* buf)
268270
srv_page_size_shift = UNIV_ZIP_SIZE_SHIFT_MIN - 1 + ssize;
269271
srv_page_size = 512U << ssize;
270272
physical_page_size = srv_page_size;
273+
extent_size = FSP_EXTENT_SIZE;
274+
xdes_size = XDES_SIZE;
271275
return;
272276
}
273277

@@ -279,6 +283,8 @@ static void init_page_size(const byte* buf)
279283

280284
srv_page_size = fil_space_t::logical_size(flags);
281285
physical_page_size = fil_space_t::physical_size(flags);
286+
extent_size = FSP_EXTENT_SIZE;
287+
xdes_size = XDES_SIZE;
282288
}
283289

284290
#ifdef _WIN32
@@ -551,8 +557,8 @@ bool
551557
is_page_doublewritebuffer(
552558
const byte* page)
553559
{
554-
if ((cur_page_num >= FSP_EXTENT_SIZE)
555-
&& (cur_page_num < FSP_EXTENT_SIZE * 3)) {
560+
if ((cur_page_num >= extent_size)
561+
&& (cur_page_num < extent_size * 3)) {
556562
/* page is doublewrite buffer. */
557563
return (true);
558564
}
@@ -753,8 +759,8 @@ static inline bool is_page_free(const byte *xdes, ulint physical_page_size,
753759
{
754760
const byte *des=
755761
xdes + XDES_ARR_OFFSET +
756-
XDES_SIZE * ((page_no & (physical_page_size - 1)) / FSP_EXTENT_SIZE);
757-
return xdes_is_free(des, page_no % FSP_EXTENT_SIZE);
762+
xdes_size * ((page_no & (physical_page_size - 1)) / extent_size);
763+
return xdes_is_free(des, page_no % extent_size);
758764
}
759765

760766
/*
@@ -782,6 +788,16 @@ parse_page(
782788

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

786802
switch (fil_page_get_type(page)) {
787803

@@ -1207,6 +1223,9 @@ static struct my_option innochecksum_options[] = {
12071223
&do_leaf, &do_leaf, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
12081224
{"merge", 'm', "leaf page count if merge given number of consecutive pages",
12091225
&n_merge, &n_merge, 0, GET_ULONG, REQUIRED_ARG, 0, 0, (longlong)10L, 0, 1, 0},
1226+
{"skip-freed-pages", 'r', "skip freed pages for the tablespace",
1227+
&skip_freed_pages, &skip_freed_pages, 0, GET_BOOL, NO_ARG,
1228+
0, 0, 0, 0, 0, 0},
12101229

12111230
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
12121231
};
@@ -1216,7 +1235,7 @@ static void usage(void)
12161235
print_version();
12171236
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
12181237
printf("InnoDB offline file checksum utility.\n");
1219-
printf("Usage: %s [-c] [-s <start page>] [-e <end page>] "
1238+
printf("Usage: %s [-c] [-r] [-s <start page>] [-e <end page>] "
12201239
"[-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] "
12211240
"[-S] [-D <page type dump>] "
12221241
"[-l <log>] [-l] [-m <merge pages>] <filename or [-]>\n", my_progname);
@@ -1229,8 +1248,8 @@ static void usage(void)
12291248
extern "C" my_bool
12301249
innochecksum_get_one_option(
12311250
const struct my_option *opt,
1232-
const char *argument MY_ATTRIBUTE((unused)),
1233-
const char *)
1251+
const char *IF_DBUG(argument,),
1252+
const char *)
12341253
{
12351254
switch (opt->id) {
12361255
#ifndef DBUG_OFF
@@ -1255,15 +1274,6 @@ innochecksum_get_one_option(
12551274
my_end(0);
12561275
exit(EXIT_SUCCESS);
12571276
break;
1258-
case 'n':
1259-
no_check = true;
1260-
break;
1261-
case 'a':
1262-
case 'S':
1263-
break;
1264-
case 'w':
1265-
do_write = true;
1266-
break;
12671277
case 'D':
12681278
page_type_dump = true;
12691279
break;
@@ -1310,8 +1320,8 @@ get_options(
13101320
*/
13111321
static bool check_encryption(const char* filename, const byte* page)
13121322
{
1313-
ulint offset = FSP_HEADER_OFFSET + XDES_ARR_OFFSET + XDES_SIZE *
1314-
physical_page_size / FSP_EXTENT_SIZE;
1323+
ulint offset = FSP_HEADER_OFFSET + XDES_ARR_OFFSET + xdes_size *
1324+
physical_page_size / extent_size;
13151325

13161326
if (memcmp(page + offset, CRYPT_MAGIC, MAGIC_SZ) != 0) {
13171327
return false;
@@ -1843,7 +1853,7 @@ int main(
18431853
printf("page " UINT32PF " ", cur_page_num);
18441854
}
18451855

1846-
if (page_get_page_no(buf) % physical_page_size == 0) {
1856+
if (cur_page_num % physical_page_size == 0) {
18471857
memcpy(xdes, buf, physical_page_size);
18481858
}
18491859

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
@@ -353,22 +353,23 @@ file_entry_new(extract_ctxt_t *ctxt, const char *path, uint pathlen,
353353
}
354354

355355
static
356-
uchar *
357-
get_file_entry_key(file_entry_t *entry, size_t *length,
358-
my_bool not_used __attribute__((unused)))
356+
const uchar *
357+
get_file_entry_key(const void *entry_, size_t *length, my_bool)
359358
{
360-
*length = entry->pathlen;
361-
return (uchar *) entry->path;
359+
const file_entry_t *entry= static_cast<const file_entry_t *>(entry_);
360+
*length= entry->pathlen;
361+
return reinterpret_cast<const uchar *>(entry->path);
362362
}
363363

364364
static
365365
void
366-
file_entry_free(file_entry_t *entry)
366+
file_entry_free(void *entry_)
367367
{
368-
pthread_mutex_destroy(&entry->mutex);
369-
ds_close(entry->file);
370-
my_free(entry->path);
371-
my_free(entry);
368+
file_entry_t *entry= static_cast<file_entry_t *>(entry_);
369+
pthread_mutex_destroy(&entry->mutex);
370+
ds_close(entry->file);
371+
my_free(entry->path);
372+
my_free(entry);
372373
}
373374

374375
static
@@ -540,14 +541,15 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
540541
pthread_mutex_t mutex;
541542
int ret = 0;
542543

543-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
544-
START_FILE_HASH_SIZE, 0, 0, (my_hash_get_key) get_file_entry_key,
545-
(my_hash_free_key) file_entry_free, MYF(0))) {
546-
msg("%s: failed to initialize file hash.", my_progname);
547-
return 1;
548-
}
544+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
545+
START_FILE_HASH_SIZE, 0, 0, get_file_entry_key,
546+
file_entry_free, MYF(0)))
547+
{
548+
msg("%s: failed to initialize file hash.", my_progname);
549+
return 1;
550+
}
549551

550-
if (pthread_mutex_init(&mutex, NULL)) {
552+
if (pthread_mutex_init(&mutex, NULL)) {
551553
msg("%s: failed to initialize mutex.", my_progname);
552554
my_hash_free(&filehash);
553555
return 1;

0 commit comments

Comments
 (0)