diff options
Diffstat (limited to 'mysql-test/suite/plugins')
19 files changed, 678 insertions, 10 deletions
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result index 6769d867167..f5d1ce2497d 100644 --- a/mysql-test/suite/plugins/r/auth_ed25519.result +++ b/mysql-test/suite/plugins/r/auth_ed25519.result @@ -27,7 +27,7 @@ PLUGIN_STATUS ACTIVE PLUGIN_TYPE AUTHENTICATION PLUGIN_TYPE_VERSION 2.2 PLUGIN_LIBRARY auth_ed25519.so -PLUGIN_LIBRARY_VERSION 1.14 +PLUGIN_LIBRARY_VERSION 1.15 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication PLUGIN_LICENSE GPL diff --git a/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff new file mode 100644 index 00000000000..06fdb0bd4f0 --- /dev/null +++ b/mysql-test/suite/plugins/r/compression,innodb-lz4.rdiff @@ -0,0 +1,24 @@ +--- suite/plugins/r/compression.result ++++ suite/plugins/r/compression.reject +@@ -1,8 +1,8 @@ + # +-# Testing bzip2 compression provider with innodb ++# Testing lz4 compression provider with innodb + # + call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +-set global innodb_compression_algorithm = bzip2; ++set global innodb_compression_algorithm = lz4; + call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); + call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); + call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +@@ -15,8 +15,8 @@ + 0 abcabcabc 300 + 1 defdefdef 3000 + 2 ghighighi 30000 +-# restart: --disable-provider-bzip2 ++# restart: --disable-provider-lz4 + select a, left(b, 9), length(b) from t1; +-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table ++ERROR HY000: Table test/t1 is compressed with lz4, which is not currently loaded. Please load the lz4 provider plugin to open the table + drop table t1; + # restart diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff new file mode 100644 index 00000000000..ee348934a54 --- /dev/null +++ b/mysql-test/suite/plugins/r/compression,innodb-lzma.rdiff @@ -0,0 +1,24 @@ +--- suite/plugins/r/compression.result ++++ suite/plugins/r/compression.reject +@@ -1,8 +1,8 @@ + # +-# Testing bzip2 compression provider with innodb ++# Testing lzma compression provider with innodb + # + call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +-set global innodb_compression_algorithm = bzip2; ++set global innodb_compression_algorithm = lzma; + call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); + call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); + call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +@@ -15,8 +15,8 @@ + 0 abcabcabc 300 + 1 defdefdef 3000 + 2 ghighighi 30000 +-# restart: --disable-provider-bzip2 ++# restart: --disable-provider-lzma + select a, left(b, 9), length(b) from t1; +-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table ++ERROR HY000: Table test/t1 is compressed with lzma, which is not currently loaded. Please load the lzma provider plugin to open the table + drop table t1; + # restart diff --git a/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff new file mode 100644 index 00000000000..d7cdc41092a --- /dev/null +++ b/mysql-test/suite/plugins/r/compression,innodb-lzo.rdiff @@ -0,0 +1,24 @@ +--- suite/plugins/r/compression.result ++++ suite/plugins/r/compression.reject +@@ -1,8 +1,8 @@ + # +-# Testing bzip2 compression provider with innodb ++# Testing lzo compression provider with innodb + # + call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +-set global innodb_compression_algorithm = bzip2; ++set global innodb_compression_algorithm = lzo; + call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); + call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); + call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +@@ -15,8 +15,8 @@ + 0 abcabcabc 300 + 1 defdefdef 3000 + 2 ghighighi 30000 +-# restart: --disable-provider-bzip2 ++# restart: --disable-provider-lzo + select a, left(b, 9), length(b) from t1; +-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table ++ERROR HY000: Table test/t1 is compressed with lzo, which is not currently loaded. Please load the lzo provider plugin to open the table + drop table t1; + # restart diff --git a/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff new file mode 100644 index 00000000000..e9c7485d118 --- /dev/null +++ b/mysql-test/suite/plugins/r/compression,innodb-snappy.rdiff @@ -0,0 +1,24 @@ +--- suite/plugins/r/compression.result ++++ suite/plugins/r/compression.reject +@@ -1,8 +1,8 @@ + # +-# Testing bzip2 compression provider with innodb ++# Testing snappy compression provider with innodb + # + call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +-set global innodb_compression_algorithm = bzip2; ++set global innodb_compression_algorithm = snappy; + call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); + call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); + call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +@@ -15,8 +15,8 @@ + 0 abcabcabc 300 + 1 defdefdef 3000 + 2 ghighighi 30000 +-# restart: --disable-provider-bzip2 ++# restart: --disable-provider-snappy + select a, left(b, 9), length(b) from t1; +-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table ++ERROR HY000: Table test/t1 is compressed with snappy, which is not currently loaded. Please load the snappy provider plugin to open the table + drop table t1; + # restart diff --git a/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff new file mode 100644 index 00000000000..9b155ff3a1d --- /dev/null +++ b/mysql-test/suite/plugins/r/compression,mroonga-lz4.rdiff @@ -0,0 +1,40 @@ +--- suite/plugins/r/compression.result ++++ suite/plugins/r/compression.reject +@@ -1,12 +1,8 @@ + # +-# Testing bzip2 compression provider with innodb ++# Testing lz4 compression provider with mroonga + # + call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +-set global innodb_compression_algorithm = bzip2; +-call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); +-call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); +-call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +-create table t1 (a int, b text ) engine = innodb page_compressed = 1; ++create table t1 (a int, b text COMMENT 'FLAGS "COLUMN_SCALAR|COMPRESS_LZ4"') engine = mroonga charset = utf8; + insert t1 (a, b) values (0, repeat("abc", 100)); + insert t1 (a, b) values (1, repeat("def", 1000)); + insert t1 (a, b) values (2, repeat("ghi", 10000)); +@@ -14,8 +11,20 @@ + 0 abcabcabc 300 + 1 defdefdef 3000 + 2 ghighighi 30000 +-# restart: --disable-provider-bzip2 ++# restart: --disable-provider-lz4 + select a, left(b, 9), length(b) from t1; +-ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table ++a left(b, 9) length(b) ++0 0 ++1 0 ++2 0 ++Warnings: ++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded ++select a, left(b, 9), length(b) from t1; ++a left(b, 9) length(b) ++0 0 ++1 0 ++2 0 ++Warnings: ++Warning 4185 MariaDB tried to use the LZ4 compression, but its provider plugin is not loaded + drop table t1; + # restart diff --git a/mysql-test/suite/plugins/r/compression.result b/mysql-test/suite/plugins/r/compression.result new file mode 100644 index 00000000000..dd267f282c5 --- /dev/null +++ b/mysql-test/suite/plugins/r/compression.result @@ -0,0 +1,22 @@ +# +# Testing bzip2 compression provider with innodb +# +call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +set global innodb_compression_algorithm = bzip2; +call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); +call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); +call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +create table t1 (a int, b text ) engine = innodb page_compressed = 1; +insert t1 (a, b) values (0, repeat("abc", 100)); +insert t1 (a, b) values (1, repeat("def", 1000)); +insert t1 (a, b) values (2, repeat("ghi", 10000)); +select a, left(b, 9), length(b) from t1; +a left(b, 9) length(b) +0 abcabcabc 300 +1 defdefdef 3000 +2 ghighighi 30000 +# restart: --disable-provider-bzip2 +select a, left(b, 9), length(b) from t1; +ERROR HY000: Table test/t1 is compressed with bzip2, which is not currently loaded. Please load the bzip2 provider plugin to open the table +drop table t1; +# restart diff --git a/mysql-test/suite/plugins/r/compression_load.result b/mysql-test/suite/plugins/r/compression_load.result new file mode 100644 index 00000000000..a23037edc17 --- /dev/null +++ b/mysql-test/suite/plugins/r/compression_load.result @@ -0,0 +1,33 @@ +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +plugin_name plugin_status +set global innodb_compression_algorithm = lz4; +ERROR 42000: Variable 'innodb_compression_algorithm' can't be set to the value of 'lz4' +install plugin provider_lz4 soname 'provider_lz4'; +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +plugin_name plugin_status +provider_lz4 ACTIVE +set global innodb_compression_algorithm = lz4; +create table t1 (a int, b text) engine=innodb page_compressed=1; +insert t1 (a, b) values (0, repeat("abc", 100)); +insert t1 (a, b) values (1, repeat("def", 1000)); +insert t1 (a, b) values (2, repeat("ghi", 10000)); +select a, left(b, 9), length(b) from t1; +a left(b, 9) length(b) +0 abcabcabc 300 +1 defdefdef 3000 +2 ghighighi 30000 +uninstall plugin provider_lz4; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +plugin_name plugin_status +provider_lz4 INACTIVE +set global innodb_compression_algorithm = default; +set global innodb_compression_algorithm = lz4; +set global innodb_compression_algorithm = default; +select a, left(b, 9), length(b) from t1; +a left(b, 9) length(b) +0 abcabcabc 300 +1 defdefdef 3000 +2 ghighighi 30000 +drop table t1; diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result index 218d12fb884..192d41d2ccf 100644 --- a/mysql-test/suite/plugins/r/cracklib_password_check.result +++ b/mysql-test/suite/plugins/r/cracklib_password_check.result @@ -4,9 +4,9 @@ PLUGIN_NAME cracklib_password_check PLUGIN_VERSION 1.0 PLUGIN_STATUS ACTIVE PLUGIN_TYPE PASSWORD VALIDATION -PLUGIN_TYPE_VERSION 1.0 +PLUGIN_TYPE_VERSION 1.1 PLUGIN_LIBRARY cracklib_password_check.so -PLUGIN_LIBRARY_VERSION 1.14 +PLUGIN_LIBRARY_VERSION 1.15 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Password validation via CrackLib PLUGIN_LICENSE GPL @@ -37,6 +37,18 @@ show warnings; Level Code Message Warning 1819 cracklib: it is based on a dictionary word Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check) +grant select on *.* to foocar@localhost identified by 'localhost'; +ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check) +show warnings; +Level Code Message +Warning 1819 cracklib: it is based upon your password entry +Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check) +grant select on *.* to foocar@localhost identified by 'foocar@localhost'; +ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check) +show warnings; +Level Code Message +Warning 1819 cracklib: it is derived from your password entry +Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check) grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; # diff --git a/mysql-test/suite/plugins/r/password_reuse_check.result b/mysql-test/suite/plugins/r/password_reuse_check.result new file mode 100644 index 00000000000..72f3dd5364b --- /dev/null +++ b/mysql-test/suite/plugins/r/password_reuse_check.result @@ -0,0 +1,94 @@ +install soname "password_reuse_check"; +set global password_reuse_check_interval= 0; +# Default value (sould be unlimited i.e. 0) +SHOW GLOBAL VARIABLES like "password_reuse_check%"; +Variable_name Value +password_reuse_check_interval 0 +# insert user +grant select on *.* to user_name@localhost identified by 'test_pwd'; +grant select on *.* to user_name@localhost identified by 'test_pwd'; +ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check) +show warnings; +Level Code Message +Warning 1819 password_reuse_check: The password was already used +Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check) +alter user user_name@localhost identified by 'test_pwd'; +ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost' +show warnings; +Level Code Message +Warning 1819 password_reuse_check: The password was already used +Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check) +Error 1396 Operation ALTER USER failed for 'user_name'@'localhost' +# check exparation +set global password_reuse_check_interval= 10; +alter user user_name@localhost identified by 'test_pwd'; +ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost' +show warnings; +Level Code Message +Warning 1819 password_reuse_check: The password was already used +Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check) +Error 1396 Operation ALTER USER failed for 'user_name'@'localhost' +select hex(hash) from mysql.password_reuse_check_history; +hex(hash) +B9F970DE4DA0145F842526C1BC9DBBBDB3EF80FDD7BE98061DAE3D18F492AA37668C07322DD21650C66B48FC78F0EAF6CB08245CC895BFDC43BE6921B07E5240 +# emulate old password +update mysql.password_reuse_check_history set time= date_sub(now(), interval +11 day); +alter user user_name@localhost identified by 'test_pwd'; +show warnings; +Level Code Message +drop user user_name@localhost; +show create table mysql.password_reuse_check_history; +Table Create Table +password_reuse_check_history CREATE TABLE `password_reuse_check_history` ( + `hash` binary(64) NOT NULL, + `time` timestamp NOT NULL DEFAULT current_timestamp(), + PRIMARY KEY (`hash`), + KEY `tm` (`time`) +) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 +select count(*) from mysql.password_reuse_check_history; +count(*) +1 +drop table mysql.password_reuse_check_history; +# test error messages +set global password_reuse_check_interval= 0; +drop table if exists mysql.password_reuse_check_history; +Warnings: +Note 1051 Unknown table 'mysql.password_reuse_check_history' +# test error messages +create table mysql.password_reuse_check_history (wrong_structure int); +grant select on *.* to user_name@localhost identified by 'test_pwd'; +ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check) +show warnings; +Level Code Message +Warning 1105 password_reuse_check:[1054] Unknown column 'hash' in 'field list' +Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check) +set global password_reuse_check_interval= 10; +grant select on *.* to user_name@localhost identified by 'test_pwd'; +ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check) +show warnings; +Level Code Message +Warning 1105 password_reuse_check:[1054] Unknown column 'time' in 'where clause' +Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check) +drop table mysql.password_reuse_check_history; +# +# MDEV-28838: password_reuse_check plugin mixes username and password +# +grant select on *.* to user_name@localhost identified by 'test_pwd'; +grant select on *.* to user_nam@localhost identified by 'etest_pwd'; +show warnings; +Level Code Message +drop user user_name@localhost; +drop user user_nam@localhost; +drop table mysql.password_reuse_check_history; +grant select on *.* to user_name@localhost identified by 'test_pwd'; +grant select on *.* to tuser_name@localhos identified by 'test_pwd'; +show warnings; +Level Code Message +drop user user_name@localhost; +drop user tuser_name@localhos; +# +# End of 10.7 tests +# +drop table mysql.password_reuse_check_history; +uninstall plugin password_reuse_check; diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result index 3bdaf39d0d0..ebd5b6cc198 100644 --- a/mysql-test/suite/plugins/r/show_all_plugins.result +++ b/mysql-test/suite/plugins/r/show_all_plugins.result @@ -4,8 +4,8 @@ Variable_name Value Opened_plugin_libraries 0 select * from information_schema.all_plugins where plugin_library='ha_example.so'; PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION -EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.14 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 -UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.14 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 +EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.15 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 +UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.15 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 show status like '%libraries%'; Variable_name Value Opened_plugin_libraries 1 diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result index ab6988ed002..30f68ba8193 100644 --- a/mysql-test/suite/plugins/r/simple_password_check.result +++ b/mysql-test/suite/plugins/r/simple_password_check.result @@ -4,9 +4,9 @@ PLUGIN_NAME simple_password_check PLUGIN_VERSION 1.0 PLUGIN_STATUS ACTIVE PLUGIN_TYPE PASSWORD VALIDATION -PLUGIN_TYPE_VERSION 1.0 +PLUGIN_TYPE_VERSION 1.1 PLUGIN_LIBRARY simple_password_check.so -PLUGIN_LIBRARY_VERSION 1.14 +PLUGIN_LIBRARY_VERSION 1.15 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Simple password strength checks PLUGIN_LICENSE GPL diff --git a/mysql-test/suite/plugins/r/test_sql_service.result b/mysql-test/suite/plugins/r/test_sql_service.result index af414d6c6e7..e5f09b67b6b 100644 --- a/mysql-test/suite/plugins/r/test_sql_service.result +++ b/mysql-test/suite/plugins/r/test_sql_service.result @@ -1,8 +1,100 @@ +reset master; install plugin test_sql_service soname 'test_sql_service'; +show status like 'test_sql_service_passed'; +Variable_name Value +Test_sql_service_passed 1 +set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null'; +set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null'; +select * from t1 order by a; +a @@SQL_LOG_BIN +1 0 +2 0 +3 1 +4 0 +5 1 +6 0 +drop table t1; +SET SQL_LOG_BIN=0; set global test_sql_service_run_test= 1; -show status like 'test_sql_service%'; +show status like 'test_sql_service_passed'; +Variable_name Value +Test_sql_service_passed 1 +set global test_sql_service_execute_sql_local= 'create table test.t1(id int)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 0 rows. +set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 2 rows. +set global test_sql_service_execute_sql_local= 'select * from test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query returned 2 rows. +set global test_sql_service_execute_sql_local= 'drop table test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 0 rows. +set global test_sql_service_execute_sql_local= 'drop table test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Error 1051 returned. Unknown table 'test.t1' +set global test_sql_service_execute_sql_global= 'create table test.t1(id int)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 0 rows. +set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 2 rows. +set global test_sql_service_execute_sql_global= 'select * from test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query returned 2 rows. +set global test_sql_service_execute_sql_global= 'drop table test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query affected 0 rows. +set global test_sql_service_execute_sql_global= 'drop table test.t1'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Error 1051 returned. Unknown table 'test.t1' +create table t1 (id int, time timestamp); +insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL); +set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query returned 0 rows. +set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query returned 5 rows. +set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)'; +show status like 'test_sql_query_result'; +Variable_name Value +Test_sql_query_result Query returned 0 rows. +set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()'; +show status like 'test_sql_query_result'; Variable_name Value -Test_sql_service_passed 0 +Test_sql_query_result Query returned 5 rows. +drop table t1; uninstall plugin test_sql_service; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # insert into test.t1 select 3 as a, @@SQL_LOG_BIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ diff --git a/mysql-test/suite/plugins/t/compression.combinations b/mysql-test/suite/plugins/t/compression.combinations new file mode 100644 index 00000000000..645ca60e5f0 --- /dev/null +++ b/mysql-test/suite/plugins/t/compression.combinations @@ -0,0 +1,29 @@ +[innodb-bzip2] +innodb +plugin-load-add=$PROVIDER_BZIP2_SO +loose-provider-bzip2 + +[innodb-lz4] +innodb +plugin-load-add=$PROVIDER_LZ4_SO +loose-provider-lz4 + +[innodb-lzma] +innodb +plugin-load-add=$PROVIDER_LZMA_SO +loose-provider-lzma + +[innodb-lzo] +innodb +plugin-load-add=$PROVIDER_LZO_SO +loose-provider-lzo + +[innodb-snappy] +innodb +plugin-load-add=$PROVIDER_SNAPPY_SO +loose-provider-snappy + +[mroonga-lz4] +plugin-load-add=$HA_MROONGA_SO +plugin-load-add=$PROVIDER_LZ4_SO +loose-provider-lz4 diff --git a/mysql-test/suite/plugins/t/compression.test b/mysql-test/suite/plugins/t/compression.test new file mode 100644 index 00000000000..c97c5725e1d --- /dev/null +++ b/mysql-test/suite/plugins/t/compression.test @@ -0,0 +1,52 @@ +let $engine=`select regexp_replace('$MTR_COMBINATIONS', '-.*', '')`; +let $alg=`select regexp_replace('$MTR_COMBINATIONS', '.*-', '')`; + +if (`select count(*) = 0 from information_schema.plugins where plugin_name = '$engine' and plugin_status='active'`) +{ + skip Needs $engine engine; +} + +if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'provider_$alg' and plugin_status='active'`) +{ + skip Needs provider_$alg plugin; +} + +--echo # +--echo # Testing $alg compression provider with $engine +--echo # + +call mtr.add_suppression("MariaDB tried to use the .+ compression, but its provider plugin is not loaded"); +if ($engine == "innodb") { + eval set global innodb_compression_algorithm = $alg; + let $table_params = page_compressed = 1; + call mtr.add_suppression("Background Page read failed to read, uncompress, or decrypt"); + call mtr.add_suppression("Table is compressed or encrypted but uncompress or decrypt failed"); + call mtr.add_suppression("Table .*t1.* is compressed with (\\w+), which is not currently loaded. Please load the \\1 provider plugin to open the table"); +} +if ($engine == "mroonga") { + let $column_params = `select upper('COMMENT \'flags "COLUMN_SCALAR|COMPRESS_$alg"\'')`; + let $table_params = charset = utf8; +} + +eval create table t1 (a int, b text $column_params) engine = $engine $table_params; + +insert t1 (a, b) values (0, repeat("abc", 100)); +insert t1 (a, b) values (1, repeat("def", 1000)); +insert t1 (a, b) values (2, repeat("ghi", 10000)); +select a, left(b, 9), length(b) from t1; + +let $restart_parameters = --disable-provider-$alg; +source include/restart_mysqld.inc; + +if ($engine == "innodb") { + error ER_PROVIDER_NOT_LOADED; + select a, left(b, 9), length(b) from t1; +} +if ($engine == "mroonga"){ + select a, left(b, 9), length(b) from t1; + select a, left(b, 9), length(b) from t1; # a warning once per statement +} +drop table t1; + +let $restart_parameters =; +source include/restart_mysqld.inc; diff --git a/mysql-test/suite/plugins/t/compression_load.test b/mysql-test/suite/plugins/t/compression_load.test new file mode 100644 index 00000000000..d67c204e75f --- /dev/null +++ b/mysql-test/suite/plugins/t/compression_load.test @@ -0,0 +1,24 @@ +source include/have_innodb.inc; + +if (!$PROVIDER_LZ4_SO) { + skip Requires provider_lz4 plugin; +} + +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_compression_algorithm = lz4; +install plugin provider_lz4 soname 'provider_lz4'; +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +set global innodb_compression_algorithm = lz4; +create table t1 (a int, b text) engine=innodb page_compressed=1; +insert t1 (a, b) values (0, repeat("abc", 100)); +insert t1 (a, b) values (1, repeat("def", 1000)); +insert t1 (a, b) values (2, repeat("ghi", 10000)); +select a, left(b, 9), length(b) from t1; +uninstall plugin provider_lz4; +select plugin_name, plugin_status from information_schema.plugins where plugin_name='provider_lz4'; +set global innodb_compression_algorithm = default; +set global innodb_compression_algorithm = lz4; +set global innodb_compression_algorithm = default; +select a, left(b, 9), length(b) from t1; +drop table t1; diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test index 89b53b656d6..0fbef757e30 100644 --- a/mysql-test/suite/plugins/t/cracklib_password_check.test +++ b/mysql-test/suite/plugins/t/cracklib_password_check.test @@ -27,6 +27,14 @@ show warnings; grant select on *.* to foobar identified by 'qwerty'; show warnings; +--error ER_NOT_VALID_PASSWORD +grant select on *.* to foocar@localhost identified by 'localhost'; +show warnings; + +--error ER_NOT_VALID_PASSWORD +grant select on *.* to foocar@localhost identified by 'foocar@localhost'; +show warnings; + grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; diff --git a/mysql-test/suite/plugins/t/password_reuse_check.test b/mysql-test/suite/plugins/t/password_reuse_check.test new file mode 100644 index 00000000000..16ff21dc454 --- /dev/null +++ b/mysql-test/suite/plugins/t/password_reuse_check.test @@ -0,0 +1,100 @@ +--source include/not_embedded.inc + +if (!$PASSWORD_REUSE_CHECK_SO) { + skip No PASSWORD_REUSE_CHECK plugin; +} + +install soname "password_reuse_check"; + +set global password_reuse_check_interval= 0; + +--echo # Default value (sould be unlimited i.e. 0) +SHOW GLOBAL VARIABLES like "password_reuse_check%"; + +--echo # insert user +grant select on *.* to user_name@localhost identified by 'test_pwd'; + +--error ER_NOT_VALID_PASSWORD +grant select on *.* to user_name@localhost identified by 'test_pwd'; +show warnings; + +--error ER_CANNOT_USER +alter user user_name@localhost identified by 'test_pwd'; +show warnings; + +# Plugin does not work for it +#--error ER_NOT_VALID_PASSWORD +#SET PASSWORD FOR user_name@localhost = PASSWORD('test_pwd'); + +--echo # check exparation + +set global password_reuse_check_interval= 10; + +--error ER_CANNOT_USER +alter user user_name@localhost identified by 'test_pwd'; +show warnings; +select hex(hash) from mysql.password_reuse_check_history; + +--echo # emulate old password +update mysql.password_reuse_check_history set time= date_sub(now(), interval +11 day); + +alter user user_name@localhost identified by 'test_pwd'; +show warnings; + +drop user user_name@localhost; + +show create table mysql.password_reuse_check_history; +select count(*) from mysql.password_reuse_check_history; + +drop table mysql.password_reuse_check_history; + +--echo # test error messages + +set global password_reuse_check_interval= 0; + +drop table if exists mysql.password_reuse_check_history; + +--echo # test error messages + +create table mysql.password_reuse_check_history (wrong_structure int); + +--error ER_NOT_VALID_PASSWORD +grant select on *.* to user_name@localhost identified by 'test_pwd'; +show warnings; + +set global password_reuse_check_interval= 10; + +--error ER_NOT_VALID_PASSWORD +grant select on *.* to user_name@localhost identified by 'test_pwd'; +show warnings; + +drop table mysql.password_reuse_check_history; + +--echo # +--echo # MDEV-28838: password_reuse_check plugin mixes username and password +--echo # + +grant select on *.* to user_name@localhost identified by 'test_pwd'; + +grant select on *.* to user_nam@localhost identified by 'etest_pwd'; +show warnings; + +drop user user_name@localhost; +drop user user_nam@localhost; +drop table mysql.password_reuse_check_history; + +grant select on *.* to user_name@localhost identified by 'test_pwd'; + +grant select on *.* to tuser_name@localhos identified by 'test_pwd'; +show warnings; + +drop user user_name@localhost; +drop user tuser_name@localhos; + +--echo # +--echo # End of 10.7 tests +--echo # + +drop table mysql.password_reuse_check_history; +uninstall plugin password_reuse_check; diff --git a/mysql-test/suite/plugins/t/test_sql_service.test b/mysql-test/suite/plugins/t/test_sql_service.test index 9b9e29c6913..0a45cb663f4 100644 --- a/mysql-test/suite/plugins/t/test_sql_service.test +++ b/mysql-test/suite/plugins/t/test_sql_service.test @@ -1,4 +1,7 @@ --source include/not_embedded.inc +--source include/have_log_bin.inc + +reset master; # clear binlogs if (!$TEST_SQL_SERVICE_SO) { skip No TEST_SQL_SERVICE plugin; @@ -9,9 +12,72 @@ let count_sessions= 1; source include/wait_until_count_sessions.inc; install plugin test_sql_service soname 'test_sql_service'; +show status like 'test_sql_service_passed'; + +set global test_sql_service_execute_sql_global= 'create table test.t1 select 1 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_local= 'insert into test.t1 select 2 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=1'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 3 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET SQL_LOG_BIN=0'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 4 as a, @@SQL_LOG_BIN'; +set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=1'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 5 as a, @@sql_auto_is_null'; +set global test_sql_service_execute_sql_global= 'SET sql_auto_is_null=0'; +set global test_sql_service_execute_sql_global= 'insert into test.t1 select 6 as a, @@sql_auto_is_null'; +select * from t1 order by a; +drop table t1; +SET SQL_LOG_BIN=0; set global test_sql_service_run_test= 1; -show status like 'test_sql_service%'; +show status like 'test_sql_service_passed'; + +set global test_sql_service_execute_sql_local= 'create table test.t1(id int)'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_local= 'select * from test.t1'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_local= 'drop table test.t1'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_local= 'drop table test.t1'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_global= 'create table test.t1(id int)'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_global= 'select * from test.t1'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_global= 'drop table test.t1'; +show status like 'test_sql_query_result'; + +set global test_sql_service_execute_sql_global= 'drop table test.t1'; +show status like 'test_sql_query_result'; + +create table t1 (id int, time timestamp); +insert into t1 values (1, NULL), (2, NULL), (3, NULL), (4, NULL), (5, NULL); +set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)'; +show status like 'test_sql_query_result'; +set global test_sql_service_execute_sql_global= 'select * FROM test.t1 WHERE time <= NOW()'; +show status like 'test_sql_query_result'; +set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time < DATE_SUB(NOW(), interval 5 minute)'; +show status like 'test_sql_query_result'; +set global test_sql_service_execute_sql_local= 'select * FROM test.t1 WHERE time <= NOW()'; +show status like 'test_sql_query_result'; +drop table t1; uninstall plugin test_sql_service; +# Check that statements were executed/binlogged in correct order. +source include/show_binlog_events.inc; +# --replace_column 2 # 5 # +# --replace_regex /xid=[0-9]+/xid=XX/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ +# SHOW BINLOG EVENTS LIMIT 3,100; + |