Skip to content

Commit 7d4077c

Browse files
committed
Merge 10.5 into 10.6
2 parents 19acb02 + fdb6db6 commit 7d4077c

File tree

246 files changed

+2642
-1634
lines changed

Some content is hidden

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

246 files changed

+2642
-1634
lines changed

client/mysql.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3321,6 +3321,9 @@ static int com_charset(String *, char *line)
33213321
MYF(MY_UTF8_IS_UTF8MB3 | MY_WME));
33223322
if (new_cs)
33233323
{
3324+
if (new_cs->mbminlen > 1)
3325+
return put_info("Character sets with mbminlen>1 are not supported",
3326+
INFO_ERROR, 0);
33243327
charset_info= new_cs;
33253328
mysql_set_character_set(&mysql, charset_info->cs_name.str);
33263329
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
@@ -857,11 +857,11 @@ static void write_footer(FILE *sql_file)
857857
} /* write_footer */
858858

859859

860-
uchar* get_table_key(const char *entry, size_t *length,
861-
my_bool not_used __attribute__((unused)))
860+
const uchar *get_table_key(const void *entry, size_t *length,
861+
my_bool not_used __attribute__((unused)))
862862
{
863863
*length= strlen(entry);
864-
return (uchar*) entry;
864+
return entry;
865865
}
866866

867867

@@ -1096,11 +1096,11 @@ static int get_options(int *argc, char ***argv)
10961096
load_defaults_or_exit("my", load_default_groups, argc, argv);
10971097
defaults_argv= *argv;
10981098

1099-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0, 0,
1100-
(my_hash_get_key) get_table_key, my_free, 0))
1099+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_database, charset_info, 16, 0,
1100+
0, get_table_key, my_free, 0))
11011101
return(EX_EOM);
11021102
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_table, charset_info, 16, 0, 0,
1103-
(my_hash_get_key) get_table_key, my_free, 0))
1103+
get_table_key, my_free, 0))
11041104
return(EX_EOM);
11051105
/* Don't copy internal log tables */
11061106
if (my_hash_insert(&ignore_table, (uchar*) my_strdup(PSI_NOT_INSTRUMENTED,
@@ -1116,7 +1116,7 @@ static int get_options(int *argc, char ***argv)
11161116
return(EX_EOM);
11171117

11181118
if (my_hash_init(PSI_NOT_INSTRUMENTED, &ignore_data, charset_info, 16, 0, 0,
1119-
(my_hash_get_key) get_table_key, my_free, 0))
1119+
get_table_key, my_free, 0))
11201120
return(EX_EOM);
11211121

11221122
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
@@ -1765,7 +1765,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
17651765
query_length= my_snprintf(query_buffer,
17661766
sizeof (query_buffer),
17671767
"SET SESSION character_set_results = '%s'",
1768-
(const char *) cs_name);
1768+
cs_name);
17691769

17701770
return mysql_real_query(mysql, query_buffer, (ulong)query_length);
17711771
}

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

@@ -12174,8 +12173,10 @@ void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val)
1217412173
keep_header If header should not be sorted
1217512174
*/
1217612175

12177-
static int comp_lines(const char **a, const char **b)
12176+
static int comp_lines(const void *a_, const void *b_)
1217812177
{
12178+
auto a= static_cast<const char *const *>(a_);
12179+
auto b= static_cast<const char *const *>(b_);
1217912180
return (strcmp(*a,*b));
1218012181
}
1218112182

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/mariabackup/encryption_plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const char *encryption_plugin_get_config()
194194
return encryption_plugin_config.c_str();
195195
}
196196

197-
extern int finalize_encryption_plugin(st_plugin_int *plugin);
197+
extern int finalize_encryption_plugin(void *plugin);
198198

199199

200200
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
@@ -358,22 +358,23 @@ file_entry_new(extract_ctxt_t *ctxt, const char *path, uint pathlen)
358358
}
359359

360360
static
361-
uchar *
362-
get_file_entry_key(file_entry_t *entry, size_t *length,
363-
my_bool not_used __attribute__((unused)))
361+
const uchar *
362+
get_file_entry_key(const void *entry_, size_t *length, my_bool)
364363
{
365-
*length = entry->pathlen;
366-
return (uchar *) entry->path;
364+
const file_entry_t *entry= static_cast<const file_entry_t *>(entry_);
365+
*length= entry->pathlen;
366+
return reinterpret_cast<const uchar *>(entry->path);
367367
}
368368

369369
static
370370
void
371-
file_entry_free(file_entry_t *entry)
371+
file_entry_free(void *entry_)
372372
{
373-
pthread_mutex_destroy(&entry->mutex);
374-
ds_close(entry->file);
375-
my_free(entry->path);
376-
my_free(entry);
373+
file_entry_t *entry= static_cast<file_entry_t *>(entry_);
374+
pthread_mutex_destroy(&entry->mutex);
375+
ds_close(entry->file);
376+
my_free(entry->path);
377+
my_free(entry);
377378
}
378379

379380
static
@@ -493,14 +494,15 @@ mode_extract(int n_threads, int argc __attribute__((unused)),
493494
pthread_mutex_t mutex;
494495
int ret = 0;
495496

496-
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
497-
START_FILE_HASH_SIZE, 0, 0, (my_hash_get_key) get_file_entry_key,
498-
(my_hash_free_key) file_entry_free, MYF(0))) {
499-
msg("%s: failed to initialize file hash.", my_progname);
500-
return 1;
501-
}
497+
if (my_hash_init(PSI_NOT_INSTRUMENTED, &filehash, &my_charset_bin,
498+
START_FILE_HASH_SIZE, 0, 0, get_file_entry_key,
499+
file_entry_free, MYF(0)))
500+
{
501+
msg("%s: failed to initialize file hash.", my_progname);
502+
return 1;
503+
}
502504

503-
if (pthread_mutex_init(&mutex, NULL)) {
505+
if (pthread_mutex_init(&mutex, NULL)) {
504506
msg("%s: failed to initialize mutex.", my_progname);
505507
my_hash_free(&filehash);
506508
return 1;

extra/my_print_defaults.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ static struct my_option my_long_options[] =
6262
"In addition to the given groups, read also groups with this suffix",
6363
(char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix,
6464
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
65-
{"mysqld", 0, "Read the same set of groups that the mysqld binary does.",
65+
{"mysqld", 0, "Read the same set of groups that the mariadbd (previously known as mysqld) binary does.",
66+
&opt_mysqld, &opt_mysqld, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
67+
{"mariadbd", 0, "Read the same set of groups that the mariadbd binary does.",
6668
&opt_mysqld, &opt_mysqld, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
6769
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
6870
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -84,7 +86,7 @@ static void cleanup_and_exit(int exit_code)
8486

8587
static void version()
8688
{
87-
printf("%s Ver 1.7 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
89+
printf("%s Ver 1.8 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
8890
}
8991

9092

@@ -136,7 +138,7 @@ static int get_options(int *argc,char ***argv)
136138
int ho_error;
137139

138140
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
139-
exit(ho_error);
141+
cleanup_and_exit(ho_error);
140142

141143
return 0;
142144
}
@@ -195,7 +197,8 @@ int main(int argc, char **argv)
195197
load_default_groups=(char**) my_malloc(PSI_NOT_INSTRUMENTED,
196198
nargs*sizeof(char*), MYF(MY_WME));
197199
if (!load_default_groups)
198-
exit(1);
200+
cleanup_and_exit(1);
201+
199202
if (opt_mysqld)
200203
{
201204
for (; mysqld_groups[i]; i++)

include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ SET(HEADERS
4242
my_dbug.h
4343
m_string.h
4444
my_sys.h
45+
my_cmp.h
4546
my_xml.h
4647
mysql_embed.h
4748
my_decimal_limits.h

include/hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern "C" {
4242
#define HASH_THREAD_SPECIFIC 2 /* Mark allocated memory THREAD_SPECIFIC */
4343

4444
typedef uint32 my_hash_value_type;
45-
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
45+
typedef const uchar *(*my_hash_get_key)(const void *, size_t *, my_bool);
4646
typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
4747
const uchar *, size_t);
4848
typedef void (*my_hash_free_key)(void *);

include/my_cmp.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* Copyright (c) 2024, MariaDB Corporation.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation; version 2 of the License.
6+
7+
This program is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
GNU General Public License for more details.
11+
12+
You should have received a copy of the GNU General Public License
13+
along with this program; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
15+
16+
#pragma once
17+
18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
21+
typedef int (*qsort_cmp)(const void *, const void *);
22+
typedef int (*qsort_cmp2)(void *param, const void *a, const void *b);
23+
#ifdef __cplusplus
24+
}
25+
#endif

0 commit comments

Comments
 (0)