1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.6' into 10.11

This commit is contained in:
Sergei Golubchik
2024-04-22 11:00:03 +02:00
418 changed files with 7074 additions and 2930 deletions

View File

@@ -172,7 +172,7 @@ static void validate_value(const char *key, const char *value,
#define validate_value(key, value, filename) (void)filename
#endif
#define SET_HO_ERROR_AND_CONTINUE(e) { ho_error= (e); continue; }
#define SET_HO_ERROR_AND_CONTINUE(e) { ho_error= (e); (*argc)--; continue; }
/**
Handle command line options.
@@ -903,7 +903,7 @@ static int setval(const struct my_option *opts, void *value, char *argument,
}
if (err)
{
res= EXIT_UNKNOWN_SUFFIX;
res= err;
goto ret;
};
}
@@ -1038,7 +1038,7 @@ static inline ulonglong eval_num_suffix(char *suffix, int *error)
case 'E':
return 1ULL << 60;
default:
*error= 1;
*error= EXIT_UNKNOWN_SUFFIX;
return 0ULL;
}
}
@@ -1064,15 +1064,18 @@ static longlong eval_num_suffix_ll(char *argument,
if (errno == ERANGE)
{
my_getopt_error_reporter(ERROR_LEVEL,
"Incorrect integer value: '%s'", argument);
*error= 1;
"Integer value out of range for int64:"
" '%s' for %s",
argument, option_name);
*error= EXIT_ARGUMENT_INVALID;
DBUG_RETURN(0);
}
num*= eval_num_suffix(endchar, error);
if (*error)
fprintf(stderr,
"Unknown suffix '%c' used for variable '%s' (value '%s')\n",
*endchar, option_name, argument);
my_getopt_error_reporter(ERROR_LEVEL,
"Unknown suffix '%c' used for variable '%s' (value '%s'). "
"Legal suffix characters are: K, M, G, T, P, E",
*endchar, option_name, argument);
DBUG_RETURN(num);
}
@@ -1095,7 +1098,7 @@ static ulonglong eval_num_suffix_ull(char *argument,
my_getopt_error_reporter(ERROR_LEVEL,
"Incorrect unsigned value: '%s' for %s",
argument, option_name);
*error= 1;
*error= EXIT_ARGUMENT_INVALID;
DBUG_RETURN(0);
}
*error= 0;
@@ -1104,15 +1107,18 @@ static ulonglong eval_num_suffix_ull(char *argument,
if (errno == ERANGE)
{
my_getopt_error_reporter(ERROR_LEVEL,
"Incorrect integer value: '%s' for %s",
"Integer value out of range for uint64:"
" '%s' for %s",
argument, option_name);
*error= 1;
*error= EXIT_ARGUMENT_INVALID;
DBUG_RETURN(0);
}
num*= eval_num_suffix(endchar, error);
if (*error)
my_getopt_error_reporter(ERROR_LEVEL,
"Unknown suffix '%c' used for variable '%s' (value '%s')",
"Unknown suffix '%c' used for variable '%s'"
" (value '%s')."
" Legal suffix characters are: K, M, G, T, P, E",
*endchar, option_name, argument);
DBUG_RETURN(num);
}
@@ -1132,6 +1138,8 @@ static ulonglong eval_num_suffix_ull(char *argument,
static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
{
longlong num=eval_num_suffix_ll(arg, err, (char*) optp->name);
if (*err)
return(0);
return getopt_ll_limit_value(num, optp, NULL);
}
@@ -1209,6 +1217,8 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err)
{
ulonglong num= eval_num_suffix_ull(arg, err, (char*) optp->name);
if (*err)
return(0);
return getopt_ull_limit_value(num, optp, NULL);
}