Skip to content

Commit

Permalink
Merge 10.10 into 10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 14, 2022
2 parents 12786f0 + fa389b9 commit 0aca301
Show file tree
Hide file tree
Showing 226 changed files with 2,266 additions and 4,470 deletions.
12 changes: 8 additions & 4 deletions BUILD/FINISH.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ commands="$commands
path=`dirname $0`
. \"$path/autorun.sh\""

if [ -z "$just_clean" ]
if [ -z "$just_clean"]
then
commands="$commands
git submodule update
CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" $configure"
if test -d .git
then
commands="$commands
git submodule update"
fi
commands="$commands
CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" $configure"
fi

if [ -z "$just_configure" -a -z "$just_clean" ]
Expand Down
2 changes: 2 additions & 0 deletions debian/mariadb-test-data.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# These should be moved, see https://jira.mariadb.org/browse/MDEV-21654
arch-dependent-file-in-usr-share usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
arch-dependent-file-in-usr-share [usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so]
arch-independent-package-contains-binary-or-object usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so
arch-independent-package-contains-binary-or-object [usr/share/mysql/mysql-test/suite/plugins/pam/pam_mariadb_mtr.so]
# Mainly for support for *BSD family. Not right way to do but this is test package and not for production
incorrect-path-for-interpreter /usr/bin/env perl != /usr/bin/perl [usr/share/mysql/mysql-test/std_data/checkDBI_DBD-MariaDB.pl]
incorrect-path-for-interpreter /usr/bin/env perl != /usr/bin/perl [usr/share/mysql/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl]
Expand Down
2 changes: 2 additions & 0 deletions debian/mariadb-test.lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# These should be moved, see https://jira.mariadb.org/browse/MDEV-21653
arch-dependent-file-in-usr-share usr/share/mysql/mysql-test/lib/My/SafeProcess/my_safe_process
arch-dependent-file-in-usr-share usr/share/mysql/mysql-test/lib/My/SafeProcess/wsrep_check_version
arch-dependent-file-in-usr-share [usr/share/mysql/mysql-test/lib/My/SafeProcess/my_safe_process]
arch-dependent-file-in-usr-share [usr/share/mysql/mysql-test/lib/My/SafeProcess/wsrep_check_version]
# Mainly for support for *BSD family. Not right way to do but this is test package and not for production
incorrect-path-for-interpreter /usr/bin/env perl != /usr/bin/perl [usr/share/mysql/mysql-test/lib/process-purecov-annotations.pl]
incorrect-path-for-interpreter /usr/bin/env perl != /usr/bin/perl [usr/share/mysql/mysql-test/lib/v1/mysql-test-run.pl]
Expand Down
8 changes: 8 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@ version-substvar-for-external-package Replaces (line 748) ${source:Version} mari
version-substvar-for-external-package Replaces (line 748) ${source:Version} mariadb-server -> mariadb-server-10.11
# ColumnStore not used in Debian, safe to ignore. Reported upstream in https://jira.mariadb.org/browse/MDEV-24124
source-is-missing storage/columnstore/columnstore/utils/jemalloc/libjemalloc.so.2
source-is-missing [storage/columnstore/columnstore/utils/jemalloc/libjemalloc.so.2]
# Must be fixed upstream
source-is-missing storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-*.custom.js
# New Lintian syntax (from version 2.115)
source-is-missing [sql/share/charsets/languages.html]
source-is-missing [storage/rocksdb/rocksdb/docs/_includes/footer.html]
# Intentional control relationships
version-substvar-for-external-package Replaces * libmariadbd-dev -> libmariadbclient-dev
version-substvar-for-external-package Replaces * libmariadb-dev -> libmysqlclient-dev
version-substvar-for-external-package Replaces * libmariadb-dev -> libmysqld-dev
# New Lintian syntax (from version 2.115)
version-substvar-for-external-package Replaces * libmariadb-dev -> libmysqlclient-dev [debian/control:*]
version-substvar-for-external-package Replaces * libmariadb-dev -> libmysqld-dev [debian/control:*]
version-substvar-for-external-package Replaces * libmariadbd-dev -> libmariadbclient-dev [debian/control:*]
# Data or test files where long lines are justified
very-long-line-length-in-source-file *.test *
very-long-line-length-in-source-file *.result *
Expand Down
12 changes: 12 additions & 0 deletions include/mysql/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ struct system_status_var;
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);


static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};


/*
Constants for plugin flags.
*/
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_audit.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_auth.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_data_type.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_encryption.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_ftparser.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_function.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/plugin_password_validation.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,16 @@
};
struct system_status_var;
typedef int (*mysql_show_var_func)(THD*, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
static inline
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
mysql_show_var_func func_arg)
{
struct st_mysql_show_var tmp;
tmp.name= name;
tmp.value= (void*) func_arg;
tmp.type= SHOW_FUNC;
return tmp;
};
struct st_mysql_sys_var;
struct st_mysql_value;
typedef int (*mysql_var_check_func)(THD* thd,
Expand Down
15 changes: 6 additions & 9 deletions libmysqld/lib_sql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ int init_embedded_server(int argc, char **argv, char **groups)
*/
int *argcp;
char ***argvp;
int fake_argc = 1;
char *fake_argv[] = { (char *)"", 0 };
const char *fake_groups[] = { "server", "embedded", 0 };
my_bool acl_error;
Expand All @@ -539,16 +538,14 @@ int init_embedded_server(int argc, char **argv, char **groups)
if (init_early_variables())
return 1;

if (argc)
if (!argc)
{
argcp= &argc;
argvp= (char***) &argv;
}
else
{
argcp= &fake_argc;
argvp= (char ***) &fake_argv;
argc= 1;
argv= fake_argv;
}
argcp= &argc;
argvp= &argv;

if (!groups)
groups= (char**) fake_groups;

Expand Down
15 changes: 4 additions & 11 deletions mysql-test/README-gcov
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ To be able to see the level of coverage with the current test suite,
do the following:

- Make sure gcov is installed
- Compile the MySQL distribution with BUILD/compile-pentium64-gcov (if your
machine does not have a pentium CPU, hack this script, or just live with
the pentium-specific stuff)
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
- To see the level of coverage for a given source file:
grep -1 source_file_name ../mysql-test-gcov.msg
- To see which lines are not yet covered, look at source_file_name.gcov in
the source tree. You can find this by doing something like:
find source-directory -name "mysqld.cc.gcov"
Then think hard about a test case that will cover those lines, and write
one!
- Compile the MariaDB distribution with -DENABLE_GCOV=1
- In the mysql-test directory, run this command: `./mysql-test-run --gcov`
- see var/last_changes.dgcov for the coverage of uncommitted code
- see `./dgcov -h` for more options
57 changes: 39 additions & 18 deletions mysql-test/dgcov.pl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
my %cov;
my $file_no=0;

Getopt::Long::Configure ("bundling");
GetOptions
("v|verbose+" => \$opt_verbose,
"h|help" => \$opt_help,
Expand All @@ -62,13 +63,16 @@
my $cmd;
if ($opt_purge)
{
$cmd= "find . -name '*.da' -o -name '*.gcda' -o -name '*.gcov' -o ".
$cmd= "find . -name '*.da' -o -name '*.gcda*' -o -name '*.gcov' -o ".
"-name '*.dgcov' | xargs rm -f ''";
logv "Running: $cmd";
system($cmd)==0 or die "system($cmd): $? $!";
exit 0;
}

my $gcc_version= `gcc -dumpversion`;
$gcc_version=~ s/^(\d+).*$/$1/ or die "Cannot parse gcc -dumpversion: $gcc_version";

find(\&gcov_one_file, $root);
find(\&write_coverage, $root) if $opt_generate;
exit 0 if $opt_only_gcov;
Expand Down Expand Up @@ -167,26 +171,43 @@ sub gcov_one_file {
{
return;
}
for my $gcov_file (<$_*.gcov>) {
open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
my $fname;
while (<FH>) {
chomp;
if (/^function:/) {
next;
}
if (/^file:/) {
$fname=realpath(-f $' ? $' : $root.$');
next;
# now, read the generated file
if ($gcc_version <9){
for my $gcov_file (<$_*.gcov>) {
open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
my $fname;
while (<FH>) {
chomp;
if (/^function:/) {
next;
}
if (/^file:/) {
$fname=realpath(-f $' ? $' : $root.$');
next;
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' in $gcov_file_path";
next;
}
$cov{$fname}->{$1}+=$2;
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' in $gcov_file";
next;
close(FH);
}
} else {
require IO::Uncompress::Gunzip;
require JSON::PP;
no warnings 'once';
my $gcov_file_json;
s/\.gcda$// if $gcc_version >= 11;
IO::Uncompress::Gunzip::gunzip("$_.gcov.json.gz", \$gcov_file_json)
or die "gunzip($_.gcov.json.gz): $IO::Uncompress::Gunzip::GunzipError";
my $obj= JSON::PP::decode_json $gcov_file_json;
for my $file (@{$obj->{files}}) {
for my $line (@{$file->{lines}}){
$cov{$file->{file}}->{$line->{line_number}}+= $line->{count};
}
$cov{$fname}->{$1}+=$2;
}
close(FH);
}
}

Expand Down
6 changes: 6 additions & 0 deletions mysql-test/include/have_file_key_management.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'file
{
--skip Test requires file_key_management plugin
}

#
# This file is only included when using encryption. As all encryption test are
# very slow with valgrind, lets disable these if not run with --big
#
--source include/no_valgrind_without_big.inc
2 changes: 0 additions & 2 deletions mysql-test/include/master-slave.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
--source include/no_valgrind_without_big.inc

# ==== Purpose ====
#
# Configure two servers to be replication master and slave.
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/lib/My/Debugger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ sub do_args($$$$$) {
my $v = $debuggers{$k};

# on windows mtr args are quoted (for system), otherwise not (for exec)
sub quote($) { $_[0] =~ /[; ]/ ? "\"$_[0]\"" : $_[0] }
sub quote($) { $_[0] =~ /[; >]/ ? "\"$_[0]\"" : $_[0] }
sub unquote($) { $_[0] =~ s/^"(.*)"$/$1/; $_[0] }
sub quote_from_mtr($) { IS_WINDOWS() ? $_[0] : quote($_[0]) }
sub unquote_for_mtr($) { IS_WINDOWS() ? $_[0] : unquote($_[0]) }
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/bad_startup_options.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# mysqld refuses to run as root normally.
--source include/not_as_root.inc

--source include/not_embedded.inc
--source include/have_ssl_communication.inc

Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/fix_priv_tables.result
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GRANT SELECT(c1) on testdb.v1 to 'select_only_c1'@localhost;
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
GRANT SELECT (`c1`) ON `testdb`.`v1` TO `select_only_c1`@`localhost`

"after fix privs"
SHOW GRANTS FOR 'show_view_tbl'@'localhost';
Expand All @@ -28,7 +28,7 @@ GRANT CREATE VIEW, SHOW VIEW ON `testdb`.`v1` TO `show_view_tbl`@`localhost`
SHOW GRANTS FOR 'select_only_c1'@'localhost';
Grants for select_only_c1@localhost
GRANT USAGE ON *.* TO `select_only_c1`@`localhost`
GRANT SELECT (c1) ON `testdb`.`v1` TO `select_only_c1`@`localhost`
GRANT SELECT (`c1`) ON `testdb`.`v1` TO `select_only_c1`@`localhost`

DROP USER 'show_view_tbl'@'localhost';
DROP USER 'select_only_c1'@'localhost';
Expand Down

0 comments on commit 0aca301

Please sign in to comment.