Skip to content

Commit

Permalink
Merge remote-tracking branch '11.3' into 11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Dec 21, 2023
2 parents aed9c65 + 63fb478 commit c154aaf
Show file tree
Hide file tree
Showing 1,327 changed files with 49,021 additions and 15,631 deletions.
5 changes: 3 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Without automated tests, future regressions in the expected behavior can't be au
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

<!--
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct. (Currently the earliest maintained branch is 10.3)
Tick one of the following boxes [x] to help us understand if the base branch for the PR is correct.
see [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/-/CODING_STANDARDS.md) for the latest versions.
-->
## Basing the PR against the correct MariaDB version
- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.*
Expand All @@ -43,5 +44,5 @@ Tick one of the following boxes [x] to help us understand if the base branch for
Maintainers are happy to point out inconsistencies but in order to speed up the review and merge process we ask you to check the CODING standards.
-->
## PR quality check
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/11.0/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
- [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/-/CODING_STANDARDS.md) file and my PR conforms to this where appropriate.
- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.
13 changes: 10 additions & 3 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,21 @@ The commit messages are typically rendered in [Markdown format](https://docs.git
When updating your code, please make sure you perform a rebase, not a merge with the latest branch.
Pull requests should be a simple fast-forward of the branch they are intended to land on.

The correct way to rebase (if working on top of 10.3 branch):
The correct way to rebase (if working on top of 10.11 branch):

```sh
git fetch upstream/10.3 # This assumes upstream is github.com/MariaDB/server
git rebase upstream/10.3
git fetch upstream/10.11 # This assumes upstream is github.com/MariaDB/server
git rebase upstream/10.11
git push --force my_branch
```

### Target branch

Pull requests should be based against the correct MariaDB version.
New features should be based against the latest MariaDB development branch, which is the current GitHub default branch: https://github.com/MariaDB/server/blob/-/VERSION
Bug fixes should be based against the earliest maintained branch in which the bug can be reproduced.
The earliest maintained branch is found at https://mariadb.org/about/#maintenance-policy.

## Coding Style (C / C++ files)

Everyone has a preferred coding style, there is no real correct style for all projects around the world.
Expand Down
9 changes: 8 additions & 1 deletion client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,8 @@ static int install_used_plugin_data_types(void)
DYNAMIC_STRING ds_result;
const char *query = "SELECT table_comment FROM information_schema.tables"
" WHERE table_comment LIKE 'Unknown data type: %'";
if (opt_systables_only)
return 0;
if (init_dynamic_string(&ds_result, "", 512, 512))
die("Out of memory");
run_query(query, &ds_result, TRUE);
Expand Down Expand Up @@ -1482,7 +1484,12 @@ int main(int argc, char **argv)
open_mysql_upgrade_file();

if (opt_check_upgrade)
exit(upgrade_already_done(0) == 0);
{
int upgrade_needed = upgrade_already_done(0);
free_used_memory();
my_end(my_end_arg);
exit(upgrade_needed == 0);
}

/* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mariadb-check.exe", "mariadb-check"), self_name);
Expand Down
55 changes: 27 additions & 28 deletions client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* maintenance of mysql databases */

#define VER "9.1"
#define VER "10.0"
#include "client_priv.h"
#include <signal.h>
#include <my_pthread.h> /* because of signal() */
Expand All @@ -36,12 +36,12 @@ char *host= NULL, *user= 0, *opt_password= 0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
ulonglong last_values[MAX_MYSQL_VAR+100];
static int interval=0;
static my_bool option_force=0,interrupted=0,new_line=0,
opt_compress= 0, opt_local= 0, opt_relative= 0, opt_verbose= 0,
tty_password= 0, opt_nobeep, opt_shutdown_wait_for_slaves= 0;
static my_bool option_force=0,interrupted=0,new_line=0, opt_compress= 0,
opt_local= 0, opt_relative= 0, tty_password= 0, opt_nobeep,
opt_shutdown_wait_for_slaves= 0, opt_not_used;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
static uint opt_count_iterations= 0, my_end_arg;
static uint opt_count_iterations= 0, my_end_arg, opt_verbose= 0;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static char * unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
Expand Down Expand Up @@ -187,8 +187,10 @@ static struct my_option my_long_options[] =
{"user", 'u', "User for login if not current user.", &user,
&user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v', "Write more information.", &opt_verbose,
&opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v', "Write more information."
"Using it will print more information for 'processlist."
"Using it 2 times will print even more information for 'processlist'.",
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
Expand Down Expand Up @@ -277,6 +279,11 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'I': /* Info */
usage();
exit(0);
case 'v': /* --verbose */
opt_verbose++;
if (argument == disabled_my_option)
opt_verbose= 0;
break;
case OPT_CHARSETS_DIR:
#if MYSQL_VERSION_ID > 32300
charsets_dir = argument;
Expand Down Expand Up @@ -441,6 +448,7 @@ int main(int argc,char *argv[])
if (error > 0)
break;

error= -error; /* don't exit with negative error codes */
/*
Command was well-formed, but failed on the server. Might succeed
on retry (if conditions on server change etc.), but needs --force
Expand Down Expand Up @@ -806,10 +814,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
MYSQL_RES *result;
MYSQL_ROW row;
const char *query;

if (mysql_query(mysql, (opt_verbose ? "show full processlist" :
"show processlist")) ||
!(result = mysql_store_result(mysql)))
if (!opt_verbose)
query= "show processlist";
else if (opt_verbose == 1)
query= "show full processlist";
else
query= "select * from information_schema.processlist where id != connection_id()";

if (mysql_query(mysql, query) ||
!(result = mysql_store_result(mysql)))
{
my_printf_error(0, "process list failed; error: '%s'", error_flags,
mysql_error(mysql));
Expand Down Expand Up @@ -1129,24 +1144,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
else
if (mysql_query(mysql,buff))
{
if (mysql_errno(mysql)!=1290)
{
my_printf_error(0,"unable to change password; error: '%s'",
error_flags, mysql_error(mysql));
}
else
{
/*
We don't try to execute 'update mysql.user set..'
because we can't perfectly find out the host
*/
my_printf_error(0,"\n"
"You cannot use 'password' command as mariadbd runs\n"
" with grant tables disabled (was started with"
" --skip-grant-tables).\n"
"Use: \"mysqladmin flush-privileges password '*'\""
" instead", error_flags);
}
my_printf_error(0,"unable to change password; error: '%s'",
error_flags, mysql_error(mysql));
ret = -1;
}
password_done:
Expand Down
9 changes: 7 additions & 2 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3422,8 +3422,13 @@ int main(int argc, char** argv)

if (tmpdir.list)
free_tmpdir(&tmpdir);
if (result_file && result_file != stdout)
my_fclose(result_file, MYF(0));
if (result_file)
{
if (result_file != stdout)
my_fclose(result_file, MYF(0));
else
fflush(result_file);
}

/*
Ensure the GTID state is correct. If not, end in error.
Expand Down
9 changes: 7 additions & 2 deletions client/mysqldump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1912,8 +1912,13 @@ static FILE* open_sql_file_for_table(const char* table, int flags)

static void free_resources()
{
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
if (md_result_file)
{
if (md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
else
fflush(md_result_file);
}
if (get_table_name_result)
mysql_free_result(get_table_name_result);
if (routine_res)
Expand Down

0 comments on commit c154aaf

Please sign in to comment.