Commit b7914f56 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.8 into 10.9

parents 21ef68d5 d7a4ce3c
......@@ -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" ]
......
# 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]
......
# 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]
......
......@@ -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.9
# 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 *
......
......@@ -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.
*/
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -517,6 +517,16 @@ struct st_mysql_show_var {
};
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,
......
......@@ -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;
......@@ -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;
......
......@@ -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
......@@ -36,6 +36,7 @@ my $opt_skip_gcov;
my %cov;
my $file_no=0;
Getopt::Long::Configure ("bundling");
GetOptions
("v|verbose+" => \$opt_verbose,
"h|help" => \$opt_help,
......@@ -62,13 +63,16 @@ my $res;
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;
......@@ -167,6 +171,8 @@ sub gcov_one_file {
{
return;
}
# 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;
......@@ -181,13 +187,28 @@ sub gcov_one_file {
}
next if /^lcount:\d+,-\d+/; # whatever that means
unless (/^lcount:(\d+),(\d+)/ and $fname) {
warn "unknown line '$_' in $gcov_file";
warn "unknown line '$_' in $gcov_file_path";
next;
}
$cov{$fname}->{$1}+=$2;
}
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};
}
}
}
}
sub write_coverage {
......
......@@ -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
--source include/no_valgrind_without_big.inc
# ==== Purpose ====
#
# Configure two servers to be replication master and slave.
......
......@@ -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]) }
......
# mysqld refuses to run as root normally.
--source include/not_as_root.inc
--source include/not_embedded.inc
--source include/have_ssl_communication.inc
......
......@@ -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';
......@@ -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';
......
......@@ -9,11 +9,11 @@ CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED)
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '\xFFT\xDCiK\x92j\xE6\xFC'
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)))
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))) as a;
a
4
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED)
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED) as a;
a
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'test'
......@@ -8,8 +8,7 @@
SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
#enable after fix MDEV-28643, MDEV-27871
--disable_view_protocol
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))) as a;
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED) as a;
--enable_view_protocol
......@@ -58,6 +58,9 @@ Warning 4038 Syntax error in JSON text in argument 1 to function 'st_geomfromgeo
SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'));
st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'))
POINT(102 0.5)
SELECT st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }'));
st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }'))
POINT(102 0.5)
SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'));
st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'))
GEOMETRYCOLLECTION(POINT(102 0.5))
......
......@@ -26,6 +26,7 @@ SELECT st_astext(st_geomfromgeojson('{"type""point"}'));
#enable after fix MDEV-27871
--disable_view_protocol
SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'));
SELECT st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }'));
SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'));
......
......@@ -248,7 +248,7 @@ GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@local
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
GRANT SELECT, SELECT (`a`), INSERT, INSERT (`a`), UPDATE, UPDATE (`a`), REFERENCES (`a`) ON `test`.`t1` TO `mysqltest_1`@`localhost`
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
Select,Insert,Update Select,Insert,Update,References
......@@ -256,12 +256,12 @@ REVOKE select (a), update on t1 from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
GRANT SELECT, INSERT, INSERT (`a`), REFERENCES (`a`) ON `test`.`t1` TO `mysqltest_1`@`localhost`
REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT REFERENCES (a) ON `test`.`t1` TO `mysqltest_1`@`localhost`
GRANT REFERENCES (`a`) ON `test`.`t1` TO `mysqltest_1`@`localhost`
GRANT select,references on t1 to mysqltest_1@localhost;
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
......@@ -336,13 +336,13 @@ show grants for drop_user@localhost;
Grants for drop_user@localhost
GRANT ALL PRIVILEGES ON *.* TO `drop_user`@`localhost` WITH GRANT OPTION
GRANT ALL PRIVILEGES ON `test`.* TO `drop_user`@`localhost` WITH GRANT OPTION
GRANT SELECT (a) ON `test`.`t1` TO `drop_user`@`localhost`
GRANT SELECT (`a`) ON `test`.`t1` TO `drop_user`@`localhost`
set sql_mode=ansi_quotes;
show grants for drop_user@localhost;
Grants for drop_user@localhost
GRANT ALL PRIVILEGES ON *.* TO "drop_user"@"localhost" WITH GRANT OPTION
GRANT ALL PRIVILEGES ON "test".* TO "drop_user"@"localhost" WITH GRANT OPTION
GRANT SELECT (a) ON "test"."t1" TO "drop_user"@"localhost"
GRANT SELECT ("a") ON "test"."t1" TO "drop_user"@"localhost"
set sql_mode=default;
set sql_quote_show_create=0;
show grants for drop_user@localhost;
......@@ -361,13 +361,13 @@ show grants for drop_user@localhost;
Grants for drop_user@localhost
GRANT ALL PRIVILEGES ON *.* TO "drop_user"@"localhost" WITH GRANT OPTION
GRANT ALL PRIVILEGES ON "test".* TO "drop_user"@"localhost" WITH GRANT OPTION
GRANT SELECT (a) ON "test"."t1" TO "drop_user"@"localhost"
GRANT SELECT ("a") ON "test"."t1" TO "drop_user"@"localhost"
set sql_mode="";
show grants for drop_user@localhost;
Grants for drop_user@localhost
GRANT ALL PRIVILEGES ON *.* TO `drop_user`@`localhost` WITH GRANT OPTION
GRANT ALL PRIVILEGES ON `test`.* TO `drop_user`@`localhost` WITH GRANT OPTION
GRANT SELECT (a) ON `test`.`t1` TO `drop_user`@`localhost`
GRANT SELECT (`a`) ON `test`.`t1` TO `drop_user`@`localhost`
revoke all privileges, grant option from drop_user@localhost;
show grants for drop_user@localhost;
Grants for drop_user@localhost
......@@ -415,7 +415,7 @@ GRANT SELECT (
SHOW GRANTS FOR @localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ``@`localhost`
GRANT SELECT () ON ``.`` TO ``@`localhost`
GRANT SELECT (``) ON ``.`` TO ``@`localhost`
REVOKE SELECT () ON . FROM @localhost;
DROP USER @localhost;
DROP DATABASE ;
......@@ -492,7 +492,7 @@ grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
show grants for grant_user@localhost;
Grants for grant_user@localhost
GRANT USAGE ON *.* TO `grant_user`@`localhost`
GRANT INSERT (a, d, c, b) ON `test`.`t1` TO `grant_user`@`localhost`
GRANT INSERT (`a`, `d`, `c`, `b`) ON `test`.`t1` TO `grant_user`@`localhost`
select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv order by Column_name;
Host Db User Table_name Column_name Column_priv
localhost test grant_user t1 a Insert
......@@ -913,20 +913,20 @@ grant update (a) on t1 to mysqltest_8;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 a UPDATE NO
......@@ -1009,12 +1009,12 @@ show grants for mysqltest_8@'';
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
......@@ -1030,12 +1030,12 @@ show grants for mysqltest_8@'';
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
show grants for mysqltest_8;
Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (a) ON `test`.`t1` TO `mysqltest_8`@`%`
GRANT UPDATE, UPDATE (`a`) ON `test`.`t1` TO `mysqltest_8`@`%`
drop user mysqltest_8@'';
show grants for mysqltest_8@'';
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%'
......
......@@ -204,7 +204,7 @@ show grants for 'mysqltest_2';
Grants for mysqltest_2@%
GRANT SELECT ON *.* TO "mysqltest_2"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO "mysqltest_2"@"%"
GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_2"@"%"
GRANT UPDATE ("c2") ON "test"."t2" TO "mysqltest_2"@"%"
GRANT UPDATE ON "test"."t1" TO "mysqltest_2"@"%"
drop user 'mysqltest_1';
select host,user,password,plugin,authentication_string from mysql.user where user like 'mysqltest_%';
......@@ -242,7 +242,7 @@ show grants for 'mysqltest_1';
Grants for mysqltest_1@%
GRANT SELECT ON *.* TO "mysqltest_1"@"%" IDENTIFIED BY PASSWORD '*BD447CBA355AF58578D3AE33BA2E2CD388BA08D1'
GRANT INSERT ON "test".* TO "mysqltest_1"@"%"
GRANT UPDATE (c2) ON "test"."t2" TO "mysqltest_1"@"%"
GRANT UPDATE ("c2") ON "test"."t2" TO "mysqltest_1"@"%"
GRANT UPDATE ON "test"."t1" TO "mysqltest_1"@"%"
drop user 'mysqltest_1', 'mysqltest_3';
drop user 'mysqltest_1';
......
......@@ -172,14 +172,14 @@ GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%';
SHOW GRANTS FOR 'user2'@'%';
Grants for user2@%
GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
GRANT SELECT (`a`), INSERT (`b`) ON `temp`.`t1` TO `user2`@`%`
# Connect as the renamed user
connect conn1, localhost, user2,,;
connection conn1;
SHOW GRANTS;
Grants for user2@%
GRANT USAGE ON *.* TO `user2`@`%`
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO `user2`@`%`
GRANT SELECT (`a`), INSERT (`b`) ON `temp`.`t1` TO `user2`@`%`
SELECT a FROM temp.t1;
a
1
......
......@@ -300,6 +300,30 @@ drop database db;
drop user foo@localhost;
drop user bar@localhost;
drop user buz@localhost;
CREATE USER foo;
CREATE DATABASE db;
CREATE TABLE db.test_getcolpriv(col1 INT, col2 INT);
GRANT SELECT (col1,col2) ON db.test_getcolpriv TO foo;
GRANT INSERT (col1) ON db.test_getcolpriv TO foo;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO `foo`@`%`
GRANT SELECT (`col2`, `col1`), INSERT (`col1`) ON `db`.`test_getcolpriv` TO `foo`@`%`
REVOKE SELECT (col1,col2) ON db.test_getcolpriv FROM foo;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO `foo`@`%`
GRANT INSERT (`col1`) ON `db`.`test_getcolpriv` TO `foo`@`%`
REVOKE INSERT (col1) ON db.test_getcolpriv FROM foo;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO `foo`@`%`
FLUSH PRIVILEGES;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO `foo`@`%`
DROP USER foo;
DROP DATABASE db;
# End of 10.3 tests
create user u1@h identified with 'mysql_native_password' using 'pwd';
ERROR HY000: Password hash should be a 41-digit hexadecimal number
......
......@@ -262,6 +262,25 @@ drop user foo@localhost;
drop user bar@localhost;
drop user buz@localhost;
CREATE USER foo;
CREATE DATABASE db;
CREATE TABLE db.test_getcolpriv(col1 INT, col2 INT);
GRANT SELECT (col1,col2) ON db.test_getcolpriv TO foo;
GRANT INSERT (col1) ON db.test_getcolpriv TO foo;
SHOW GRANTS FOR foo;
REVOKE SELECT (col1,col2) ON db.test_getcolpriv FROM foo;
SHOW GRANTS FOR foo;
REVOKE INSERT (col1) ON db.test_getcolpriv FROM foo;
SHOW GRANTS FOR foo;
FLUSH PRIVILEGES;
SHOW GRANTS FOR foo;
DROP USER foo;
DROP DATABASE db;
--echo # End of 10.3 tests
#
......
......@@ -1090,7 +1090,7 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
show grants;
Grants for user1@localhost
GRANT USAGE ON *.* TO `user1`@`localhost`
GRANT SELECT (f1) ON `mysqltest`.`t1` TO `user1`@`localhost`
GRANT SELECT (`f1`) ON `mysqltest`.`t1` TO `user1`@`localhost`
connection con2;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
......
......@@ -254,7 +254,7 @@ connection default;
--echo #
send SELECT SLEEP(1000);
connection con1;
let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO='SELECT SLEEP(1000)';
let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO='SELECT SLEEP(1000)' AND STATE='User sleep';
source include/wait_condition.inc;
KILL QUERY ID @id;
connection default;
......@@ -272,7 +272,7 @@ CREATE USER u1@localhost;
send SELECT SLEEP(1000);
connection con1;
let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO='SELECT SLEEP(1000)';
let $wait_condition= SELECT @id:=QUERY_ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO='SELECT SLEEP(1000)' AND STATE='User sleep';
source include/wait_condition.inc;
let $id= `SELECT @id`;
......
......@@ -1945,7 +1945,168 @@ DROP USER 'user3'@'%';
update mysql.db set Delete_history_priv='Y' where db like 'test%';
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
# End of 10.3 tests
#
# MDEV-16735 Upgrades only work if 'alter_algorithm' is 'DEFAULT'
# or 'COPY'. Test that the session value 'DEFAULT' in mysql_upgrade
# properly overrides the potentially incompatible global value.
#
SET GLOBAL alter_algorithm='INPLACE';
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
Variable_name Value
alter_algorithm INPLACE
Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.global_priv OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.index_stats OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.transaction_registry OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
mysql.user OK
sys.host_summary OK
sys.host_summary_by_file_io OK
sys.host_summary_by_file_io_type OK
sys.host_summary_by_stages OK
sys.host_summary_by_statement_latency OK
sys.host_summary_by_statement_type OK
sys.innodb_buffer_stats_by_schema OK
sys.innodb_buffer_stats_by_table OK
sys.innodb_lock_waits OK
sys.io_by_thread_by_latency OK
sys.io_global_by_file_by_bytes OK
sys.io_global_by_file_by_latency OK
sys.io_global_by_wait_by_bytes OK
sys.io_global_by_wait_by_latency OK
sys.latest_file_io OK
sys.memory_by_host_by_current_bytes OK
sys.memory_by_thread_by_current_bytes OK
sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
sys.schema_index_statistics OK
sys.schema_object_overview OK
sys.schema_redundant_indexes OK
sys.schema_table_lock_waits OK
sys.schema_table_statistics OK
sys.schema_table_statistics_with_buffer OK
sys.schema_tables_with_full_table_scans OK
sys.schema_unused_indexes OK
sys.session OK
sys.session_ssl_status OK
sys.statement_analysis OK
sys.statements_with_errors_or_warnings OK
sys.statements_with_full_table_scans OK
sys.statements_with_runtimes_in_95th_percentile OK
sys.statements_with_sorting OK
sys.statements_with_temp_tables OK
sys.user_summary OK
sys.user_summary_by_file_io OK
sys.user_summary_by_file_io_type OK
sys.user_summary_by_stages OK
sys.user_summary_by_statement_latency OK
sys.user_summary_by_statement_type OK
sys.version OK
sys.wait_classes_global_by_avg_latency OK
sys.wait_classes_global_by_latency OK
sys.waits_by_host_by_latency OK
sys.waits_by_user_by_latency OK
sys.waits_global_by_latency OK
sys.x$host_summary OK
sys.x$host_summary_by_file_io OK
sys.x$host_summary_by_file_io_type OK
sys.x$host_summary_by_stages OK
sys.x$host_summary_by_statement_latency OK
sys.x$host_summary_by_statement_type OK
sys.x$innodb_buffer_stats_by_schema OK
sys.x$innodb_buffer_stats_by_table OK
sys.x$innodb_lock_waits OK
sys.x$io_by_thread_by_latency OK
sys.x$io_global_by_file_by_bytes OK
sys.x$io_global_by_file_by_latency OK
sys.x$io_global_by_wait_by_bytes OK
sys.x$io_global_by_wait_by_latency OK
sys.x$latest_file_io OK
sys.x$memory_by_host_by_current_bytes OK
sys.x$memory_by_thread_by_current_bytes OK
sys.x$memory_by_user_by_current_bytes OK
sys.x$memory_global_by_current_bytes OK
sys.x$memory_global_total OK
sys.x$processlist OK
sys.x$ps_digest_95th_percentile_by_avg_us OK
sys.x$ps_digest_avg_latency_distribution OK
sys.x$ps_schema_table_statistics_io OK
sys.x$schema_flattened_keys OK
sys.x$schema_index_statistics OK
sys.x$schema_table_lock_waits OK
sys.x$schema_table_statistics OK
sys.x$schema_table_statistics_with_buffer OK
sys.x$schema_tables_with_full_table_scans OK
sys.x$session OK
sys.x$statement_analysis OK
sys.x$statements_with_errors_or_warnings OK
sys.x$statements_with_full_table_scans OK
sys.x$statements_with_runtimes_in_95th_percentile OK
sys.x$statements_with_sorting OK
sys.x$statements_with_temp_tables OK
sys.x$user_summary OK
sys.x$user_summary_by_file_io OK
sys.x$user_summary_by_file_io_type OK
sys.x$user_summary_by_stages OK
sys.x$user_summary_by_statement_latency OK
sys.x$user_summary_by_statement_type OK
sys.x$wait_classes_global_by_avg_latency OK
sys.x$wait_classes_global_by_latency OK
sys.x$waits_by_host_by_latency OK
sys.x$waits_by_user_by_latency OK
sys.x$waits_global_by_latency OK
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
mtr
mtr.global_suppressions OK
mtr.test_suppressions OK
performance_schema
sys
sys.sys_config OK
test
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
SET GLOBAL alter_algorithm=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
Variable_name Value
alter_algorithm DEFAULT
End of 10.3 tests
# switching from mysql.global_priv to mysql.user
drop view mysql.user_bak;
create user 'user3'@'localhost' identified with mysql_native_password as password('a_password');
......
......@@ -384,7 +384,20 @@ update mysql.db set Delete_history_priv='Y' where db like 'test%';
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
--echo # End of 10.3 tests
--echo #
--echo # MDEV-16735 Upgrades only work if 'alter_algorithm' is 'DEFAULT'
--echo # or 'COPY'. Test that the session value 'DEFAULT' in mysql_upgrade
--echo # properly overrides the potentially incompatible global value.
--echo #
SET GLOBAL alter_algorithm='INPLACE';
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
--exec $MYSQL_UPGRADE --force 2>&1
SET GLOBAL alter_algorithm=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
--echo End of 10.3 tests
--source include/switch_to_mysql_user.inc
drop view mysql.user_bak;
......
reset master;
set sql_log_bin=0;
drop table if exists t1,v1,v2,v3,v4,v1badcheck;
drop view if exists t1,v1,v2,v3,v4,v1badcheck;
......
-- source include/have_log_bin.inc
-- source include/have_perfschema.inc
reset master; # clear binlogs
set sql_log_bin=0;
--disable_warnings
drop table if exists t1,v1,v2,v3,v4,v1badcheck;
......
......@@ -211,6 +211,19 @@ Table Op Msg_type Msg_text
test.t check status OK
delete from t order by b limit 1;
drop table t;
#
# MDEV-30112 ASAN errors in Item_ident::print / generate_partition_syntax
#
create table t (a int) partition by hash(a);
alter table t change a b int, drop a;
ERROR 42S22: Unknown column 'a' in 't'
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY HASH (`a`)
drop table t;
# End of 10.3 tests
#
# Start of 10.4 tests
......
......@@ -196,6 +196,16 @@ delete from t order by b limit 1;
# cleanup
drop table t;
--echo #
--echo # MDEV-30112 ASAN errors in Item_ident::print / generate_partition_syntax
--echo #
create table t (a int) partition by hash(a);
--error ER_BAD_FIELD_ERROR
alter table t change a b int, drop a;
show create table t;
# Cleanup
drop table t;
--echo # End of 10.3 tests
--echo #
......
......@@ -58,3 +58,21 @@ Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY D
character_set_client latin1
collation_connection latin1_swedish_ci
drop view v1;
#
# MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result
#
create table t1 (a varchar(1), b bool) engine=myisam;
insert into t1 values ('u',1),('s',1);
select * from t1 where t1.b in (t1.a <= all (select 'a'));
a b
create view v as select * from t1 where t1.b in (t1.a <= all (select 'a'));
select * from v;
a b
show create view v;
View Create View character_set_client collation_connection
v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`b` = (`t1`.`a` <= all (select 'a')) latin1 latin1_swedish_ci
drop view v;
drop table t1;
#
# End of 10.3 results
#
......@@ -39,3 +39,19 @@ drop table t1;
create view v1 as select 1 like (now() between '2000-01-01' and '2012-12-12' );
query_vertical show create view v1;
drop view v1;
--echo #
--echo # MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result
--echo #
create table t1 (a varchar(1), b bool) engine=myisam;
insert into t1 values ('u',1),('s',1);
select * from t1 where t1.b in (t1.a <= all (select 'a'));
create view v as select * from t1 where t1.b in (t1.a <= all (select 'a'));
select * from v;
show create view v;
drop view v;
drop table t1;
--echo #
--echo # End of 10.3 results
--echo #
RESET MASTER;
#
# Bug mdev-463: assertion failure when running ANALYZE with RBR on
#
......
--source include/have_binlog_format_row.inc
--source include/have_innodb.inc
--source include/have_partition.inc
RESET MASTER; # clear up binlogs
--echo #
--echo # Bug mdev-463: assertion failure when running ANALYZE with RBR on
--echo #
......
......@@ -961,6 +961,13 @@ id a
DELETE FROM t1 WHERE a=CAST(0.671437 AS FLOAT);
DROP TABLE t1;
#
# MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in type 'int' in strings/dtoa.c
#
CREATE TABLE t1 (c DOUBLE);
INSERT INTO t1 VALUES ('1e4294967297');
ERROR 22003: Out of range value for column 'c' at row 1
DROP TABLE t1;
#
# End of 10.3 tests
#
#
......
......@@ -669,6 +669,16 @@ SELECT * FROM t1;
DELETE FROM t1 WHERE a=CAST(0.671437 AS FLOAT);
DROP TABLE t1;
--echo #
--echo # MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in type 'int' in strings/dtoa.c
--echo #
# This test was failing with UBSAN builds
CREATE TABLE t1 (c DOUBLE);
--error ER_WARN_DATA_OUT_OF_RANGE
INSERT INTO t1 VALUES ('1e4294967297');
DROP TABLE t1;
--echo #
--echo # End of 10.3 tests
......
drop table if exists t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
......@@ -1536,6 +1535,9 @@ DROP TABLE t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @var) union (select 1)' at line 1
(select 1) union (select 1 into @var);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @var)' at line 1
select @var;
@var
NULL
(select 2) union (select 1 into @var);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @var)' at line 1
(select 1) union (select 1) into @var;
......@@ -2764,5 +2766,20 @@ a b c d
3 4 2 197
drop table t1,t2;
#
# MDEV-30066 (limit + offset) union all (...) limit = incorrect result
#
create table t1(id int primary key auto_increment, c1 int);
insert into t1(c1) values(1),(2),(3);
(select * from t1 where c1>=1 order by c1 desc limit 2,1) union all (select * from t1 where c1>1 order by c1 desc);
id c1
1 1
2 2
3 3
(select * from t1 where c1>=1 order by c1 desc limit 2,1) union all (select * from t1 where c1>1 order by c1 desc) limit 2;
id c1
1 1
2 2
drop table t1;
#
# End of 10.3 tests
#
......@@ -2,10 +2,6 @@
# Test of unions
#
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6;
--enable_warnings
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
......@@ -23,7 +19,7 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
(select a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 4;
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
--error 1250
--error ER_TABLENAME_NOT_ALLOWED_HERE
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
--disable_view_protocol
......@@ -42,13 +38,13 @@ select found_rows();
explain select a,b from t1 union all select a,b from t2;
--error 1054
--error ER_BAD_FIELD_ERROR
explain select xx from t1 union select 1;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
explain select a,b from t1 union select 1;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
explain select 1 union select a,b from t1 union select 1;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
explain select a,b from t1 union select 1 limit 0;
--error ER_PARSE_ERROR
......@@ -60,19 +56,19 @@ select a,b from t1 order by a union select a,b from t2;
--error ER_PARSE_ERROR
insert into t3 select a from t1 order by a union select a from t2;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
create table t3 select a,b from t1 union select a from t2;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
select a,b from t1 union select a from t2;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
select * from t1 union select a from t2;
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
select a from t1 union select * from t2;
--error 1234
--error ER_CANT_USE_OPTION_HERE
select * from t1 union select SQL_BUFFER_RESULT * from t2;
# Test CREATE, INSERT and REPLACE
......@@ -86,13 +82,13 @@ drop table t1,t2,t3;
#
# Test some unions without tables
#
--error 1096
--error ER_NO_TABLES_USED
select * union select 1;
select 1 as a,(select a union select a);
--error 1054
--error ER_BAD_FIELD_ERROR
(select 1) union (select 2) order by 0;
SELECT @a:=1 UNION SELECT @a:=@a+1;
--error 1054
--error ER_BAD_FIELD_ERROR
(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
--sorted_result
(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2);
......@@ -295,7 +291,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4;
# Wrong usage
--error 1234
--error ER_CANT_USE_OPTION_HERE
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
create temporary table t1 select a from t1 union select a from t2;
......@@ -478,7 +474,7 @@ create table t1 select 1 union select -1;
select * from t1;
show create table t1;
drop table t1;
-- error 1267
-- error ER_CANT_AGGREGATE_2COLLATIONS
create table t1 select _latin1"test" union select _latin2"testt" ;
create table t1 select _latin2"test" union select _latin2"testt" ;
show create table t1;
......@@ -586,7 +582,7 @@ set sql_select_limit=default;
#
CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
--error 1054
--error ER_BAD_FIELD_ERROR
explain (select * from t1) union (select * from t2) order by not_existing_column;
drop table t1, t2;
......@@ -688,7 +684,7 @@ drop table t1;
create table t2 (
a char character set latin1 collate latin1_swedish_ci,
b char character set latin1 collate latin1_german1_ci);
--error 1271
--error ER_CANT_AGGREGATE_NCOLLATIONS
create table t1 as
(select a from t2) union
(select b from t2);
......@@ -985,7 +981,7 @@ CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (3),(1),(2),(4),(1);
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a) AS test;
--error 1054
--error ER_BAD_FIELD_ERROR
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
DROP TABLE t1;
......@@ -998,6 +994,7 @@ DROP TABLE t1;
(select 1 into @var) union (select 1);
--error ER_PARSE_ERROR
(select 1) union (select 1 into @var);
select @var;
--error ER_PARSE_ERROR
(select 2) union (select 1 into @var);
--enable_prepare_warnings
......@@ -2001,6 +1998,15 @@ union (select 0 as a, 99 as b,
drop table t1,t2;
--echo #
--echo # MDEV-30066 (limit + offset) union all (...) limit = incorrect result
--echo #
create table t1(id int primary key auto_increment, c1 int);
insert into t1(c1) values(1),(2),(3);
(select * from t1 where c1>=1 order by c1 desc limit 2,1) union all (select * from t1 where c1>1 order by c1 desc);
(select * from t1 where c1>=1 order by c1 desc limit 2,1) union all (select * from t1 where c1>1 order by c1 desc) limit 2;
drop table t1;
--echo #
--echo # End of 10.3 tests
--echo #
......@@ -149,12 +149,9 @@ select N'', length(N'');
select '', length('');
--enable_view_protocol
#enable after fix MDEV-28696
--disable_view_protocol
select b'', 0+b'';
select x'', 0+x'';
--enable_view_protocol
--error ER_BAD_FIELD_ERROR
select 0x;
......
......@@ -6912,6 +6912,14 @@ deallocate prepare stmt;
drop view v1;
drop table t1;
#
# MDEV-28696 View created as "select b''; " references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
CREATE VIEW v1 as select b'';
SELECT * FROM v1;
b''
DROP VIEW v1;
#
# End of 10.3 tests
#
#
......
......@@ -6644,6 +6644,15 @@ deallocate prepare stmt;
drop view v1;
drop table t1;
--echo #
--echo # MDEV-28696 View created as "select b''; " references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
--echo #
CREATE VIEW v1 as select b'';
SELECT * FROM v1;
DROP VIEW v1;
--echo #
--echo # End of 10.3 tests
--echo #
......
# mdev-23741 sharing violation when renaming .frm file in ALTER
CREATE TABLE t(i int);
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug='+d,file_sharing_violation';
CREATE TABLE t(i int) ENGINE=ARIA;
ALTER TABLE t ADD PRIMARY KEY (i);
FLUSH TABLES t;
SELECT * FROM t;
i
DROP TABLE t;
SET debug_dbug=@saved_dbug;
......@@ -4,8 +4,16 @@
--source include/windows.inc
--echo # mdev-23741 sharing violation when renaming .frm file in ALTER
CREATE TABLE t(i int);
SET STATEMENT debug_dbug='+d,rename_sharing_violation' FOR ALTER TABLE t ADD PRIMARY KEY (i);
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug='+d,file_sharing_violation';
CREATE TABLE t(i int) ENGINE=ARIA;
ALTER TABLE t ADD PRIMARY KEY (i);
FLUSH TABLES t;
SELECT * FROM t;
DROP TABLE t;
SET debug_dbug=@saved_dbug;
#End of 10.3 tests
......@@ -4441,6 +4441,7 @@ sub extract_warning_lines ($$) {
qr|InnoDB: io_setup\(\) failed with EAGAIN|,
qr|io_uring_queue_init\(\) failed with|,
qr|InnoDB: liburing disabled|,
qr/InnoDB: Failed to set (O_DIRECT|DIRECTIO_ON) on file/,
qr|setrlimit could not change the size of core files to 'infinity';|,
qr|feedback plugin: failed to retrieve the MAC address|,
qr|Plugin 'FEEDBACK' init function returned error|,
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -6,30 +6,32 @@
#
# Edit parameters below to specify the address and login to server:
#
USER=root
PSWD=
USER='root'
PSWD=''
#
# If these parameters are not set, then the values
# passed by the server are taken:
#
HOST=127.0.0.1
HOST="127.0.0.1"
PORT=$NODE_MYPORT_1
#
# Edit parameters below to specify SSL parameters:
#
ssl_key=
ssl_cert=
ssl_ca=
ssl_capath=
ssl_cipher=
ssl_crl=
ssl_crlpath=
ssl_cert=""
ssl_key=""
ssl_ca=""
ssl_capath=""
ssl_cipher=""
ssl_crl=""
ssl_crlpath=""
ssl_verify_server_cert=0
#
# Client executable path:
#
CLIENT="$EXE_MYSQL"
#
# Name of schema and tables:
#
SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status"
......@@ -67,7 +69,7 @@ configuration_change()
# Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g
echo ");"
idx=$(( $idx + 1 ))
idx=$(( $idx+1 ))
done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
......@@ -102,34 +104,35 @@ trim_string()
fi
}
COM=status_update # not a configuration change by default
COM='status_update' # not a configuration change by default
STATUS=""
CLUSTER_UUID=""
PRIMARY="0"
PRIMARY=0
INDEX=""
MEMBERS=""
while [ $# -gt 0 ]; do
case $1 in
--status)
'--status')
STATUS=$(trim_string "$2")
shift
;;
--uuid)
'--uuid')
CLUSTER_UUID=$(trim_string "$2")
shift
;;
--primary)
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0"
COM=configuration_change
'--primary')
arg=$(trim_string "$2")
[ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
COM='configuration_change'
shift
;;
--index)
'--index')
INDEX=$(trim_string "$2")
shift
;;
--members)
'--members')
MEMBERS=$(trim_string "$2")
shift
;;
......@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
then
SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
......@@ -181,8 +182,10 @@ then
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then
SSL_PARAM+=' --ssl-verify-server-cert'
if [ "$ssl_verify_server_cert" != "0" -o \
"$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
fi
fi
fi
......
......@@ -6,13 +6,13 @@
#
# Edit parameters below to specify the address and login to server:
#
USER=root
PSWD=
USER='root'
PSWD=''
#
# If these parameters are not set, then the values
# passed by the server are taken:
#
HOST=127.0.0.1
HOST="127.0.0.1"
PORT=$NODE_MYPORT_1
#
# Edit parameters below to specify SSL parameters:
......@@ -20,16 +20,18 @@ PORT=$NODE_MYPORT_1
ssl_cert="$MYSQL_TEST_DIR/std_data/client-cert.pem"
ssl_key="$MYSQL_TEST_DIR/std_data/client-key.pem"
ssl_ca="$MYSQL_TEST_DIR/std_data/cacert.pem"
ssl_capath=
ssl_cipher=
ssl_crl=
ssl_crlpath=
ssl_capath=""
ssl_cipher=""
ssl_crl=""
ssl_crlpath=""
ssl_verify_server_cert=0
#
# Client executable path:
#
CLIENT="$EXE_MYSQL"
#
# Name of schema and tables:
#
SCHEMA="mtr_wsrep_notify"
MEMB_TABLE="$SCHEMA.membership"
STATUS_TABLE="$SCHEMA.status"
......@@ -67,7 +69,7 @@ configuration_change()
# Don't forget to properly quote string values
echo "'$NODE'" | sed s/\\//\',\'/g
echo ");"
idx=$(( $idx + 1 ))
idx=$(( $idx+1 ))
done
echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);"
......@@ -102,34 +104,35 @@ trim_string()
fi
}
COM=status_update # not a configuration change by default
COM='status_update' # not a configuration change by default
STATUS=""
CLUSTER_UUID=""
PRIMARY="0"
PRIMARY=0
INDEX=""
MEMBERS=""
while [ $# -gt 0 ]; do
case $1 in
--status)
'--status')
STATUS=$(trim_string "$2")
shift
;;
--uuid)
'--uuid')
CLUSTER_UUID=$(trim_string "$2")
shift
;;
--primary)
[ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0"
COM=configuration_change
'--primary')
arg=$(trim_string "$2")
[ "$arg" = 'yes' ] && PRIMARY=1 || PRIMARY=0
COM='configuration_change'
shift
;;
--index)
'--index')
INDEX=$(trim_string "$2")
shift
;;
--members)
'--members')
MEMBERS=$(trim_string "$2")
shift
;;
......@@ -168,9 +171,7 @@ ssl_verify_server_cert=$(trim_string "$ssl_verify_server_cert");
SSL_PARAM=""
if [ -n "$ssl_key" -o -n "$ssl_cert" -o \
-n "$ssl_ca" -o -n "$ssl_capath" -o \
-n "$ssl_cipher" ]
if [ -n "$ssl_key$ssl_cert$ssl_ca$ssl_capath$ssl_cipher$ssl_crl$ssl_crlpath" ]
then
SSL_PARAM=' --ssl'
[ -n "$ssl_key" ] && SSL_PARAM="$SSL_PARAM --ssl-key='$ssl_key'"
......@@ -181,8 +182,10 @@ then
[ -n "$ssl_crl" ] && SSL_PARAM="$SSL_PARAM --ssl-crl='$ssl_crl'"
[ -n "$ssl_crlpath" ] && SSL_PARAM="$SSL_PARAM --ssl-crlpath='$ssl_crlpath'"
if [ -n "$ssl_verify_server_cert" ]; then
if [ $ssl_verify_server_cert -ne 0 ]; then
SSL_PARAM+=' --ssl-verify-server-cert'
if [ "$ssl_verify_server_cert" != "0" -o \
"$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
fi
fi
fi
......
reset master;
create table t1 (a int, b int) engine=innodb;
begin;
insert into t1 values (1,2);
......
reset master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
......
RESET MASTER;
SET @old_isolation_level= @@session.tx_isolation;
SET @@session.tx_isolation= 'READ-COMMITTED';
CREATE DATABASE b42829;
......
reset master;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
select @@innodb_autoinc_lock_mode;
@@innodb_autoinc_lock_mode
......
......@@ -3,6 +3,7 @@
let collation=utf8mb3_unicode_ci;
--source include/have_collation.inc
reset master; # clear up binlogs
# REQUIREMENT
# replace_regex should replace output of SHOW BINLOG EVENTS
......
--source include/not_embedded.inc
--source include/have_binlog_format_statement.inc
reset master; # clear up binlogs
--exec $MYSQL_CLIENT_TEST test_datetime_ranges_mdev15289 > $MYSQLTEST_VARDIR/log/binlog_stm_datetime_ranges_mysql_client_test.out.log 2>&1
--let $binlog_file = LAST
......
......@@ -37,7 +37,7 @@
-- source include/have_log_bin.inc
-- source include/have_innodb.inc
-- source include/have_binlog_format_statement.inc
RESET MASTER; # clear up binlogs
SET @old_isolation_level= @@session.tx_isolation;
SET @@session.tx_isolation= 'READ-COMMITTED';
......
--source include/have_innodb.inc
--source include/have_binlog_format_mixed.inc
reset master; #clear up binlogs
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
select @@innodb_autoinc_lock_mode;
......
......@@ -50,7 +50,6 @@ restore: t1 .ibd and .cfg files
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
ALTER TABLE t1 DISCARD TABLESPACE;
Warnings:
Warning 1814 Tablespace has been discarded for table `t1`
Warning 1812 Tablespace is missing for table 'test/t1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
......
......@@ -11,9 +11,10 @@ UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t2 when .cfg file is missing.
ALTER TABLE t2 DROP KEY idx;
ALTER TABLE t2 IMPORT TABLESPACE;
Warnings:
Warning 1814 Tablespace has been discarded for table `t2`
ALTER TABLE t2 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
SELECT * FROM t2;
f1 f2
......
......@@ -391,7 +391,7 @@ connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT SELECT (`f1`), INSERT (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
......@@ -413,7 +413,7 @@ connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
......@@ -618,14 +618,14 @@ grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
......@@ -633,7 +633,7 @@ connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
......@@ -649,7 +649,7 @@ connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
......
......@@ -1541,8 +1541,8 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1692,8 +1692,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1735,8 +1735,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`, `f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
......
......@@ -134,7 +134,7 @@ GRANT SELECT (a) ON t1 TO foo;
SHOW GRANTS FOR foo;
Grants for foo@%
GRANT USAGE ON *.* TO `foo`@`%`
GRANT SELECT (a) ON `db`.`t1` TO `foo`@`%`
GRANT SELECT (`a`) ON `db`.`t1` TO `foo`@`%`
SELECT * FROM information_schema.check_constraints;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
def db t1 CONSTRAINT_1 Table `b` > 0
......
......@@ -219,7 +219,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -231,7 +231,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
......@@ -246,7 +246,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -259,7 +259,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
SELECT f1, f3 FROM db_datadict.my_table;
ERROR 42S22: Unknown column 'f3' in 'field list'
connection default;
......@@ -275,7 +275,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -288,7 +288,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
DROP TABLE db_datadict.my_table;
SELECT * FROM information_schema.column_privileges
......@@ -302,7 +302,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
......@@ -315,7 +315,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `testuser1`@`localhost`
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
GRANT SELECT (`f3`, `f1`), UPDATE (`f1`) ON `db_datadict`.`my_table` TO `testuser1`@`localhost`
connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
......
......@@ -243,7 +243,7 @@ def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT (`f5`, `f1`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
......@@ -262,7 +262,7 @@ def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT (`f5`, `f1`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
......@@ -281,7 +281,7 @@ REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT (`f5`, `f1`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
......@@ -294,7 +294,7 @@ def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
GRANT SELECT (`f5`, `f1`) ON `db_datadict_2`.`t3` TO `testuser1`@`localhost`
connection default;
disconnect testuser1;
disconnect testuser2;
......
......@@ -111,7 +111,7 @@ GRANT SELECT(f5) ON db_datadict.t1 TO 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
GRANT SELECT (`f5`) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
......@@ -135,7 +135,7 @@ connect testuser1, localhost, testuser1, , db_datadict;
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO `testuser1`@`localhost`
GRANT SELECT (f5) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
GRANT SELECT (`f5`) ON `db_datadict`.`t1` TO `testuser1`@`localhost`
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'db_datadict'
ORDER BY table_schema,table_name, constraint_name;
......
......@@ -391,7 +391,7 @@ connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT SELECT (`f1`), INSERT (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
......@@ -413,7 +413,7 @@ connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
......@@ -618,14 +618,14 @@ grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
......@@ -633,7 +633,7 @@ connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
......@@ -649,7 +649,7 @@ connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
......
......@@ -1480,8 +1480,8 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1631,8 +1631,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1674,8 +1674,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`, `f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
......
......@@ -391,7 +391,7 @@ connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT SELECT (`f1`), INSERT (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
......@@ -413,7 +413,7 @@ connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
......@@ -618,14 +618,14 @@ grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection default;
......@@ -633,7 +633,7 @@ connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
GRANT INSERT (`f1`), UPDATE (`f1`) ON `priv_db`.`t1` TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
......@@ -649,7 +649,7 @@ connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
......
......@@ -1480,8 +1480,8 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE (`f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1631,8 +1631,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`), TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection yes_privs;
select current_user;
current_user
......@@ -1674,8 +1674,8 @@ to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
GRANT SELECT (`f1`), INSERT, UPDATE ON `priv_db`.`t2` TO `test_yesprivs`@`localhost`
GRANT SELECT, SELECT (`f1`), INSERT, UPDATE (`f3`, `f2`, `f1`) ON `priv_db`.`t1` TO `test_yesprivs`@`localhost`
connection no_privs;
select current_user;
current_user
......
......@@ -10,33 +10,13 @@
#
##############################################################################
GCF-939 : MDEV-21520 galera.GCF-939
MW-329 : MDEV-19962 Galera test failure on MW-329
galera_as_slave_ctas : MDEV-28378 timeout
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit
galera_bf_kill_debug : MDEV-24485 wsrep::client_state::do_acquire_ownership(): Assertion `state_ == s_idle || mode_ != m_local' failed
galera_bf_lock_wait : MDEV-21597 wsrep::transaction::start_transaction(): Assertion `active() == false' failed
galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_bf_abort_at_after_statement : Timeout in wait_condition.inc for SELECT COUNT(*) = 1 FROM t1 where id = 1 and val = 3
galera_pc_recovery : MDEV-25199 cluster fails to start up
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_sst_mysqldump : MDEV-26501 : galera.galera_sst_mysqldump MTR failed: galera SST with mysqldump failed
galera_unicode_identifiers : MDEV-26500 : galera.galera_unicode_identifiers MTR failed: InnoDB: innodb_fatal_semaphore_wait_threshold was exceeded for dict_sys.mutex
galera_var_dirty_reads : MDEV-25615 Galera test failure on galera_var_dirty_reads
galera_var_ignore_apply_errors : MDEV-26770 galera_var_ignore_apply_errors fails Server did not transition to READY state
galera_sst_encrypted : MDEV-29876 Galera test failure on galera_sst_encrypted
MW-284 : MDEV-29861 Galera test case hangs
galera_binlog_checksum : MDEV-29861 Galera test case hangs
galera_var_notify_ssl_ipv6 : MDEV-29861 Galera test case hangs
galera_var_node_address : MDEV-20485 Galera test failure
galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_notify_ssl_ipv6 : hangs after the merge of MDEV-27682
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
partition : MDEV-19958 Galera test failure on galera.partition
pxc-421: wsrep_provider is read-only for security reasons
query_cache: MDEV-15805 Test failure on galera.query_cache
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_bf_abort_at_after_statement : Unstable
galera_bf_abort_shutdown : MDEV-29773 Assertion failure on sql/wsrep_mysqld.cc:2893 in wsrep_bf_abort_shutdown
galera.MW-284 : MDEV-29861: Galera test case hangs
galera.galera_binlog_checksum : MDEV-29861: Galera test case hangs
galera_var_notify_ssl_ipv6 : MDEV-29861: Galera test case hangs
MDEV-26575 : MDEV-29878 Galera test failure on MDEV-26575
galera_bf_abort_shutdown : MDEV-29918 Assertion failure on galera_bf_abort_shutdown
......@@ -10,4 +10,6 @@ SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue';
INSERT INTO t1 VALUES (1);
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_1;
connection node_2a;
connection node_1;
DROP TABLE t1;
......@@ -94,6 +94,7 @@ CALL insert_1m ();;
connection node_1_insert_10m;
CALL insert_10m ();;
connection node_2;
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
SET SESSION wsrep_sync_wait = 0;
Killing server ...
connection node_1;
......@@ -130,9 +131,11 @@ DROP PROCEDURE update_simple;
DROP PROCEDURE insert_1k;
DROP PROCEDURE insert_1m;
connection node_1;
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("conflict state 7 after post commit");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
connection node_2;
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_2;
Shutting down server ...
connection node_1;
connection node_2;
Cleaning grastate.dat file ...
Starting server ...
connection node_1;
connection node_2;
connection node_2;
Shutting down server ...
connection node_1;
connection node_2;
Cleaning grastate.dat file ...
Starting server ...
connection node_1;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE
Primary
......@@ -38,3 +54,7 @@ VARIABLE_VALUE
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE
Synced
Shutting down server ...
Cleaning var directory ...
Starting server ...
connection node_1;
......@@ -57,7 +57,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`i`)
(PARTITION `p1` VALUES LESS THAN (10) ENGINE = InnoDB,
PARTITION `p2` VALUES LESS THAN (20) ENGINE = InnoDB,
......@@ -67,7 +67,7 @@ Table Create Table
p1 CREATE TABLE `p1` (
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT * FROM test.t1;
i
19
......@@ -94,7 +94,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`i`)
(PARTITION `p1` VALUES LESS THAN (10) ENGINE = InnoDB,
PARTITION `pMax` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
......@@ -106,7 +106,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`i` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`i`)
(PARTITION `p1` VALUES LESS THAN (10) ENGINE = InnoDB,
PARTITION `pMax` VALUES LESS THAN MAXVALUE ENGINE = InnoDB)
......
This diff is collapsed.
......@@ -23,12 +23,22 @@ SET DEBUG_SYNC = 'wsrep_before_certification WAIT_FOR continue';
--send INSERT INTO t1 VALUES (1)
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--source include/restart_mysqld.inc
--source include/shutdown_mysqld.inc
# On node_1, verify that the node has left the cluster.
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--connection node_2a
--source include/start_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# Restore original auto_increment_offset values.
--let $node_2=node_2a
--source include/auto_increment_offset_restore.inc
--connection node_1
DROP TABLE t1;
......@@ -126,6 +126,7 @@ DELIMITER ;|
--send CALL insert_10m ();
--connection node_2
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
SET SESSION wsrep_sync_wait = 0;
# Make sure that node_2 is not killed while TOIs are applied.
......@@ -199,6 +200,7 @@ DROP PROCEDURE insert_1k;
DROP PROCEDURE insert_1m;
--connection node_1
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("conflict state 7 after post commit");
# Warning happens when the cluster is started for the first time
......@@ -213,6 +215,7 @@ CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
--source include/assert_grep.inc
--connection node_2
call mtr.add_suppression("Error in Log_event::read_log_event():.*");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that gcache recovery took place
......
......@@ -7,14 +7,14 @@ ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
bind-address=::
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_address=::1
wsrep_node_address=[::1]:@mysqld.1.#galera_port
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_node_address=::1
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;repl.causal_read_timeout=PT90S;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_address=[::1]:@mysqld.2.#galera_port
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
......@@ -6,6 +6,62 @@
--source include/galera_cluster.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_2
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_2
#
# Delete grastate.dat with safe_to_bootstrap: 0
#
--echo Cleaning grastate.dat file ...
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo Starting server ...
--let $restart_noprint=2
--let $start_mysqld_params="--wsrep-new-cluster"
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_2
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_2
#
# Delete grastate.dat with safe_to_bootstrap: 0
#
--echo Cleaning grastate.dat file ...
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo Starting server ...
--let $restart_noprint=2
--let $start_mysqld_params="--wsrep-new-cluster"
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
......@@ -37,3 +93,29 @@ SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBA
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
#
# Force SST
#
--echo Cleaning var directory ...
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
--echo Starting server ...
--let $start_mysqld_params=
--source include/start_mysqld.inc
--source include/wait_until_ready.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--source include/auto_increment_offset_restore.inc
!include ../galera_2nodes.cnf
[mysqld.1]
query_cache_type=1
[mysqld.2]
query_cache_type=1
This diff is collapsed.
This diff is collapsed.
......@@ -65,5 +65,5 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment