diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-11 21:32:33 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-05-11 21:32:33 +0200 |
commit | db537a8372dea05ddfe10fbd5c317214658bfdbd (patch) | |
tree | 6b6c7408a5c2f48ee13fb7050625d7908113bdfa | |
parent | 6e99974d6edcdac99c56085a3ba8024670b0a07a (diff) | |
parent | 15502e5e3334077590faa1be61dd418264be8e91 (diff) | |
download | mariadb-git-db537a8372dea05ddfe10fbd5c317214658bfdbd.tar.gz |
Merge branch '10.4-release' into 10.4
103 files changed, 2072 insertions, 706 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 50257e5c7cf..d930b593479 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,8 +242,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN) ENDIF() INCLUDE(wsrep) -INCLUDE(cpack_rpm) -INCLUDE(cpack_deb) OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_EXIT()" ON) IF(WITH_DBUG_TRACE) @@ -369,8 +367,6 @@ MYSQL_CHECK_SSL() MYSQL_CHECK_READLINE() SET(MALLOC_LIBRARY "system") -SET(PYTHON_SHEBANG "/usr/bin/env python" CACHE STRING "python shebang") -MARK_AS_ADVANCED(PYTHON_SHEBANG) CHECK_PCRE() @@ -407,6 +403,12 @@ SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "") INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb) +INCLUDE(cpack_rpm) +INCLUDE(cpack_deb) + +SET(PYTHON_SHEBANG "/usr/bin/env python" CACHE STRING "python shebang") +MARK_AS_ADVANCED(PYTHON_SHEBANG) + # Add storage engines and plugins. CONFIGURE_PLUGINS() diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 1dad91e05a5..be0252e36a4 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -114,12 +114,16 @@ SET(ignored "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d" + "%ignore ${CMAKE_INSTALL_PREFIX}/lib/sysusers.d" "%ignore ${CMAKE_INSTALL_PREFIX}/lib64" + "%ignore ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig" "%ignore ${CMAKE_INSTALL_PREFIX}/sbin" "%ignore ${CMAKE_INSTALL_PREFIX}/share" "%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal" "%ignore ${CMAKE_INSTALL_PREFIX}/share/doc" "%ignore ${CMAKE_INSTALL_PREFIX}/share/man" + "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1" + "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8" "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*" "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*" "%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig" @@ -192,9 +196,10 @@ SET(CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/ SET(CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh) MACRO(ALTERNATIVE_NAME real alt) - SET(ver "%{version}-%{release}") - IF (${epoch}) - SET(ver "${epoch}:${ver}") + IF(${ARGC} GREATER 2) + SET(ver ${ARGV2}) + ELSE() + SET(ver "${epoch}%{version}-%{release}") ENDIF() SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES") @@ -209,17 +214,40 @@ ALTERNATIVE_NAME("test" "mysql-test") # Argh! Different distributions call packages differently, to be a drop-in # replacement we have to fake distribution-specific dependencies +# NOTE, use ALTERNATIVE_NAME when a package has a different name +# in some distribution, it's not for adding new PROVIDES IF(RPM MATCHES "(rhel|centos)6") ALTERNATIVE_NAME("client" "mysql") ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7") - SET(epoch 1) # this is fedora + SET(epoch 1:) # this is fedora ALTERNATIVE_NAME("client" "mariadb") ALTERNATIVE_NAME("client" "mysql") ALTERNATIVE_NAME("devel" "mariadb-devel") ALTERNATIVE_NAME("server" "mariadb-server") ALTERNATIVE_NAME("server" "mysql-compat-server") ALTERNATIVE_NAME("test" "mariadb-test") +ELSEIF(RPM MATCHES "(rhel|centos)8") + SET(epoch 3:) + ALTERNATIVE_NAME("backup" "mariadb-backup") + ALTERNATIVE_NAME("client" "mariadb") + ALTERNATIVE_NAME("common" "mariadb-common") + ALTERNATIVE_NAME("common" "mariadb-errmsg") + ALTERNATIVE_NAME("server" "mariadb-server") + ALTERNATIVE_NAME("server" "mariadb-server-utils") + ALTERNATIVE_NAME("shared" "mariadb-connector-c" ${MARIADB_CONNECTOR_C_VERSION}-1) + ALTERNATIVE_NAME("shared" "mariadb-connector-c-config" ${MARIADB_CONNECTOR_C_VERSION}-1) + SETA(CPACK_RPM_client_PACKAGE_PROVIDES "mariadb-galera = 3:%{version}-%{release}") + SETA(CPACK_RPM_common_PACKAGE_PROVIDES "mariadb-galera-common = 3:%{version}-%{release}") + SETA(CPACK_RPM_common_PACKAGE_REQUIRES "MariaDB-shared") +ELSEIF(RPM MATCHES "sles") + ALTERNATIVE_NAME("server" "mariadb") + SETA(CPACK_RPM_server_PACKAGE_PROVIDES + "mysql = %{version}-%{release}" + "mariadb_${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}" + "mariadb-${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}" + "mariadb-server = %{version}-%{release}" + ) ENDIF() IF(RPM MATCHES "fedora31" OR RPM MATCHES "(rhel|centos)8") SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang") diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake index 4fb4be44831..1ec62c6f6b2 100644 --- a/cmake/mariadb_connector_c.cmake +++ b/cmake/mariadb_connector_c.cmake @@ -42,3 +42,6 @@ ADD_SUBDIRECTORY(libmariadb) IF(TARGET caching_sha2_password AND CMAKE_C_FLAGS_DEBUG MATCHES "-Werror") SET_PROPERTY(TARGET caching_sha2_password APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-unused-function) ENDIF() + +GET_DIRECTORY_PROPERTY(MARIADB_CONNECTOR_C_VERSION DIRECTORY libmariadb DEFINITION CPACK_PACKAGE_VERSION) +MESSAGE1(MARIADB_CONNECTOR_C_VERSION "MariaDB Connector/C ${MARIADB_CONNECTOR_C_VERSION}") diff --git a/extra/wolfssl/user_settings.h.in b/extra/wolfssl/user_settings.h.in index 65be4542b08..98f05079e05 100644 --- a/extra/wolfssl/user_settings.h.in +++ b/extra/wolfssl/user_settings.h.in @@ -20,14 +20,19 @@ #define WOLFSSL_AES_COUNTER #define NO_WOLFSSL_STUB #define OPENSSL_ALL -#define WOLFSSL_ALLOW_TLSV10 +#undef WOLFSSL_ALLOW_TLSV10 /* see https://github.com/wolfSSL/wolfssl/issues/2960 */ +#define NO_OLD_TIMEVAL_NAME +/* + FP_MAX_BITS is set high solely to satisfy ssl_8k_key.test + WolfSSL will use more stack space with it, with fastmath +*/ +#define FP_MAX_BITS 16384 #cmakedefine WOLFSSL_AESNI #cmakedefine USE_FAST_MATH #cmakedefine TFM_TIMING_RESISTANT #cmakedefine HAVE_INTEL_RDSEED #cmakedefine USE_INTEL_SPEEDUP -#cmakedefine FP_MAX_BITS @FP_MAX_BITS@ #cmakedefine USE_FAST_MATH #cmakedefine WOLFSSL_X86_64_BUILD diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl -Subproject 3f13b49fa318fbd3216d7da36d942e7c276d341 +Subproject e116c89a58af750421d82ece13f80516d2bde02 diff --git a/include/my_compare.h b/include/my_compare.h index 6568e5f2f27..9ae6c9582fb 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -127,31 +127,32 @@ extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a); #endif /** - Return values of index_cond_func_xxx functions. - - 0=ICP_NO_MATCH - index tuple doesn't satisfy the pushed index condition (the - engine should discard the tuple and go to the next one) - 1=ICP_MATCH - index tuple satisfies the pushed index condition (the - engine should fetch and return the record) - 2=ICP_OUT_OF_RANGE - index tuple is out range that we're scanning, e.g. this - if we're scanning "t.key BETWEEN 10 AND 20" and got a - "t.key=21" tuple (the engine should stop scanning and - return HA_ERR_END_OF_FILE right away). - 3=ICP_ABORTED_BY_USER - engine must stop scanning and should return - HA_ERR_ABORTED_BY_USER right away - -1= ICP_ERROR - Reserved for internal errors in engines. Should not be - returned by index_cond_func_xxx + Return values for pushed index condition or rowid filter check functions. + + 0=CHECK_NEG - The filter is not satisfied. The engine should discard this + index tuple and continue the scan. + 1=CHECK_POS - The filter is statisfied. Current index tuple should be + returned to the SQL layer. + 2=CHECK_OUT_OF_RANGE - the index tuple is outside of the range that we're + scanning. (Example: if we're scanning "t.key BETWEEN 10 AND + 20" and got a "t.key=21" tuple) Tthe engine should stop + scanning and return HA_ERR_END_OF_FILE right away). + 3=CHECK_ABORTED_BY_USER - the engine must stop scanning and should return + HA_ERR_ABORTED_BY_USER right away + -1=CHECK_ERROR - Reserved for internal errors in engines. Should not be + returned by ICP or rowid filter check functions. */ -typedef enum icp_result { - ICP_ERROR=-1, - ICP_NO_MATCH=0, - ICP_MATCH=1, - ICP_OUT_OF_RANGE=2, - ICP_ABORTED_BY_USER=3 -} ICP_RESULT; - -typedef ICP_RESULT (*index_cond_func_t)(void *param); -typedef int (*rowid_filter_func_t)(void *param); +typedef enum check_result { + CHECK_ERROR=-1, + CHECK_NEG=0, + CHECK_POS=1, + CHECK_OUT_OF_RANGE=2, + CHECK_ABORTED_BY_USER=3 +} check_result_t; + +typedef check_result_t (*index_cond_func_t)(void *param); +typedef check_result_t (*rowid_filter_func_t)(void *param); +typedef int (*rowid_filter_is_active_func_t)(void *param); #endif /* _my_compare_h */ diff --git a/include/mysql/service_my_crypt.h b/include/mysql/service_my_crypt.h index 039125066ca..930d12a7dd1 100644 --- a/include/mysql/service_my_crypt.h +++ b/include/mysql/service_my_crypt.h @@ -45,7 +45,7 @@ extern "C" { /* The max key length of all supported algorithms */ #define MY_AES_MAX_KEY_LENGTH 32 -#define MY_AES_CTX_SIZE 600 +#define MY_AES_CTX_SIZE 640 enum my_aes_mode { MY_AES_ECB, MY_AES_CBC diff --git a/include/ssl_compat.h b/include/ssl_compat.h index cff5f7ef3de..8cc0e6a9a2b 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -81,8 +81,8 @@ #ifndef HAVE_WOLFSSL #define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X) -#endif #define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X) +#endif #define X509_get0_notBefore(X) X509_get_notBefore(X) #define X509_get0_notAfter(X) X509_get_notAfter(X) #endif diff --git a/include/violite.h b/include/violite.h index 3a163d45976..34f59f2e598 100644 --- a/include/violite.h +++ b/include/violite.h @@ -146,9 +146,9 @@ int vio_getnameinfo(const struct sockaddr *sa, /* Set yaSSL to use same type as MySQL do for socket handles */ typedef my_socket YASSL_SOCKET_T; #define YASSL_SOCKET_T_DEFINED -#define Timeval WOLFSSL_Timeval +#define template _template /* bug in WolfSSL 4.4.0, see also my_crypt.cc */ #include <openssl/ssl.h> -#undef Timeval +#undef template #include <openssl/err.h> #ifdef DEPRECATED #undef DEPRECATED diff --git a/libmariadb b/libmariadb -Subproject ca8f94f727dba19a6ac43691df53fdc829e2124 +Subproject 2759b87d72926b7c9b5426437a7c8dd15ff5794 diff --git a/mysql-test/lib/openssl.cnf b/mysql-test/lib/openssl.cnf new file mode 100644 index 00000000000..b9ab37ac3a1 --- /dev/null +++ b/mysql-test/lib/openssl.cnf @@ -0,0 +1,12 @@ +# Toplevel section for openssl (including libssl) +openssl_conf = default_conf_section + +[default_conf_section] +# We only specify configuration for the "ssl module" +ssl_conf = ssl_section + +[ssl_section] +system_default = system_default_section + +[system_default_section] +CipherString = ALL:@SECLEVEL=1 diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index 51414d0c196..111b4c8ae50 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -229,7 +229,7 @@ INSERT INTO t1 VALUES (1),(2); EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE global_priv index NULL PRIMARY 420 NULL 4 Using index +1 SIMPLE global_priv index NULL PRIMARY 420 NULL 5 Using index DROP TABLE t1; DROP VIEW v1; # diff --git a/mysql-test/main/failed_auth_3909.result b/mysql-test/main/failed_auth_3909.result index 19951415585..55869974301 100644 --- a/mysql-test/main/failed_auth_3909.result +++ b/mysql-test/main/failed_auth_3909.result @@ -4,14 +4,14 @@ create user baz identified via mysql_old_password; connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET); connect fail,localhost,u1; ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO) -connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET); -connect fail,localhost,u2; -ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format -connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET); -connect fail,localhost,u2,password; -ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format +connect(localhost,uu2,,test,MASTER_PORT,MASTER_SOCKET); +connect fail,localhost,uu2; +ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format +connect(localhost,uu2,password,test,MASTER_PORT,MASTER_SOCKET); +connect fail,localhost,uu2,password; +ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO) -ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format -ERROR HY000: Server is running in --secure-auth mode, but 'u2'@'localhost' has a password in the old format; please change the password to the new format +ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format +ERROR HY000: Server is running in --secure-auth mode, but 'uu2'@'localhost' has a password in the old format; please change the password to the new format delete from mysql.user where plugin = 'mysql_old_password'; flush privileges; diff --git a/mysql-test/main/failed_auth_3909.test b/mysql-test/main/failed_auth_3909.test index 25e45e49a0e..af65f46cfa2 100644 --- a/mysql-test/main/failed_auth_3909.test +++ b/mysql-test/main/failed_auth_3909.test @@ -16,20 +16,20 @@ connect (fail,localhost,u1); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_SERVER_IS_IN_SECURE_AUTH_MODE -connect (fail,localhost,u2); +connect (fail,localhost,uu2); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_SERVER_IS_IN_SECURE_AUTH_MODE -connect (fail,localhost,u2,password); +connect (fail,localhost,uu2,password); --error ER_ACCESS_DENIED_ERROR change_user u1; --error ER_SERVER_IS_IN_SECURE_AUTH_MODE -change_user u2; +change_user uu2; --error ER_SERVER_IS_IN_SECURE_AUTH_MODE -change_user u2,password; +change_user uu2,password; delete from mysql.user where plugin = 'mysql_old_password'; flush privileges; diff --git a/mysql-test/main/failed_auth_unixsocket.result b/mysql-test/main/failed_auth_unixsocket.result index 98057c02b74..32357a5a7a9 100644 --- a/mysql-test/main/failed_auth_unixsocket.result +++ b/mysql-test/main/failed_auth_unixsocket.result @@ -1,7 +1,7 @@ -update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket'); +update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root'; flush privileges; connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'USER'@'localhost' ERROR 28000: Access denied for user 'USER'@'localhost' -update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')); +update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root'; flush privileges; diff --git a/mysql-test/main/failed_auth_unixsocket.test b/mysql-test/main/failed_auth_unixsocket.test index 0dcc050a463..e163a0c230f 100644 --- a/mysql-test/main/failed_auth_unixsocket.test +++ b/mysql-test/main/failed_auth_unixsocket.test @@ -4,7 +4,7 @@ # MDEV-3909 remote user enumeration # unix_socket tests # -update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket'); +update mysql.global_priv set priv=json_insert(priv, '$.plugin', 'unix_socket') where user='root'; flush privileges; # Make sure that the replace works, even if $USER is 'user' or something else @@ -22,5 +22,5 @@ connect (fail,localhost,$USER); --error ER_ACCESS_DENIED_NO_PASSWORD_ERROR change_user $USER; -update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')); +update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin')) where user='root'; flush privileges; diff --git a/mysql-test/main/gis_notembedded.result b/mysql-test/main/gis_notembedded.result index 64e90572bf0..99fe8d656a1 100644 --- a/mysql-test/main/gis_notembedded.result +++ b/mysql-test/main/gis_notembedded.result @@ -1,13 +1,13 @@ show create procedure mysql.AddGeometryColumn; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -AddGeometryColumn CREATE DEFINER=`root`@`localhost` PROCEDURE `AddGeometryColumn`(catalog varchar(64), t_schema varchar(64), +AddGeometryColumn CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE `AddGeometryColumn`(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER begin set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end latin1 latin1_swedish_ci latin1_swedish_ci show create procedure mysql.DropGeometryColumn; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -DropGeometryColumn CREATE DEFINER=`root`@`localhost` PROCEDURE `DropGeometryColumn`(catalog varchar(64), t_schema varchar(64), +DropGeometryColumn CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE `DropGeometryColumn`(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER begin diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result index 3d2313e8c9b..8a2ea3c26ec 100644 --- a/mysql-test/main/grant.result +++ b/mysql-test/main/grant.result @@ -656,9 +656,9 @@ GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost; GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost -GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost` +GRANT USAGE ON *.* TO `dummy`@`localhost` use INFORMATION_SCHEMA; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE @@ -669,9 +669,9 @@ mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DELETE HISTORY, DROP, IN FLUSH PRIVILEGES; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost -GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT ALL PRIVILEGES ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost` +GRANT USAGE ON *.* TO `dummy`@`localhost` SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; @@ -700,9 +700,9 @@ GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost; GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost -GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` +GRANT USAGE ON *.* TO `dummy`@`localhost` use INFORMATION_SCHEMA; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE @@ -713,9 +713,9 @@ mysqltest dummyview CREATE VIEW FLUSH PRIVILEGES; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost -GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT CREATE VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` +GRANT USAGE ON *.* TO `dummy`@`localhost` SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; @@ -735,8 +735,8 @@ GRANT SHOW VIEW ON mysqltest.dummyview TO dummy@localhost; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` use INFORMATION_SCHEMA; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE @@ -748,8 +748,8 @@ FLUSH PRIVILEGES; SHOW GRANTS FOR dummy@localhost; Grants for dummy@localhost GRANT USAGE ON *.* TO `dummy`@`localhost` -GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` GRANT SHOW VIEW ON `mysqltest`.`dummytable` TO `dummy`@`localhost` +GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost` SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; @@ -967,6 +967,9 @@ GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%` select * from information_schema.table_privileges; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE 'mysqltest_8'@'%' def test t1 UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv SELECT NO +'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv DELETE NO connect conn5,localhost,mysqltest_8,,; select * from t1; a @@ -981,6 +984,9 @@ Grants for mysqltest_8@% GRANT USAGE ON *.* TO `mysqltest_8`@`%` select * from information_schema.table_privileges; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE +'mariadb.sys'@'localhost' def mysql global_priv SELECT NO +'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv DELETE NO flush privileges; show grants for mysqltest_8@''; Grants for mysqltest_8@% diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test index 47a274d75d1..7dedf820774 100644 --- a/mysql-test/main/grant.test +++ b/mysql-test/main/grant.test @@ -440,12 +440,14 @@ CREATE TABLE mysqltest.dummytable (dummyfield INT); CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable; GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost; GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost; +--sorted_result SHOW GRANTS FOR dummy@localhost; use INFORMATION_SCHEMA; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; FLUSH PRIVILEGES; +--sorted_result SHOW GRANTS FOR dummy@localhost; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE @@ -462,12 +464,14 @@ CREATE TABLE mysqltest.dummytable (dummyfield INT); CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable; GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost; GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost; +--sorted_result SHOW GRANTS FOR dummy@localhost; use INFORMATION_SCHEMA; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; FLUSH PRIVILEGES; +--sorted_result SHOW GRANTS FOR dummy@localhost; SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result index d238d261006..0eb8dee026e 100644 --- a/mysql-test/main/grant2.result +++ b/mysql-test/main/grant2.result @@ -557,7 +557,7 @@ GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose'; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; User Host Password plugin authentication_string Insert_priv root localhost *0BB7188CF0DE9B403BA66E9DD810D82652D002EB mysql_native_password *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y -UPDATE global_priv SET priv=@root_priv; +UPDATE global_priv SET priv=@root_priv where user='root' and host='localhost'; FLUSH PRIVILEGES; USE test; End of 5.1 tests diff --git a/mysql-test/main/grant2.test b/mysql-test/main/grant2.test index b33d7d63992..f98af8d8630 100644 --- a/mysql-test/main/grant2.test +++ b/mysql-test/main/grant2.test @@ -669,7 +669,7 @@ SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHE GRANT INSERT ON *.* TO CURRENT_USER() IDENTIFIED BY 'keksdose'; SELECT user,host,password,plugin,authentication_string,insert_priv FROM user WHERE user=@u AND host=@h; -UPDATE global_priv SET priv=@root_priv; +UPDATE global_priv SET priv=@root_priv where user='root' and host='localhost'; FLUSH PRIVILEGES; USE test; diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index e69a24e5422..43e15abb7ee 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -565,7 +565,7 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION; create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION; select * from information_schema.views; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM -def mysql user select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED +def mysql user select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` NONE YES mariadb.sys@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED @@ -575,6 +575,9 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN 'joe'@'localhost' def test t1 a SELECT YES select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE +'mariadb.sys'@'localhost' def mysql global_priv SELECT NO +'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv DELETE NO drop view v1, v2, v3; drop table t1; delete from mysql.user where user='joe'; diff --git a/mysql-test/main/lowercase_fs_off.test b/mysql-test/main/lowercase_fs_off.test index 7c5811f9cc3..f828773ed06 100644 --- a/mysql-test/main/lowercase_fs_off.test +++ b/mysql-test/main/lowercase_fs_off.test @@ -48,6 +48,7 @@ select * from T1; connection default; GRANT SELECT ON t1 to user_1@localhost; connection con1; +--sorted_result select * from information_schema.table_privileges; connection default; disconnect con1; diff --git a/mysql-test/main/mysql_upgrade-6984.result b/mysql-test/main/mysql_upgrade-6984.result index ad48004a2a3..120f7cf733c 100644 --- a/mysql-test/main/mysql_upgrade-6984.result +++ b/mysql-test/main/mysql_upgrade-6984.result @@ -1,4 +1,4 @@ -update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')); +update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root'; Phase 1/7: Checking and upgrading mysql database Processing databases mysql @@ -63,6 +63,6 @@ test Phase 7/7: Running 'FLUSH PRIVILEGES' OK connect con1,localhost,root,foo,,,; -update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')); +update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')) where user='root'; flush privileges; set global event_scheduler=OFF; diff --git a/mysql-test/main/mysql_upgrade-6984.test b/mysql-test/main/mysql_upgrade-6984.test index ad2b95314b0..01bdc15c64b 100644 --- a/mysql-test/main/mysql_upgrade-6984.test +++ b/mysql-test/main/mysql_upgrade-6984.test @@ -11,13 +11,13 @@ # In this setup MYSQL_UPGRADE cannot continue after issuing FLUSH PRIVILEGES # -update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')); +update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root'; --exec $MYSQL_UPGRADE connect(con1,localhost,root,foo,,,); -update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')); +update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')) where user='root'; flush privileges; # Load event table set global event_scheduler=OFF; diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index 33c3d1b8198..7be0be6ccc3 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -639,7 +639,7 @@ alter table mysql.user change authentication_string auth_string text collate utf # mysql_upgrade --force --silent 2>&1 select count(*) from mysql.global_priv; count(*) -4 +5 drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; # End of 10.4 tests diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result index df966ae1d39..1b1db09d61d 100644 --- a/mysql-test/main/mysqltest_tracking_info.result +++ b/mysql-test/main/mysqltest_tracking_info.result @@ -1,3 +1,4 @@ +set @save_session_track_system_variables=@@session_track_system_variables; SELECT @@session.character_set_connection; @@session.character_set_connection latin1 @@ -28,4 +29,19 @@ SET NAMES 'utf8'; # tracking info off once SET NAMES 'big5'; -SET @@session.session_track_system_variables= default; +SET @@session.session_track_system_variables= @save_session_track_system_variables; +# +# MDEV-22504: session tracking return incorrectly long traking data +# +set @save_optimizer_switch=@@optimizer_switch; +SET @@session.session_track_system_variables='optimizer_switch'; +set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off'; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- optimizer_switch +-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on + +Warnings: +Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release +set @@optimizer_switch=@save_optimizer_switch; +SET @@session.session_track_system_variables= @save_session_track_system_variables; +# End of 10.2 tests diff --git a/mysql-test/main/mysqltest_tracking_info.test b/mysql-test/main/mysqltest_tracking_info.test index d31f68b3cbd..da7732b5011 100644 --- a/mysql-test/main/mysqltest_tracking_info.test +++ b/mysql-test/main/mysqltest_tracking_info.test @@ -2,6 +2,9 @@ --source include/no_protocol.inc --source include/not_embedded.inc + +set @save_session_track_system_variables=@@session_track_system_variables; + SELECT @@session.character_set_connection; SET @@session.session_track_system_variables='character_set_connection'; @@ -22,4 +25,23 @@ SET NAMES 'utf8'; SET NAMES 'big5'; --disable_session_track_info -SET @@session.session_track_system_variables= default; +SET @@session.session_track_system_variables= @save_session_track_system_variables; + +--echo # +--echo # MDEV-22504: session tracking return incorrectly long traking data +--echo # + +set @save_optimizer_switch=@@optimizer_switch; + +SET @@session.session_track_system_variables='optimizer_switch'; + +--enable_session_track_info +set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off'; +--disable_session_track_info + +set @@optimizer_switch=@save_optimizer_switch; + + +SET @@session.session_track_system_variables= @save_session_track_system_variables; + +--echo # End of 10.2 tests diff --git a/mysql-test/main/plugin_auth_qa.result b/mysql-test/main/plugin_auth_qa.result index e00ac1a4c96..e3158618b7d 100644 --- a/mysql-test/main/plugin_auth_qa.result +++ b/mysql-test/main/plugin_auth_qa.result @@ -2,37 +2,44 @@ set sql_mode=""; CREATE DATABASE test_user_db; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password ========== test 1.1 ====================================================== CREATE USER plug IDENTIFIED WITH test_plugin_server; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; DROP USER plug; CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; DROP USER plug; CREATE USER plug IDENTIFIED WITH test_plugin_server AS ''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS ''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; DROP USER plug; @@ -101,61 +108,73 @@ CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; ========== test 1.1.1.6/1.1.2.5 ============================ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug, plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plug_dest DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -171,10 +190,12 @@ DROP USER plug; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password plug test_plugin_server plug_dest GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password plug mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; @@ -185,17 +206,20 @@ CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password plug test_plugin_server plug_dest plug_dest test_plugin_server plug_dest DROP USER plug,plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password plug test_plugin_server plug_dest GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password plug test_plugin_server plug_dest plug_dest test_plugin_server plug_dest DROP USER plug,plug_dest; @@ -204,22 +228,26 @@ SET NAMES utf8; CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg test_plugin_server plüg_dest DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password pl??g test_plugin_server pl??g_dest DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password pl??g_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER 'plüg_dest'; SET NAMES latin1; @@ -229,11 +257,13 @@ ERROR HY000: Plugin 'test_plügin_server' is not loaded CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server plüg_dest DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER 'plüg_dest'; SET NAMES utf8; @@ -242,21 +272,25 @@ ERROR HY000: Plugin 'test_plügin_server' is not loaded CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg test_plugin_server plüg_dest DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg test_plugin_server plüg_dest DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 DROP USER plüg_dest; ========== test 1.1.1.2/1.1.2.2============================= @@ -272,12 +306,14 @@ ERROR HY000: Plugin 'hh's_test_plugin_server' is not loaded CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug test_plugin_server hh's_plug_dest DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string hh's_plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 +mariadb.sys mysql_native_password DROP USER 'hh''s_plug_dest'; ========== test 1.1.1.4 ==================================== CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; @@ -287,12 +323,14 @@ GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password CREATE USER plug_dest; DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password plug_dest mysql_native_password DROP USER grant_user,plug_dest; set @save_sql_mode= @@sql_mode; @@ -301,6 +339,7 @@ GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password CREATE USER plug_dest; DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; @@ -310,16 +349,19 @@ GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password grant_user test_plugin_server plug_dest +mariadb.sys mysql_native_password plug_dest mysql_native_password *560881EB651416CEF77314D07D55EDCD5FC1BD6D *560881EB651416CEF77314D07D55EDCD5FC1BD6D DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; diff --git a/mysql-test/main/plugin_auth_qa_1.result b/mysql-test/main/plugin_auth_qa_1.result index 261767d4cd2..24c86f1e2a8 100644 --- a/mysql-test/main/plugin_auth_qa_1.result +++ b/mysql-test/main/plugin_auth_qa_1.result @@ -1,6 +1,7 @@ CREATE DATABASE test_user_db; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password ========== test 1.1.3.2 ==================================== CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; @@ -23,6 +24,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas GRANT PROXY ON plug_dest TO plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_user test_plugin_server plug_dest 1) @@ -74,6 +76,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; @@ -92,6 +95,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; @@ -113,6 +117,7 @@ new_user@localhost plug_dest@% connection default; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_user test_plugin_server plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 disconnect plug_user; @@ -120,6 +125,7 @@ UPDATE mysql.global_priv SET user='plug_user' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_user test_plugin_server plug_dest DROP USER plug_dest,plug_user; @@ -136,24 +142,28 @@ connection default; disconnect plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_user test_plugin_server plug_dest UPDATE mysql.global_priv SET user='new_user' WHERE user='plug_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_user test_plugin_server plug_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.authentication_string', 'new_dest') WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_user test_plugin_server new_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.plugin', 'new_plugin_server') WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_user new_plugin_server new_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 ERROR HY000: Plugin 'new_plugin_server' is not loaded @@ -163,6 +173,7 @@ FLUSH PRIVILEGES; GRANT PROXY ON new_dest TO new_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 new_user test_plugin_server new_dest connect plug_user,localhost,new_user,new_dest; @@ -176,6 +187,7 @@ FLUSH PRIVILEGES; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password new_dest mysql_native_password *01422E86A6FFF84618914AF149F9AEF64B84170A new_user test_plugin_server new_dest plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 @@ -193,6 +205,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string test_plugin_server proxied_user +mariadb.sys mysql_native_password proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD connect proxy_con,localhost,proxied_user,proxied_user_passwd; SELECT USER(),CURRENT_USER(); @@ -229,6 +242,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string test_plugin_server proxied_user +mariadb.sys mysql_native_password proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD connect proxy_con,localhost,proxied_user,proxied_user_passwd; SELECT USER(),CURRENT_USER(); @@ -271,6 +285,7 @@ GRANT PROXY ON proxied_user_5 TO ''@'%%'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string test_plugin_server proxied_user +mariadb.sys mysql_native_password proxied_user_1 mysql_native_password *551D5A5177FCC3340F7D2FB0F4D8D1EEA7F7EF71 proxied_user_2 mysql_native_password *3D948F77C6A988AFDCA9755AB2A6724362557220 proxied_user_3 mysql_native_password *41A18925D237DEE738C76581153990B037F462E3 diff --git a/mysql-test/main/plugin_auth_qa_2.result b/mysql-test/main/plugin_auth_qa_2.result index e71132e2bc9..ea7227f9faa 100644 --- a/mysql-test/main/plugin_auth_qa_2.result +++ b/mysql-test/main/plugin_auth_qa_2.result @@ -7,6 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_1_user qa_auth_interface qa_test_1_dest SELECT @@proxy_user; @@ -20,6 +21,7 @@ current_user() user() @@local.proxy_user @@local.external_user qa_test_1_user@% qa_test_1_user@localhost NULL NULL SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_1_user qa_auth_interface qa_test_1_dest DROP USER qa_test_1_user; @@ -34,6 +36,7 @@ GRANT PROXY ON authenticated_as TO qa_test_2_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +mariadb.sys mysql_native_password qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_2_user qa_auth_interface qa_test_2_dest SELECT @@proxy_user; @@ -48,6 +51,7 @@ authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' externaluser SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +mariadb.sys mysql_native_password qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_2_user qa_auth_interface qa_test_2_dest DROP USER qa_test_2_user; @@ -84,6 +88,7 @@ GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +mariadb.sys mysql_native_password qa_test_5_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_user qa_auth_interface qa_test_5_dest exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 @@ -98,6 +103,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 @@ -105,6 +111,7 @@ ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using p GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 @@ -112,6 +119,7 @@ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y REVOKE PROXY ON qa_test_6_dest FROM root; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; User plugin authentication_string +mariadb.sys mysql_native_password qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 @@ -121,6 +129,7 @@ DROP USER qa_test_6_dest; DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; User plugin authentication_string Password +mariadb.sys mysql_native_password === Test of the --default_auth option for clients ==== CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest'; CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; diff --git a/mysql-test/main/processlist_notembedded.result b/mysql-test/main/processlist_notembedded.result index 67eeb5ae2ff..e663c407a1b 100644 --- a/mysql-test/main/processlist_notembedded.result +++ b/mysql-test/main/processlist_notembedded.result @@ -3,10 +3,11 @@ # connect con1,localhost,root,,; connection con1; -SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync'; +SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; connection default; SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; -FOUND 1 /sleep \(30\)/ in MDEV-20466.text +FOUND 1 /sleep/ in MDEV-20466.text +SET DEBUG_SYNC= 'now SIGNAL go'; disconnect con1; SET DEBUG_SYNC = 'RESET'; End of 5.5 tests diff --git a/mysql-test/main/processlist_notembedded.test b/mysql-test/main/processlist_notembedded.test index 2dc6a0539ab..4979e40a85a 100644 --- a/mysql-test/main/processlist_notembedded.test +++ b/mysql-test/main/processlist_notembedded.test @@ -1,6 +1,7 @@ source include/have_debug.inc; source include/have_debug_sync.inc; source include/not_embedded.inc; +source include/count_sessions.inc; --echo # --echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes @@ -10,9 +11,9 @@ connect (con1,localhost,root,,); connection con1; -let $q= `select CONCAT("SELECT user FROM mysql.user WHERE user ='some", CHAR(0), "' or sleep (30)")`; +let $q= `select CONCAT("SELECT user FROM mysql.user WHERE user ='some", CHAR(0), "sleep'")`; -SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync'; +SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; --disable_query_log --send_eval $q; --enable_query_log @@ -23,12 +24,16 @@ SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; exec $MYSQL test -e "SHOW PROCESSLIST" > $MYSQLTEST_VARDIR/tmp/MDEV-20466.text; let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/MDEV-20466.text; -let SEARCH_PATTERN=sleep \(30\); +let SEARCH_PATTERN=sleep; source include/search_pattern_in_file.inc; remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20466.text; +SET DEBUG_SYNC= 'now SIGNAL go'; + disconnect con1; SET DEBUG_SYNC = 'RESET'; +source include/wait_until_count_sessions.inc; + --echo End of 5.5 tests diff --git a/mysql-test/main/ps_grant.result b/mysql-test/main/ps_grant.result index ab21c198b98..c9ef089b215 100644 --- a/mysql-test/main/ps_grant.result +++ b/mysql-test/main/ps_grant.result @@ -11,8 +11,8 @@ grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' connect con3,localhost,second_user,looser,mysqltest; connection con3; select current_user(); @@ -34,21 +34,21 @@ grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost` +GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' drop table mysqltest.t9 ; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost` +GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' connection con3; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` GRANT SELECT ON `mysqltest`.`t1` TO `second_user`@`localhost` +GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' prepare s_t1 from 'select a as my_col from t1' ; execute s_t1 ; my_col @@ -63,13 +63,13 @@ connection default; revoke all privileges on mysqltest.t1 from second_user@localhost; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' connection con3; show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' GRANT SELECT ON `mysqltest`.`t9` TO `second_user`@`localhost` +GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' execute s_t1 ; ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' connection default; diff --git a/mysql-test/main/ps_grant.test b/mysql-test/main/ps_grant.test index 3d59cc36de0..80a458bf874 100644 --- a/mysql-test/main/ps_grant.test +++ b/mysql-test/main/ps_grant.test @@ -40,6 +40,7 @@ grant usage on mysqltest.* to second_user@localhost identified by 'looser' ; grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; +--sorted_result show grants for second_user@localhost ; @@ -64,8 +65,10 @@ select a as my_col from t1; connection default; grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; +--sorted_result show grants for second_user@localhost ; drop table mysqltest.t9 ; +--sorted_result show grants for second_user@localhost ; @@ -73,6 +76,7 @@ show grants for second_user@localhost ; ## switch to the second session connection con3; ######## Question 1: The table t1 should be now accessible. ######## +--sorted_result show grants for second_user@localhost ; prepare s_t1 from 'select a as my_col from t1' ; execute s_t1 ; @@ -86,11 +90,13 @@ deallocate prepare s_t9; ## switch back to the first session connection default; revoke all privileges on mysqltest.t1 from second_user@localhost; +--sorted_result show grants for second_user@localhost ; #### check the access as new user ## switch to the second session connection con3; +--sorted_result show grants for second_user@localhost ; ######## Question 2: The table t1 should be now not accessible. ######## --error 1142 @@ -103,6 +109,7 @@ connection default; disconnect con3 ; ## remove all rights of second_user@localhost revoke all privileges, grant option from second_user@localhost ; +--sorted_result show grants for second_user@localhost ; drop user second_user@localhost ; commit ; diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index 430e4d8f7ea..a5223666fb4 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -54,6 +54,17 @@ orders CREATE TABLE `orders` ( KEY `i_o_totalprice` (`o_totalprice`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 set optimizer_use_condition_selectivity=2; +select +100 * +(select count(*) from lineitem +WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 +) +/ +(select count(*) from lineitem +where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30') +as correct_r_filtered_when_using_l_shipdate; +correct_r_filtered_when_using_l_shipdate +11.7647 set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; @@ -92,7 +103,7 @@ set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (3%) 11.69 100.00 Using index condition; Using where; Using rowid filter +1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (11%) 11.69 100.00 Using index condition; Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; @@ -117,7 +128,7 @@ ANALYZE "rows": 702, "selectivity_pct": 11.69, "r_rows": 605, - "r_selectivity_pct": 3.6855, + "r_selectivity_pct": 11.765, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, @@ -641,7 +652,7 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (3%) 11.69 100.00 Using index condition; Using where; Using rowid filter +1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (11%) 11.69 100.00 Using index condition; Using where; Using rowid filter 1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) 0.27 (25%) 9.27 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey @@ -675,7 +686,7 @@ ANALYZE "rows": 702, "selectivity_pct": 11.69, "r_rows": 605, - "r_selectivity_pct": 3.6855, + "r_selectivity_pct": 11.765, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, @@ -2105,6 +2116,37 @@ EXPLAIN } DROP TABLE t1,t2; # +# MDEV-21794: Optimizer flag rowid_filter leads to long query +# +create table t10(a int); +insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t11(a int); +insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C; +CREATE TABLE t1 ( +el_id int(10) unsigned NOT NULL , +el_index blob NOT NULL, +el_index_60 varbinary(60) NOT NULL, +filler blob, +PRIMARY KEY (el_id), +KEY el_index (el_index(60)), +KEY el_index_60 (el_index_60,el_id) +); +insert into t1 +select +A.a+1000*B.a, +A.a+1000*B.a + 10000, +A.a+1000*B.a + 10000, +'filler-data-filler-data' +from +t11 A, t10 B; +# This must not use rowid_filter with key=el_index|el_index_60: +explain +select * from t1 +where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 645 Using where +drop table t10, t11, t1; +# # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT # set @save_optimizer_switch= @@optimizer_switch; diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test index 9ac9465963b..c47710e65b8 100644 --- a/mysql-test/main/rowid_filter.test +++ b/mysql-test/main/rowid_filter.test @@ -39,6 +39,16 @@ set statement optimizer_switch='rowid_filter=on' for; let $without_filter= set statement optimizer_switch='rowid_filter=off' for; +select + 100 * + (select count(*) from lineitem + WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 + ) + / + (select count(*) from lineitem + where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30') + as correct_r_filtered_when_using_l_shipdate; + let $q1= SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -339,6 +349,42 @@ eval EXPLAIN FORMAT=JSON $q; DROP TABLE t1,t2; +--echo # +--echo # MDEV-21794: Optimizer flag rowid_filter leads to long query +--echo # +create table t10(a int); +insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t11(a int); +insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C; + +CREATE TABLE t1 ( + el_id int(10) unsigned NOT NULL , + el_index blob NOT NULL, + el_index_60 varbinary(60) NOT NULL, + filler blob, + + PRIMARY KEY (el_id), + KEY el_index (el_index(60)), + KEY el_index_60 (el_index_60,el_id) +); + +insert into t1 +select + A.a+1000*B.a, + A.a+1000*B.a + 10000, + A.a+1000*B.a + 10000, + 'filler-data-filler-data' +from + t11 A, t10 B; + +--echo # This must not use rowid_filter with key=el_index|el_index_60: +explain +select * from t1 +where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%'); + +drop table t10, t11, t1; + --echo # --echo # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 515872d8c5b..05d97b746a7 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -55,6 +55,17 @@ orders CREATE TABLE `orders` ( KEY `i_o_totalprice` (`o_totalprice`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 set optimizer_use_condition_selectivity=2; +select +100 * +(select count(*) from lineitem +WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 +) +/ +(select count(*) from lineitem +where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30') +as correct_r_filtered_when_using_l_shipdate; +correct_r_filtered_when_using_l_shipdate +11.7647 set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; @@ -2034,6 +2045,37 @@ EXPLAIN } DROP TABLE t1,t2; # +# MDEV-21794: Optimizer flag rowid_filter leads to long query +# +create table t10(a int); +insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t11(a int); +insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C; +CREATE TABLE t1 ( +el_id int(10) unsigned NOT NULL , +el_index blob NOT NULL, +el_index_60 varbinary(60) NOT NULL, +filler blob, +PRIMARY KEY (el_id), +KEY el_index (el_index(60)), +KEY el_index_60 (el_index_60,el_id) +); +insert into t1 +select +A.a+1000*B.a, +A.a+1000*B.a + 10000, +A.a+1000*B.a + 10000, +'filler-data-filler-data' +from +t11 A, t10 B; +# This must not use rowid_filter with key=el_index|el_index_60: +explain +select * from t1 +where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 1000 Using where +drop table t10, t11, t1; +# # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT # set @save_optimizer_switch= @@optimizer_switch; diff --git a/mysql-test/main/set_password.result b/mysql-test/main/set_password.result index 91c8b567ad6..8a8af3b3350 100644 --- a/mysql-test/main/set_password.result +++ b/mysql-test/main/set_password.result @@ -9,6 +9,7 @@ create user oldpassold@localhost identified with 'mysql_old_password'; set password for oldpassold@localhost = '378b243e220ca493'; select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; User Host Password plugin authentication_string +mariadb.sys localhost mysql_native_password natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 @@ -86,6 +87,7 @@ set password for oldpass@localhost = PASSWORD('test2'); set password for oldpassold@localhost = PASSWORD('test2'); select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; User Host Password plugin authentication_string +mariadb.sys localhost mysql_native_password natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E diff --git a/mysql-test/main/stat_tables.result b/mysql-test/main/stat_tables.result index 3ff10cc2448..55d8bbf51c9 100644 --- a/mysql-test/main/stat_tables.result +++ b/mysql-test/main/stat_tables.result @@ -592,7 +592,7 @@ explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL -1 SIMPLE global_priv ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; # diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result index d504b531170..45137f29a2d 100644 --- a/mysql-test/main/stat_tables_innodb.result +++ b/mysql-test/main/stat_tables_innodb.result @@ -624,7 +624,7 @@ explain SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL -1 SIMPLE global_priv ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join) set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; # diff --git a/mysql-test/main/system_mysql_db.result b/mysql-test/main/system_mysql_db.result index 6a243ca0c43..838591b3b4b 100644 --- a/mysql-test/main/system_mysql_db.result +++ b/mysql-test/main/system_mysql_db.result @@ -62,7 +62,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_fix40123.result b/mysql-test/main/system_mysql_db_fix40123.result index bc235227b42..fc9a5763dbd 100644 --- a/mysql-test/main/system_mysql_db_fix40123.result +++ b/mysql-test/main/system_mysql_db_fix40123.result @@ -100,7 +100,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_fix50030.result b/mysql-test/main/system_mysql_db_fix50030.result index 842f9aca087..02047dc4a8c 100644 --- a/mysql-test/main/system_mysql_db_fix50030.result +++ b/mysql-test/main/system_mysql_db_fix50030.result @@ -104,7 +104,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/system_mysql_db_fix50117.result b/mysql-test/main/system_mysql_db_fix50117.result index 078cdcbbe03..07119cda6c6 100644 --- a/mysql-test/main/system_mysql_db_fix50117.result +++ b/mysql-test/main/system_mysql_db_fix50117.result @@ -84,7 +84,7 @@ db CREATE TABLE `db` ( ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' show create table user; View Create View character_set_client collation_connection -user CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci show create table func; Table Create Table func CREATE TABLE `func` ( diff --git a/mysql-test/main/upgrade_MDEV-19650.result b/mysql-test/main/upgrade_MDEV-19650.result new file mode 100644 index 00000000000..386c15ae83e --- /dev/null +++ b/mysql-test/main/upgrade_MDEV-19650.result @@ -0,0 +1,209 @@ +call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted"); +create database mysqltest1; +use mysqltest1; +create table save_global_priv as select * from mysql.global_priv; +create table save_tables_priv as select * from mysql.tables_priv; +create table save_proxies_priv as select * from mysql.proxies_priv; +create table mysql.save_proc like mysql.proc; +insert into mysql.save_proc select * from mysql.proc; +set @save_sql_mode= @@sql_mode; +use mysql; +# make old definition of gis procedures and user view +drop view user; +CREATE DEFINER='root'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT +Host, +User, +IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password, +IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv, +IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv, +IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv, +IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv, +IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv, +IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv, +IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv, +IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv, +IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv, +IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv, +IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv, +IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv, +IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv, +IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv, +IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv, +IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv, +IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv, +IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv, +IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv, +IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv, +IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv, +IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv, +IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv, +IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv, +IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv, +IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv, +IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv, +IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv, +IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv, +IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv, +ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type, +IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher, +IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer, +IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject, +CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions, +CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates, +CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections, +CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections, +IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin, +IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string, +'N' AS password_expired, +ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role, +IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role, +CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time +FROM global_priv; +SET sql_mode=''; +DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn; +DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn; +CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), +t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER +begin +set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end | +CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), +t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER +begin +set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end | +set @@sql_mode= @save_sql_mode; +drop user 'mariadb.sys'@'localhost'; +# check old definitions mysql_upgrade +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'root@localhost'; +count(*) +1 +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost'; +count(*) +0 +SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE +SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE +# Run mysql_upgrade +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 +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.save_proc 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 +Error : Unknown storage engine 'InnoDB' +error : Corrupt + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.transaction_registry +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +mysql.user 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 +mysqltest1 +mysqltest1.save_global_priv OK +mysqltest1.save_proxies_priv OK +mysqltest1.save_tables_priv OK +performance_schema +test +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +# check new definitions mysql_upgrade +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'root@localhost'; +count(*) +0 +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost'; +count(*) +1 +SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE +'mariadb.sys'@'localhost' def USAGE NO +SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE +'mariadb.sys'@'localhost' def mysql global_priv SELECT NO +'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv DELETE NO +# check non root +CREATE USER 'not_root'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'not_root'@'localhost'; +GRANT PROXY ON ''@'%' TO 'not_root'@'localhost' WITH GRANT OPTION; +connect con1,localhost,not_root,,; +connection con1; +DROP USER 'root'@'localhost'; +DROP USER 'root'@'127.0.0.1'; +DROP USER 'root'@'::1'; +use mysqltest1; +create table t1 (a int); +call mysql.AddGeometryColumn("def", "mysqltest1", "t1", "g", 101); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `g` geometry DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +use mysql; +select count(*) from user; +count(*) +3 +# restore environment +delete from global_priv; +delete from tables_priv; +delete from proxies_priv; +delete from proc; +insert into mysql.global_priv select * from mysqltest1.save_global_priv; +insert into mysql.tables_priv select * from mysqltest1.save_tables_priv; +insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv; +rename table proc to bad_proc; +rename table save_proc to proc; +drop table bad_proc; +flush privileges; +disconnect default; +connect default,localhost,root,,; +connection default; +disconnect con1; +drop database mysqltest1; +# End of 10.4 tests (but better do not add other tests here) diff --git a/mysql-test/main/upgrade_MDEV-19650.test b/mysql-test/main/upgrade_MDEV-19650.test new file mode 100644 index 00000000000..89cbfc8c7aa --- /dev/null +++ b/mysql-test/main/upgrade_MDEV-19650.test @@ -0,0 +1,159 @@ + +-- source include/mysql_upgrade_preparation.inc + +call mtr.add_suppression("Cannot load from mysql.proc. The table is probably corrupted"); +create database mysqltest1; +use mysqltest1; +create table save_global_priv as select * from mysql.global_priv; +create table save_tables_priv as select * from mysql.tables_priv; +create table save_proxies_priv as select * from mysql.proxies_priv; +create table mysql.save_proc like mysql.proc; +insert into mysql.save_proc select * from mysql.proc; +set @save_sql_mode= @@sql_mode; + +use mysql; + +--echo # make old definition of gis procedures and user view + +drop view user; + +CREATE DEFINER='root'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT + Host, + User, + IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password, + IF(JSON_VALUE(Priv, '$.access') & 1, 'Y', 'N') AS Select_priv, + IF(JSON_VALUE(Priv, '$.access') & 2, 'Y', 'N') AS Insert_priv, + IF(JSON_VALUE(Priv, '$.access') & 4, 'Y', 'N') AS Update_priv, + IF(JSON_VALUE(Priv, '$.access') & 8, 'Y', 'N') AS Delete_priv, + IF(JSON_VALUE(Priv, '$.access') & 16, 'Y', 'N') AS Create_priv, + IF(JSON_VALUE(Priv, '$.access') & 32, 'Y', 'N') AS Drop_priv, + IF(JSON_VALUE(Priv, '$.access') & 64, 'Y', 'N') AS Reload_priv, + IF(JSON_VALUE(Priv, '$.access') & 128, 'Y', 'N') AS Shutdown_priv, + IF(JSON_VALUE(Priv, '$.access') & 256, 'Y', 'N') AS Process_priv, + IF(JSON_VALUE(Priv, '$.access') & 512, 'Y', 'N') AS File_priv, + IF(JSON_VALUE(Priv, '$.access') & 1024, 'Y', 'N') AS Grant_priv, + IF(JSON_VALUE(Priv, '$.access') & 2048, 'Y', 'N') AS References_priv, + IF(JSON_VALUE(Priv, '$.access') & 4096, 'Y', 'N') AS Index_priv, + IF(JSON_VALUE(Priv, '$.access') & 8192, 'Y', 'N') AS Alter_priv, + IF(JSON_VALUE(Priv, '$.access') & 16384, 'Y', 'N') AS Show_db_priv, + IF(JSON_VALUE(Priv, '$.access') & 32768, 'Y', 'N') AS Super_priv, + IF(JSON_VALUE(Priv, '$.access') & 65536, 'Y', 'N') AS Create_tmp_table_priv, + IF(JSON_VALUE(Priv, '$.access') & 131072, 'Y', 'N') AS Lock_tables_priv, + IF(JSON_VALUE(Priv, '$.access') & 262144, 'Y', 'N') AS Execute_priv, + IF(JSON_VALUE(Priv, '$.access') & 524288, 'Y', 'N') AS Repl_slave_priv, + IF(JSON_VALUE(Priv, '$.access') & 1048576, 'Y', 'N') AS Repl_client_priv, + IF(JSON_VALUE(Priv, '$.access') & 2097152, 'Y', 'N') AS Create_view_priv, + IF(JSON_VALUE(Priv, '$.access') & 4194304, 'Y', 'N') AS Show_view_priv, + IF(JSON_VALUE(Priv, '$.access') & 8388608, 'Y', 'N') AS Create_routine_priv, + IF(JSON_VALUE(Priv, '$.access') & 16777216, 'Y', 'N') AS Alter_routine_priv, + IF(JSON_VALUE(Priv, '$.access') & 33554432, 'Y', 'N') AS Create_user_priv, + IF(JSON_VALUE(Priv, '$.access') & 67108864, 'Y', 'N') AS Event_priv, + IF(JSON_VALUE(Priv, '$.access') & 134217728, 'Y', 'N') AS Trigger_priv, + IF(JSON_VALUE(Priv, '$.access') & 268435456, 'Y', 'N') AS Create_tablespace_priv, + IF(JSON_VALUE(Priv, '$.access') & 536870912, 'Y', 'N') AS Delete_history_priv, + ELT(IFNULL(JSON_VALUE(Priv, '$.ssl_type'), 0) + 1, '', 'ANY','X509', 'SPECIFIED') AS ssl_type, + IFNULL(JSON_VALUE(Priv, '$.ssl_cipher'), '') AS ssl_cipher, + IFNULL(JSON_VALUE(Priv, '$.x509_issuer'), '') AS x509_issuer, + IFNULL(JSON_VALUE(Priv, '$.x509_subject'), '') AS x509_subject, + CAST(IFNULL(JSON_VALUE(Priv, '$.max_questions'), 0) AS UNSIGNED) AS max_questions, + CAST(IFNULL(JSON_VALUE(Priv, '$.max_updates'), 0) AS UNSIGNED) AS max_updates, + CAST(IFNULL(JSON_VALUE(Priv, '$.max_connections'), 0) AS UNSIGNED) AS max_connections, + CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections, + IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin, + IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string, + 'N' AS password_expired, + ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role, + IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role, + CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time + FROM global_priv; + + +SET sql_mode=''; + +delimiter |; + +DROP PROCEDURE IF EXISTS mysql.AddGeometryColumn; +DROP PROCEDURE IF EXISTS mysql.DropGeometryColumn; + +CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), + t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER +begin + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end | + +CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), + t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER +begin + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end | + +delimiter ;| +set @@sql_mode= @save_sql_mode; + +drop user 'mariadb.sys'@'localhost'; + +--echo # check old definitions mysql_upgrade + +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'root@localhost'; +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost'; +SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; + +let $MYSQLD_DATADIR= `select @@datadir`; + +--echo # Run mysql_upgrade +--exec $MYSQL_UPGRADE 2>&1 +--file_exists $MYSQLD_DATADIR/mysql_upgrade_info +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info + +--echo # check new definitions mysql_upgrade + +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'root@localhost'; +SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'mariadb.sys@localhost'; +SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; +SELECT * FROM information_schema.TABLE_PRIVILEGES WHERE GRANTEE="'mariadb.sys'@'localhost'"; + +--echo # check non root + +CREATE USER 'not_root'@'localhost'; +GRANT ALL PRIVILEGES ON *.* TO 'not_root'@'localhost'; +GRANT PROXY ON ''@'%' TO 'not_root'@'localhost' WITH GRANT OPTION; + +connect con1,localhost,not_root,,; + +connection con1; + +DROP USER 'root'@'localhost'; +DROP USER 'root'@'127.0.0.1'; +DROP USER 'root'@'::1'; + +use mysqltest1; + +create table t1 (a int); +call mysql.AddGeometryColumn("def", "mysqltest1", "t1", "g", 101); + +show create table t1; +use mysql; + +select count(*) from user; + +--echo # restore environment + +delete from global_priv; +delete from tables_priv; +delete from proxies_priv; +delete from proc; +insert into mysql.global_priv select * from mysqltest1.save_global_priv; +insert into mysql.tables_priv select * from mysqltest1.save_tables_priv; +insert into mysql.proxies_priv select * from mysqltest1.save_proxies_priv; +rename table proc to bad_proc; +rename table save_proc to proc; +drop table bad_proc; +flush privileges; + +disconnect default; +connect default,localhost,root,,; +connection default; +disconnect con1; + +drop database mysqltest1; + +--echo # End of 10.4 tests (but better do not add other tests here) diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result index 8af27de141f..263c932097d 100644 --- a/mysql-test/main/view_grant.result +++ b/mysql-test/main/view_grant.result @@ -1343,6 +1343,9 @@ disconnect root; connection default; select * from information_schema.table_privileges; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE +'mariadb.sys'@'localhost' def mysql global_priv SELECT NO +'mariadb.sys'@'localhost' def mysql global_priv UPDATE NO +'mariadb.sys'@'localhost' def mysql global_priv DELETE NO End of 5.0 tests. connection default; DROP VIEW IF EXISTS v1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c524561edd9..6b6f0285100 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2283,7 +2283,8 @@ sub environment_setup { $ENV{'LC_CTYPE'}= "C"; $ENV{'LC_COLLATE'}= "C"; - $ENV{'OPENSSL_CONF'}= "/dev/null"; + $ENV{'OPENSSL_CONF'}= $mysqld_variables{'version-ssl-library'} gt 'OpenSSL 1.1.1' + ? "$glob_mysql_test_dir/lib/openssl.cnf" : '/dev/null'; $ENV{'USE_RUNNING_SERVER'}= using_extern(); $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index cb30a3186e5..8ff2e95c083 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -74,6 +74,9 @@ sub skip_combinations { $skip{'main/ssl_verify_ip.test'} = 'x509v3 support required' unless $openssl_ver ge "1.0.2"; + $skip{'main/tls_version1.test'} = 'https://github.com/wolfSSL/wolfssl/issues/2960' + if $ssl_lib =~ /WolfSSL 4.4.0/; + %skip; } diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result index 1ac3651f254..992a5884d02 100644 --- a/mysql-test/suite/funcs_1/r/is_routines_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result @@ -200,9 +200,9 @@ add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci connect testuser2, localhost, testuser2, , db_datadict; SELECT * FROM information_schema.routines; SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -216,9 +216,9 @@ add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci connect testuser3, localhost, testuser3, , test; SELECT * FROM information_schema.routines; SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -232,9 +232,9 @@ add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci AddGeometryColumn def mysql AddGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci DropGeometryColumn def mysql DropGeometryColumn PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL begin - set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci + set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end NULL NULL SQL NO CONTAINS SQL NULL INVOKER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss mariadb.sys@localhost latin1 latin1_swedish_ci latin1_swedish_ci connection default; disconnect testuser1; disconnect testuser2; diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result index f2fd28b2a77..ad9af516fde 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics.result +++ b/mysql-test/suite/funcs_1/r/is_statistics.result @@ -238,8 +238,8 @@ def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH SHOW GRANTS FOR 'testuser1'@'localhost'; Grants for testuser1@localhost GRANT USAGE ON *.* TO `testuser1`@`localhost` -GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION 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 GRANT USAGE ON *.* TO `testuser2`@`localhost` @@ -257,8 +257,8 @@ def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH SHOW GRANTS FOR 'testuser1'@'localhost'; Grants for testuser1@localhost GRANT USAGE ON *.* TO `testuser1`@`localhost` -GRANT SELECT ON `db_datadict`.`t1` TO `testuser1`@`localhost` WITH GRANT OPTION 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' connection testuser2; diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result index 2c0942f44f1..d4f0de131d1 100644 --- a/mysql-test/suite/funcs_1/r/is_table_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result @@ -55,6 +55,9 @@ IS_GRANTABLE varchar(3) NO SELECT table_catalog, table_schema, table_name, privilege_type FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL; table_catalog table_schema table_name privilege_type +def mysql global_priv SELECT +def mysql global_priv UPDATE +def mysql global_priv DELETE ###################################################################### # Testcase 3.2.11.2+3.2.11.3+3.2.11.4: # INFORMATION_SCHEMA.TABLE_PRIVILEGES accessible information @@ -227,8 +230,8 @@ ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localh SHOW GRANTS FOR 'the_user'@'localhost'; Grants for the_user@localhost GRANT USAGE ON *.* TO `the_user`@`localhost` -GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost` GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost` +GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost` SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges WHERE table_name LIKE 't1_%' ORDER BY table_schema,table_name; @@ -247,8 +250,8 @@ test t1_view SHOW GRANTS FOR 'the_user'@'localhost'; Grants for the_user@localhost GRANT USAGE ON *.* TO `the_user`@`localhost` -GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost` GRANT ALL PRIVILEGES ON `test`.`t1_table` TO `the_user`@`localhost` +GRANT ALL PRIVILEGES ON `test`.`t1_view` TO `the_user`@`localhost` REVOKE ALL PRIVILEGES ON test.t1_table FROM 'the_user'@'localhost'; REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost'; DROP VIEW test.t1_view; diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 5d061167a62..d54228dd090 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -210,6 +210,7 @@ ERROR 70100: Query execution was interrupted connection con1; ROLLBACK; connection default; +disconnect con1; DROP TABLE t3,t1; # # MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N @@ -291,6 +292,121 @@ ALTER TABLE t1 DROP f3; ALTER TABLE t1 CHANGE f f3 INT; DROP TABLE t1; SET FOREIGN_KEY_CHECKS=1; +# +# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE +# ADD FOREIGN KEY +# +CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, +PRIMARY KEY (`department_id`)) engine=innodb; +CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb; +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb; +ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES +`people` (`people_id`); +ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` +(`people_id`); +ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` +(`people_id`); +drop table title, department, people; +create table t1 (a int primary key, b int) engine=innodb; +create table t2 (c int primary key, d int, +foreign key (d) references t1 (a) on update cascade) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +insert t2 values (4,1),(5,2),(6,3); +flush table t2 with read lock; +connect con1,localhost,root; +delete from t1 where a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE) +update t1 set a=10 where a=1; +connection default; +unlock tables; +connection con1; +connection default; +lock table t2 write; +connection con1; +delete from t1 where a=2; +connection default; +unlock tables; +connection con1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE) +connection default; +unlock tables; +disconnect con1; +create user foo; +grant select,update on test.t1 to foo; +connect foo,localhost,foo; +update t1 set a=30 where a=3; +disconnect foo; +connection default; +select * from t2; +c d +5 2 +4 10 +6 30 +drop table t2, t1; +drop user foo; +# +# MDEV-17595 - Server crashes in copy_data_between_tables or +# Assertion `thd->transaction.stmt.is_empty() || +# (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' +# fails in close_tables_for_reopen upon concurrent +# ALTER TABLE and FLUSH +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1),(2); +CREATE TABLE t2 (b INT, KEY(b)) ENGINE=InnoDB; +INSERT INTO t2 VALUES(2); +ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE; +DROP TABLE t2, t1; +create table t1 (pk int primary key, data int) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +create table t2 (t1_pk int, foreign key (t1_pk) references t1 (pk)) engine=innodb; +insert t2 values (1),(2); +insert t2 values (10); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_pk`) REFERENCES `t1` (`pk`)) +flush tables; +flush status; +update t1 set data=10 where pk+1>10; +show status like '%opened_tab%'; +Variable_name Value +Opened_table_definitions 4 +Opened_tables 4 +flush tables; +flush status; +update t2 set t1_pk=11 where t1_pk+1>10; +show status like '%opened_tab%'; +Variable_name Value +Opened_table_definitions 4 +Opened_tables 4 +flush tables; +flush status; +lock tables t1 write; +show status like '%opened_tab%'; +Variable_name Value +Opened_table_definitions 2 +Opened_tables 2 +insert t1 values (4,4); +show status like '%opened_tab%'; +Variable_name Value +Opened_table_definitions 5 +Opened_tables 5 +unlock tables; +create function foo() returns int +begin +insert t1 values (5,5); +return 5; +end| +flush tables; +flush status; +select foo(); +foo() +5 +show status like '%opened_tab%'; +Variable_name Value +Opened_table_definitions 5 +Opened_tables 5 +drop function foo; +drop table t2, t1; # Start of 10.2 tests # # MDEV-13246 Stale rows despite ON DELETE CASCADE constraint @@ -328,6 +444,7 @@ INSERT INTO matchmaking_group_users VALUES (10,1),(11,2); INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66); BEGIN; UPDATE users SET name = 'qux' WHERE id = 1; +connect con1,localhost,root; connection con1; SET innodb_lock_wait_timeout= 1; DELETE FROM matchmaking_groups WHERE id = 10; @@ -538,6 +655,65 @@ Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; +# +# MDEV-17187 table doesn't exist in engine after ALTER other tables +# with CONSTRAINTs +# +set foreign_key_checks=on; +create table t1 (id int not null primary key) engine=innodb; +create table t2 (id int not null primary key, fid int not null, +CONSTRAINT fk_fid FOREIGN KEY (fid) REFERENCES t1 (id))engine=innodb; +insert into t1 values (1), (2), (3); +insert into t2 values (1, 1), (2, 1), (3, 2); +set foreign_key_checks=off; +alter table t2 drop index fk_fid; +set foreign_key_checks=on; +delete from t1 where id=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`)) +insert into t2 values(4, 99); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`)) +select * from t1; +id +1 +2 +3 +select * from t2; +id fid +1 1 +2 1 +3 2 +set foreign_key_checks=off; +delete from t1 where id=2; +insert into t2 values(4, 99); +set foreign_key_checks=on; +select * from t1; +id +1 +3 +select * from t2; +id fid +1 1 +2 1 +3 2 +4 99 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL, + `fid` int(11) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1,t2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +drop table t1,t2; +ERROR 42S02: Unknown table 'test.t2' # End of 10.2 tests CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb/r/foreign_key_debug.result b/mysql-test/suite/innodb/r/foreign_key_debug.result new file mode 100644 index 00000000000..10a7e6f36e9 --- /dev/null +++ b/mysql-test/suite/innodb/r/foreign_key_debug.result @@ -0,0 +1,60 @@ +create table t1 (f1 int primary key) engine=innodb; +create table t2 (f2 int primary key) engine=innodb; +create table t3 (f3 int primary key, foreign key (f3) references t2(f2)) engine=innodb; +insert into t1 values (1),(2),(3),(4),(5); +insert into t2 values (1),(2),(3),(4),(5); +insert into t3 values (1),(2),(3),(4),(5); +connect con1,localhost,root; +set debug_sync='alter_table_before_rename_result_table signal g1 wait_for g2'; +alter table t2 add constraint foreign key (f2) references t1(f1) on delete cascade on update cascade; +connection default; +set debug_sync='before_execute_sql_command wait_for g1'; +update t1 set f1 = f1 + 100000 limit 2; +connect con2,localhost,root; +kill query UPDATE; +disconnect con2; +connection default; +ERROR 70100: Query execution was interrupted +set debug_sync='now signal g2'; +connection con1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f2` int(11) NOT NULL, + PRIMARY KEY (`f2`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +disconnect con1; +connection default; +select * from t2 where f2 not in (select f1 from t1); +f2 +select * from t3 where f3 not in (select f2 from t2); +f3 +drop table t3; +drop table t2; +drop table t1; +set debug_sync='reset'; +# +# MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name) +# +CREATE TABLE t1 (`pk` INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +FLUSH TABLES; +SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go'; +ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE; +connect con1, localhost, root; +SET debug_sync='now WAIT_FOR ready'; +SET lock_wait_timeout=0; +UPDATE t2 SET pk=10 WHERE pk=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1'; +DEALLOCATE PREPARE stmt; +SET debug_sync='now SIGNAL go'; +connection default; +disconnect con1; +connection default; +SET debug_sync='reset'; +SHOW OPEN TABLES FROM test; +Database Table In_use Name_locked +test t2 0 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index 0d7b700a189..7ff154538cb 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -195,6 +195,7 @@ reap; connection con1; ROLLBACK; connection default; +disconnect con1; DROP TABLE t3,t1; @@ -281,6 +282,136 @@ DROP TABLE t1; SET FOREIGN_KEY_CHECKS=1; +--echo # +--echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE +--echo # ADD FOREIGN KEY +--echo # + +CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT, +PRIMARY KEY (`department_id`)) engine=innodb; + +CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT, +`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb; + +CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb; + +ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES +`people` (`people_id`); + +ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people` +(`people_id`); + +ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people` +(`people_id`); + +drop table title, department, people; + +# +# FK and prelocking: +# child table accesses (reads and writes) wait for locks. +# +create table t1 (a int primary key, b int) engine=innodb; +create table t2 (c int primary key, d int, + foreign key (d) references t1 (a) on update cascade) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +insert t2 values (4,1),(5,2),(6,3); +flush table t2 with read lock; # this takes MDL_SHARED_NO_WRITE +connect (con1,localhost,root); +--error ER_ROW_IS_REFERENCED_2 +delete from t1 where a=2; +send update t1 set a=10 where a=1; +connection default; +let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock'; +source include/wait_condition.inc; +unlock tables; +connection con1; +reap; +connection default; +lock table t2 write; # this takes MDL_SHARED_NO_READ_WRITE +connection con1; +send delete from t1 where a=2; +connection default; +let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock'; +source include/wait_condition.inc; +unlock tables; +connection con1; +--error ER_ROW_IS_REFERENCED_2 +reap; +connection default; +unlock tables; +disconnect con1; + +# but privileges should not be checked +create user foo; +grant select,update on test.t1 to foo; +connect(foo,localhost,foo); +update t1 set a=30 where a=3; +disconnect foo; +connection default; +select * from t2; +drop table t2, t1; +drop user foo; + +--echo # +--echo # MDEV-17595 - Server crashes in copy_data_between_tables or +--echo # Assertion `thd->transaction.stmt.is_empty() || +--echo # (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' +--echo # fails in close_tables_for_reopen upon concurrent +--echo # ALTER TABLE and FLUSH +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1),(2); +CREATE TABLE t2 (b INT, KEY(b)) ENGINE=InnoDB; +INSERT INTO t2 VALUES(2); +ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE; +DROP TABLE t2, t1; + +# +# MDEV-22180 Planner opens unnecessary tables when updated table is referenced by foreign keys +# + +create table t1 (pk int primary key, data int) engine=innodb; +insert t1 values (1,1),(2,2),(3,3); +create table t2 (t1_pk int, foreign key (t1_pk) references t1 (pk)) engine=innodb; +insert t2 values (1),(2); +error ER_NO_REFERENCED_ROW_2; +insert t2 values (10); +flush tables; +flush status; +# with ON UPDATE RESTRICT child tables are not opened +update t1 set data=10 where pk+1>10; +show status like '%opened_tab%'; +flush tables; +flush status; +# neither are parent tables +update t2 set t1_pk=11 where t1_pk+1>10; +show status like '%opened_tab%'; +# under LOCK TABLES +flush tables; +flush status; +lock tables t1 write; +show status like '%opened_tab%'; +insert t1 values (4,4); +show status like '%opened_tab%'; +unlock tables; +delimiter |; +create function foo() returns int +begin + insert t1 values (5,5); + return 5; +end| +delimiter ;| +flush tables; +flush status; +select foo(); +show status like '%opened_tab%'; +drop function foo; +drop table t2, t1; + +# +# End of 10.1 tests +# + --echo # Start of 10.2 tests --echo # @@ -326,6 +457,7 @@ INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66); BEGIN; UPDATE users SET name = 'qux' WHERE id = 1; +connect (con1,localhost,root); --connection con1 SET innodb_lock_wait_timeout= 1; DELETE FROM matchmaking_groups WHERE id = 10; @@ -520,6 +652,52 @@ CHECK TABLE t1; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; +--echo # +--echo # MDEV-17187 table doesn't exist in engine after ALTER other tables +--echo # with CONSTRAINTs +--echo # + +set foreign_key_checks=on; +create table t1 (id int not null primary key) engine=innodb; +create table t2 (id int not null primary key, fid int not null, +CONSTRAINT fk_fid FOREIGN KEY (fid) REFERENCES t1 (id))engine=innodb; + +insert into t1 values (1), (2), (3); +insert into t2 values (1, 1), (2, 1), (3, 2); + +set foreign_key_checks=off; +alter table t2 drop index fk_fid; +set foreign_key_checks=on; + +--error ER_ROW_IS_REFERENCED_2 +delete from t1 where id=2; +--error ER_NO_REFERENCED_ROW_2 +insert into t2 values(4, 99); + +select * from t1; +select * from t2; + +set foreign_key_checks=off; +delete from t1 where id=2; +insert into t2 values(4, 99); +set foreign_key_checks=on; + +select * from t1; +select * from t2; + +show create table t1; +show create table t2; + +# Optional: test DROP TABLE without any prior ha_innobase::open(). +# This was tested manually, but it would cause --embedded to skip the test, +# and the restart would significantly increase the running time. +# --source include/restart_mysqld.inc + +--error ER_ROW_IS_REFERENCED_2 +drop table t1,t2; +--error ER_BAD_TABLE_ERROR +drop table t1,t2; + --echo # End of 10.2 tests # MDEV-21792 Server aborts upon attempt to create foreign key on spatial field diff --git a/mysql-test/suite/innodb/t/foreign_key_debug.test b/mysql-test/suite/innodb/t/foreign_key_debug.test new file mode 100644 index 00000000000..166cfb7c84e --- /dev/null +++ b/mysql-test/suite/innodb/t/foreign_key_debug.test @@ -0,0 +1,77 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +--enable_connect_log + +# +# MDEV-16465 Invalid (old?) table or database name or hang in ha_innobase::delete_table and log semaphore wait upon concurrent DDL with foreign keys +# +create table t1 (f1 int primary key) engine=innodb; +create table t2 (f2 int primary key) engine=innodb; +create table t3 (f3 int primary key, foreign key (f3) references t2(f2)) engine=innodb; +insert into t1 values (1),(2),(3),(4),(5); +insert into t2 values (1),(2),(3),(4),(5); +insert into t3 values (1),(2),(3),(4),(5); +connect con1,localhost,root; +set debug_sync='alter_table_before_rename_result_table signal g1 wait_for g2'; +send alter table t2 add constraint foreign key (f2) references t1(f1) on delete cascade on update cascade; +connection default; +let $conn=`select connection_id()`; +set debug_sync='before_execute_sql_command wait_for g1'; +send update t1 set f1 = f1 + 100000 limit 2; +connect con2,localhost,root; +let $wait_condition= select 1 from information_schema.processlist where state='Waiting for table metadata lock' and info like 'update t1 %'; +source include/wait_condition.inc; +--replace_result $conn UPDATE +eval kill query $conn; +disconnect con2; +connection default; +error ER_QUERY_INTERRUPTED; +reap; +set debug_sync='now signal g2'; +connection con1; +reap; +show create table t2; +disconnect con1; +connection default; +select * from t2 where f2 not in (select f1 from t1); +select * from t3 where f3 not in (select f2 from t2); +drop table t3; +drop table t2; +drop table t1; +set debug_sync='reset'; + +--echo # +--echo # MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name) +--echo # +CREATE TABLE t1 (`pk` INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +FLUSH TABLES; + +SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go'; +send ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE; + +connect con1, localhost, root; +SET debug_sync='now WAIT_FOR ready'; +SET lock_wait_timeout=0; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t2 SET pk=10 WHERE pk=1; +PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1'; +DEALLOCATE PREPARE stmt; +SET debug_sync='now SIGNAL go'; + +connection default; +reap; + +# Cleanup +disconnect con1; + +connection default; +SET debug_sync='reset'; +SHOW OPEN TABLES FROM test; +DROP TABLE t1, t2; + +# +# End of 10.1 tests +# diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index 00f382de966..fd56d3e1776 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -101,6 +101,7 @@ wait/io/table/sql/handler handler.cc: TABLE mysql global_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql global_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql global_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql global_priv fetch NULL +wait/io/table/sql/handler handler.cc: TABLE mysql global_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql db fetch NULL @@ -109,6 +110,7 @@ wait/io/table/sql/handler handler.cc: TABLE mysql proxies_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql proxies_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql roles_mapping fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql tables_priv fetch NULL +wait/io/table/sql/handler handler.cc: TABLE mysql tables_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql procs_priv fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql servers fetch NULL wait/io/table/sql/handler handler.cc: TABLE mysql table_stats fetch NULL diff --git a/mysql-test/suite/roles/acl_statistics.result b/mysql-test/suite/roles/acl_statistics.result index 46e48b86936..f43f692cc48 100644 --- a/mysql-test/suite/roles/acl_statistics.result +++ b/mysql-test/suite/roles/acl_statistics.result @@ -9,8 +9,8 @@ Acl_package_body_grants 0 Acl_proxy_users 2 Acl_role_grants 0 Acl_roles 0 -Acl_table_grants 0 -Acl_users 4 +Acl_table_grants 1 +Acl_users 5 SELECT count(*) COLUMN_GRANTS from mysql.columns_priv; COLUMN_GRANTS 0 @@ -34,10 +34,10 @@ ROLES 0 SELECT count(*) TABLE_GRANTS from mysql.tables_priv; TABLE_GRANTS -0 +1 SELECT count(*) USERS from mysql.user where is_role='N'; USERS -4 +5 CREATE USER u1; CREATE ROLE r1; CREATE ROLE r2; @@ -74,8 +74,8 @@ Acl_package_body_grants 0 Acl_proxy_users 3 Acl_role_grants 4 Acl_roles 2 -Acl_table_grants 2 -Acl_users 5 +Acl_table_grants 3 +Acl_users 6 SELECT count(*) COLUMN_GRANTS from mysql.columns_priv; COLUMN_GRANTS 2 @@ -99,10 +99,10 @@ ROLES 2 SELECT count(*) TABLE_GRANTS from mysql.tables_priv; TABLE_GRANTS -2 +3 SELECT count(*) USERS from mysql.user where is_role='N'; USERS -5 +6 DROP PROCEDURE mysql.test_proc; DROP FUNCTION mysql.test_func; DROP ROLE r2; diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result index 80de2d3414e..329cab6474b 100644 --- a/mysql-test/suite/roles/grant_revoke_current.result +++ b/mysql-test/suite/roles/grant_revoke_current.result @@ -41,4 +41,4 @@ GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION GRANT USAGE ON *.* TO `r1` set password=''; drop role r1; -update mysql.global_priv set priv=@root_priv; +update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; diff --git a/mysql-test/suite/roles/grant_revoke_current.test b/mysql-test/suite/roles/grant_revoke_current.test index 65a0809ac9c..fda55358b20 100644 --- a/mysql-test/suite/roles/grant_revoke_current.test +++ b/mysql-test/suite/roles/grant_revoke_current.test @@ -29,4 +29,4 @@ set password=''; #cleanup drop role r1; -update mysql.global_priv set priv=@root_priv; +update mysql.global_priv set priv=@root_priv where user='root' and host='localhost'; diff --git a/mysql-test/suite/roles/set_role-database-recursive.result b/mysql-test/suite/roles/set_role-database-recursive.result index 80c5d9a8e39..bc3914413a3 100644 --- a/mysql-test/suite/roles/set_role-database-recursive.result +++ b/mysql-test/suite/roles/set_role-database-recursive.result @@ -6,6 +6,7 @@ grant test_role2 to test_user@localhost; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_user localhost diff --git a/mysql-test/suite/roles/set_role-database-simple.result b/mysql-test/suite/roles/set_role-database-simple.result index 156a4453b69..a48f04985bb 100644 --- a/mysql-test/suite/roles/set_role-database-simple.result +++ b/mysql-test/suite/roles/set_role-database-simple.result @@ -3,6 +3,7 @@ create role test_role1; grant test_role1 to test_user@localhost; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_user localhost select * from mysql.roles_mapping; diff --git a/mysql-test/suite/roles/set_role-recursive.result b/mysql-test/suite/roles/set_role-recursive.result index 207e9a71bd9..0413a9c4e04 100644 --- a/mysql-test/suite/roles/set_role-recursive.result +++ b/mysql-test/suite/roles/set_role-recursive.result @@ -5,6 +5,7 @@ create role test_role2; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_user localhost diff --git a/mysql-test/suite/roles/set_role-routine-simple.result b/mysql-test/suite/roles/set_role-routine-simple.result index 74771991b0d..eaa630f4b6a 100644 --- a/mysql-test/suite/roles/set_role-routine-simple.result +++ b/mysql-test/suite/roles/set_role-routine-simple.result @@ -7,6 +7,7 @@ grant test_role3 to test_user@localhost; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_role3 diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result index d54528f23d7..59e61d4836a 100644 --- a/mysql-test/suite/roles/set_role-simple.result +++ b/mysql-test/suite/roles/set_role-simple.result @@ -3,6 +3,7 @@ create role test_role1; grant test_role1 to test_user@localhost; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_user localhost select * from mysql.roles_mapping; diff --git a/mysql-test/suite/roles/set_role-table-column-priv.result b/mysql-test/suite/roles/set_role-table-column-priv.result index 92fc53a15cc..9e1d21bab5e 100644 --- a/mysql-test/suite/roles/set_role-table-column-priv.result +++ b/mysql-test/suite/roles/set_role-table-column-priv.result @@ -5,6 +5,7 @@ grant test_role1 to test_user@localhost; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_user localhost @@ -62,6 +63,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro drop user 'test_user'@'localhost'; select * from mysql.tables_priv; Host Db User Table_name Grantor Timestamp Table_priv Column_priv +localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select revoke select on mysql.roles_mapping from test_role2; delete from mysql.user where user like'test_%'; diff --git a/mysql-test/suite/roles/set_role-table-simple.result b/mysql-test/suite/roles/set_role-table-simple.result index 1fca819b2d5..107ca726e22 100644 --- a/mysql-test/suite/roles/set_role-table-simple.result +++ b/mysql-test/suite/roles/set_role-table-simple.result @@ -5,6 +5,7 @@ grant test_role1 to test_user@localhost; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_user localhost @@ -60,6 +61,7 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'ro drop user 'test_user'@'localhost'; select * from mysql.tables_priv; Host Db User Table_name Grantor Timestamp Table_priv Column_priv +localhost mysql mariadb.sys global_priv root@localhost 0000-00-00 00:00:00 Select,Update,Delete mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select revoke select on mysql.roles_mapping from test_role2; delete from mysql.user where user like'test_%'; diff --git a/mysql-test/suite/roles/show_grants.result b/mysql-test/suite/roles/show_grants.result index 57149e401ce..1867133525d 100644 --- a/mysql-test/suite/roles/show_grants.result +++ b/mysql-test/suite/roles/show_grants.result @@ -6,6 +6,7 @@ grant test_role2 to test_user@localhost; grant test_role2 to test_role1; select user, host from mysql.user where user not like 'root'; User Host +mariadb.sys localhost test_role1 test_role2 test_user localhost diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def index ef1630f87eb..67e710f2637 100644 --- a/mysql-test/suite/rpl/disabled.def +++ b/mysql-test/suite/rpl/disabled.def @@ -19,3 +19,4 @@ rpl_parallel2 : fails after MDEV-16172 rpl_semi_sync_after_sync : fails after MDEV-16172 rpl_slave_grp_exec: MDEV-10514 rpl_auto_increment_update_failure : disabled for now +rpl_current_user : waits for MDEV-22374 fix diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index e4113b74e55..3e6cdac820e 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -39,27 +39,27 @@ GRANT INSERT ON test.* TO mysqltest6@localhost; GRANT INSERT ON test.t1 TO mysqltest6@localhost; show grants for mysqltest1@localhost; Grants for mysqltest1@localhost -GRANT USAGE ON *.* TO `mysqltest1`@`localhost` GRANT SELECT ON `test`.`t1` TO `mysqltest1`@`localhost` +GRANT USAGE ON *.* TO `mysqltest1`@`localhost` show grants for mysqltest2@localhost; Grants for mysqltest2@localhost -GRANT USAGE ON *.* TO `mysqltest2`@`localhost` -GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO `mysqltest2`@`localhost` GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost` +GRANT SELECT, INSERT, UPDATE, REFERENCES ON `test`.`t1` TO `mysqltest2`@`localhost` +GRANT USAGE ON *.* TO `mysqltest2`@`localhost` show grants for mysqltest3@localhost; Grants for mysqltest3@localhost -GRANT USAGE ON *.* TO `mysqltest3`@`localhost` -GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost` +GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` +GRANT USAGE ON *.* TO `mysqltest3`@`localhost` show grants for mysqltest4@localhost; Grants for mysqltest4@localhost -GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost` +GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' show grants for mysqltest6@localhost; Grants for mysqltest6@localhost -GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost` GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost` GRANT INSERT ON `test`.`t1` TO `mysqltest6`@`localhost` +GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost` flush privileges; show grants for mysqltest5@somehost; Grants for mysqltest5@somehost @@ -69,24 +69,24 @@ connection slave; **** Checking grants on slave **** show grants for mysqltest2@localhost; Grants for mysqltest2@localhost -GRANT USAGE ON *.* TO `mysqltest2`@`localhost` GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost` +GRANT USAGE ON *.* TO `mysqltest2`@`localhost` show grants for mysqltest3@localhost; Grants for mysqltest3@localhost -GRANT USAGE ON *.* TO `mysqltest3`@`localhost` -GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` GRANT SELECT (a), INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost` +GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` +GRANT USAGE ON *.* TO `mysqltest3`@`localhost` show grants for mysqltest4@localhost; Grants for mysqltest4@localhost -GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' GRANT SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost` +GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' show grants for mysqltest5@somehost; Grants for mysqltest5@somehost GRANT USAGE ON *.* TO `mysqltest5`@`somehost` show grants for mysqltest6@localhost; Grants for mysqltest6@localhost -GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost` GRANT INSERT ON `test`.* TO `mysqltest6`@`localhost` +GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost` show grants for mysqltest1@localhost; ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost' **** Revoking grants on master **** @@ -100,9 +100,9 @@ Grants for mysqltest1@localhost GRANT USAGE ON *.* TO `mysqltest1`@`localhost` show grants for mysqltest3@localhost; Grants for mysqltest3@localhost -GRANT USAGE ON *.* TO `mysqltest3`@`localhost` -GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO `mysqltest3`@`localhost` +GRANT SELECT ON `test`.* TO `mysqltest3`@`localhost` +GRANT USAGE ON *.* TO `mysqltest3`@`localhost` show grants for mysqltest4@localhost; Grants for mysqltest4@localhost GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index a3fcfc95901..19797b89013 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -77,10 +77,15 @@ GRANT INSERT ON *.* TO mysqltest6@localhost; GRANT INSERT ON test.* TO mysqltest6@localhost; GRANT INSERT ON test.t1 TO mysqltest6@localhost; +--sorted_result show grants for mysqltest1@localhost; +--sorted_result show grants for mysqltest2@localhost; +--sorted_result show grants for mysqltest3@localhost; +--sorted_result show grants for mysqltest4@localhost; +--sorted_result show grants for mysqltest6@localhost; flush privileges; @@ -92,10 +97,15 @@ sync_slave_with_master; --echo **** Checking grants on slave **** # Check that grants are replicated to slave +--sorted_result show grants for mysqltest2@localhost; +--sorted_result show grants for mysqltest3@localhost; +--sorted_result show grants for mysqltest4@localhost; +--sorted_result show grants for mysqltest5@somehost; +--sorted_result show grants for mysqltest6@localhost; # mysqltest1 should not be on slave @@ -109,8 +119,11 @@ REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost; REVOKE select(a) on t4 from mysqltest3@localhost; +--sorted_result show grants for mysqltest1@localhost; +--sorted_result show grants for mysqltest3@localhost; +--sorted_result show grants for mysqltest4@localhost; sync_slave_with_master; diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 5fb89c560fa..70eab5d2740 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,170 +23,207 @@ # ############################################################################## # -# Based on bb-10.4-release ee33c4a6946c4291f103437428e34a405193b270 - -main.alter_table_trans : MDEV-12084 - timeout -main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result -main.auth_named_pipe : MDEV-14724 - System error 2 -main.binary_to_hex : MDEV-20211 - Wrong result -main.cache_temporal_4265 : Modified in 10.4.12 -main.connect : MDEV-17282 - Wrong result -main.connect-abstract : MDEV-20162 - Could not execute 'check-testcase' -main.connect2 : MDEV-13885 - Server crash -main.connect_debug : Modified in 10.4.12 -main.count_distinct2 : MDEV-11768 - timeout -main.create : Modified in 10.4.11 -main.create_delayed : MDEV-10605 - failed with timeout -main.create_drop_event : MDEV-16271 - Wrong result -main.create_or_replace2 : Modified in 10.4.12 -main.cte_nonrecursive : Modified in 10.4.12 -main.ctype_cp932_binlog_stm : MDEV-20534 - Wrong result -main.ctype_ucs : MDEV-17681 - Data too long for column -main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade -main.ctype_utf16 : MDEV-10675: timeout or extra warnings -main.ctype_utf16le : MDEV-10675: timeout or extra warnings -main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison -main.debug_sync : MDEV-10607 - internal error -main.default_session : Modified in 10.4.12 -main.delayed : MDEV-20961 - Assertion failure -main.delete_use_source : Modified in 10.4.12 -main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.4.12 -main.derived_opt : MDEV-11768 - timeout -main.dirty_close : MDEV-19368 - mysqltest failed but provided no output -main.distinct : MDEV-14194 - Crash -main.drop_bad_db_type : MDEV-15676 - Wrong result; modified in 10.4.12 -main.dyncol : MDEV-19455 - Extra warning -main.engine_error_in_alter-8453 : Modified in 10.4.12 -main.error_simulation : Modified in 10.4.12 -main.events_2 : MDEV-13277 - Crash -main.events_bugs : MDEV-12892 - Crash; modified in 10.4.12 -main.events_restart : MDEV-12236 - Server shutdown problem -main.events_slowlog : MDEV-12821 - Wrong result -main.flush : MDEV-19368 - mysqltest failed but provided no output -main.flush_ssl : MDEV-21276 - Aria recovery failure -main.foreign_key : Modified in 10.4.12 -main.func_math : MDEV-20966 - Wrong error code; modified in 10.4.12 -main.func_misc : Modified in 10.4.12 -main.func_regexp_pcre : Modified in 10.4.12 -main.func_regexp_pcre_debug : Modified in 10.4.12 -main.func_time : Modified in 10.4.12 -main.gis : MDEV-13411 - wrong result on P8 -main.gis_notembedded : MDEV-21264 - Wrong result with non-default charset -main.group_by : Modified in 10.4.12 -main.having_cond_pushdown : Modified in 10.4.12 -main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown -main.index_intersect_innodb : MDEV-10643 - failed with timeout -main.index_merge_innodb : MDEV-7142 - Plan mismatch -main.innodb_icp : MDEV-20168 - Wrong execution plans -main.innodb_mysql_lock : MDEV-7861 - Wrong result -main.insert_debug : Added in 10.4.12 -main.ipv4_and_ipv6 : MDEV-20964 - Wrong result -main.ipv6 : MDEV-20964 - Wrong result -main.join : Modified in 10.4.12 -main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.4.12 -main.kill-2 : MDEV-13257 - Wrong result -main.kill_processlist-6619 : MDEV-10793 - Wrong result -main.loaddata : MDEV-19368 - mysqltest failed but provided no output -main.locale : MDEV-20521 - Missing warning -main.log_slow : MDEV-13263 - Wrong result -main.log_slow_debug : Modified in 10.4.12 -main.log_tables-big : MDEV-13408 - wrong result -main.log_tables_upgrade : MDEV-20962 - Wrong result -main.mdev-504 : MDEV-15171 - warning -main.mdev375 : MDEV-10607 - sporadic "can't connect" -main.mdev6830 : Modified in 10.4.12 -main.merge : MDEV-10607 - sporadic "can't connect" -main.merge-big : Modified in 10.4.12 -main.merge_debug : Modified in 10.4.12 -main.multi_update_debug : MDEV-20136 - Debug sync point wait timed out -main.myisam_debug : Modified in 10.4.12 -main.mysql : MDEV-20156 - Wrong result -main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; MDEV-19511 - Big endian issue -main.mysql_client_test_comp : MDEV-16641 - Error in exec -main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed -main.mysql_cp932 : MDEV-21275 - Wrong result -main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed -main.mysql_upgrade_no_innodb : MDEV-20537 - Wrong result -main.mysql_upgrade_noengine : MDEV-14355 - Wrong result -main.mysql_upgrade_view : MDEV-20161 - Wrong result -main.mysqladmin : MDEV-20535 - Wrong result -main.mysqlcheck : MDEV-20164 - Wrong result -main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap -main.mysqldump : MDEV-14800 - Stack smashing detected -main.mysqldump-max : MDEV-21272 - Wrong result -main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug -main.mysqlshow : MDEV-20965 - Wrong result -main.mysqlslap : MDEV-11801 - timeout -main.mysqltest : MDEV-13887 - Wrong result -main.old-mode : MDEV-19373 - Wrong result -main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.opt_tvc : Modified in 10.4.12 -main.order_by : Modified in 10.4.11 -main.order_by_optimizer_innodb : MDEV-10683 - Wrong result -main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock -main.partition_innodb : MDEV-20169 - Wrong result -main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings -main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 -main.partition_mrr_aria : Added in 10.4.11 -main.partition_mrr_innodb : Added in 10.4.11 -main.partition_mrr_myisam : Added in 10.4.11 -main.partition_pruning : Modified in 10.4.11 -main.plugin_auth : MDEV-20957 - Upgrade file was not properly created -main.plugin_auth_qa_2 : MDEV-20165 - Wrong result -main.pool_of_threads : MDEV-18135 - SSL error: key too small -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.query_cache : MDEV-16180 - Wrong result -main.query_cache_debug : MDEV-15281 - Query cache is disabled -main.range_innodb : Modified in 10.4.12 -main.range_interrupted-13751 : Modified in 10.4.12 -main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.rowid_filter_innodb : MDEV-20538 - Wrong result; modified in 10.4.12 -main.select : MDEV-20532 - Floating point differences -main.select_debug : Modified in 10.4.12 -main.select_jcl6 : MDEV-20532 - Floating point differences -main.select_pkeycache : MDEV-20532 - Floating point differences -main.selectivity : Modified in 10.4.11 -main.set_statement : MDEV-13183 - Wrong result -main.set_statement_notembedded : MDEV-19414 - Wrong result -main.shm : MDEV-12727 - Mismatch, ERROR 2013 -main.show_explain : MDEV-10674 - Wrong result code; modified in 10.4.12 -main.show_explain_non_select : Modified in 10.4.12 -main.show_explain_ps : Modified in 10.4.12 -main.slowlog_enospace-10508 : Modified in 10.4.12 -main.sp : MDEV-7866 - Mismatch -main.sp-security : MDEV-10607 - sporadic "can't connect" -main.sp_notembedded : MDEV-10607 - internal error -main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_7937 : MDEV-20958 - Wrong result; modified in 10.4.12 -main.ssl_8k_key : Modified in 10.4.12 -main.ssl_ca : MDEV-10895 - SSL connection error on Power -main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 -main.ssl_crl : MDEV-19119 - Wrong error code; modified in 10.4.11 -main.ssl_crl_clients : Modified in 10.4.12 -main.ssl_system_ca : Added in 10.4.12 -main.ssl_timeout : MDEV-11244 - Crash -main.stat_tables-enospc : Modified in 10.4.12 -main.stat_tables_par : MDEV-13266 - Wrong result -main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding -main.status : MDEV-13255 - Wrong result -main.subselect : MDEV-20551 - Valgrind failure -main.subselect_innodb : MDEV-10614 - Wrong result -main.tc_heuristic_recover : MDEV-14189 - Wrong result -main.timezone2 : Modified in 10.4.12 -main.type_blob : MDEV-15195 - Wrong result -main.type_datetime : Modified in 10.4.12 -main.type_datetime_hires : MDEV-10687 - Timeout -main.type_float : MDEV-20532 - Floating point differences -main.type_int : Modified in 10.4.12 -main.type_newdecimal : MDEV-20532 - Floating point differences -main.type_ranges : MDEV-20532 - Floating point differences -main.type_time : Modified in 10.4.12 -main.union_crash-714 : Modified in 10.4.12 -main.userstat : MDEV-12904 - SSL errors -main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query -main.warnings_debug : Modified in 10.4.12 -main.win : Modified in 10.4.12 -main.xa : MDEV-11769 - lock wait timeout +# Based on bb-10.4-release cc5b7fe11f942aaec8b2d6cc0b1142a4d6349f5f +# Fri May 8 17:51:45 2020 +0200 : Merge branch '10.3' into 10.4 + +main.alter_table_trans : MDEV-12084 - timeout +main.alter_user : Modified in 10.4.13 +main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result +main.auth_named_pipe : MDEV-14724 - System error 2 +main.backup_interaction : Modified in 10.4.13 +main.binary_to_hex : MDEV-20211 - Wrong result +main.cache_temporal_4265 : Modified in 10.4.12 +main.column_compression : Modified in 10.4.13 +main.connect : MDEV-17282 - Wrong result +main.connect-abstract : MDEV-20162 - Could not execute 'check-testcase' +main.connect2 : MDEV-13885 - Server crash +main.connect_debug : Modified in 10.4.12 +main.count_distinct2 : MDEV-11768 - timeout +main.create_delayed : MDEV-10605 - failed with timeout +main.create_drop_event : MDEV-16271 - Wrong result +main.create_or_replace2 : Modified in 10.4.12 +main.cte_nonrecursive : Modified in 10.4.13 +main.ctype_cp932_binlog_stm : MDEV-20534 - Wrong result +main.ctype_ucs : MDEV-17681 - Data too long for column +main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade +main.ctype_utf16 : MDEV-10675: timeout or extra warnings +main.ctype_utf16le : MDEV-10675: timeout or extra warnings +main.ctype_utf8mb4_innodb : MDEV-17744 - Timeout; MDEV-18567 - ASAN use-after-poison +main.debug_sync : MDEV-10607 - internal error +main.default_session : Modified in 10.4.12 +main.default_storage_engine : Modified in 10.4.13 +main.delayed : MDEV-20961 - Assertion failure +main.delete_use_source : Modified in 10.4.12 +main.derived_cond_pushdown : MDEV-20532 - Floating point differences; modified in 10.4.13 +main.derived_opt : MDEV-11768 - timeout +main.dirty_close : MDEV-19368 - mysqltest failed but provided no output +main.distinct : MDEV-14194 - Crash +main.drop_bad_db_type : MDEV-15676 - Wrong result; modified in 10.4.12 +main.dyncol : MDEV-19455 - Extra warning +main.engine_error_in_alter-8453 : Modified in 10.4.12 +main.error_simulation : Modified in 10.4.12 +main.errors : Modified in 10.4.13 +main.events_2 : MDEV-13277 - Crash +main.events_bugs : MDEV-12892 - Crash; modified in 10.4.12 +main.events_restart : MDEV-12236 - Server shutdown problem; modified in 10.4.13 +main.events_slowlog : MDEV-12821 - Wrong result +main.failed_auth_3909 : Modified in 10.4.13 +main.failed_auth_unixsocket : Modified in 10.4.13 +main.flush : MDEV-19368 - mysqltest failed but provided no output +main.flush_ssl : MDEV-21276 - Aria recovery failure +main.foreign_key : Modified in 10.4.12 +main.fulltext : Modified in 10.4.13 +main.func_math : MDEV-20966 - Wrong error code; modified in 10.4.13 +main.func_misc : Modified in 10.4.12 +main.func_regexp_pcre : Modified in 10.4.12 +main.func_regexp_pcre_debug : Modified in 10.4.12 +main.func_str : Modified in 10.4.13 +main.func_time : Modified in 10.4.12 +main.gis : MDEV-13411 - wrong result on P8; modified in 10.4.13 +main.gis-rtree : Modified in 10.4.13 +main.gis_notembedded : MDEV-21264 - Wrong result with non-default charset +main.grant : Modified in 10.4.13 +main.grant2 : Modified in 10.4.13 +main.grant5 : Modified in 10.4.13 +main.grant_repair : Added in 10.4.13 +main.group_by : Modified in 10.4.13 +main.having_cond_pushdown : Modified in 10.4.12 +main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown +main.index_intersect_innodb : MDEV-10643 - failed with timeout +main.index_merge_innodb : MDEV-7142 - Plan mismatch +main.index_merge_myisam : Modified in 10.4.13 +main.innodb_icp : MDEV-20168 - Wrong execution plans; include file modified in 10.4.13 +main.innodb_mysql_lock : Modified in 10.4.13 +main.insert_debug : Added in 10.4.12 +main.invisible_field_grant_completely : MDEV-22254 - Syscall param write points to uninitialised bytes +main.ipv4_and_ipv6 : MDEV-20964 - Wrong result +main.ipv6 : MDEV-20964 - Wrong result +main.join : Modified in 10.4.12 +main.join_cache : MDEV-17743 - Bad address from storage engine MyISAM; modified in 10.4.13 +main.key : Modified in 10.4.13 +main.kill-2 : MDEV-13257 - Wrong result +main.kill_processlist-6619 : MDEV-10793 - Wrong result +main.loaddata : MDEV-19368 - mysqltest failed but provided no output +main.locale : MDEV-20521 - Missing warning; configuration added in 10.4.13 +main.lock_user : Modified in 10.4.13 +main.log_slow : MDEV-13263 - Wrong result +main.log_slow_debug : Modified in 10.4.12 +main.log_tables-big : MDEV-13408 - wrong result +main.log_tables_upgrade : MDEV-20962 - Wrong result +main.long_unique_bugs : Modified in 10.4.13 +main.lowercase_fs_off : Modified in 10.4.13 +main.mdev-504 : MDEV-15171 - warning +main.mdev375 : MDEV-10607 - sporadic "can't connect"; modified in 10.4.13 +main.mdev6830 : Modified in 10.4.12 +main.merge : MDEV-10607 - sporadic "can't connect" +main.merge-big : Modified in 10.4.12 +main.merge_debug : Modified in 10.4.12 +main.multi_update : Modified in 10.4.13 +main.multi_update_debug : Modified in 10.4.13 +main.myisam_debug : Modified in 10.4.12 +main.myisam_icp : Include file modified in 10.4.13 +main.mysql : MDEV-20156 - Wrong result +main.mysql_client_test : MDEV-19369 - error: 5888, status: 23, errno: 2; MDEV-19511 - Big endian issue; modified in 10.4.13 +main.mysql_client_test_comp : MDEV-16641 - Error in exec +main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed +main.mysql_cp932 : MDEV-21275 - Wrong result +main.mysql_upgrade : MDEV-20161 - Wrong result; MDEV-20166 - FATAL ERROR: Upgrade failed; modified in 10.4.13 +main.mysql_upgrade-6984 : MDEV-22514 - Wrong result; modified in 10.4.13 +main.mysql_upgrade_no_innodb : MDEV-20537 - Wrong result +main.mysql_upgrade_noengine : MDEV-14355 - Wrong result +main.mysql_upgrade_view : MDEV-20161 - Wrong result +main.mysqladmin : MDEV-20535 - Wrong result +main.mysqlcheck : MDEV-20164 - Wrong result +main.mysqld--defaults-file : Modified in 10.4.13 +main.mysqld_option_err : MDEV-21236 - Wrong error; MDEV-21571 - Crash on bootstrap +main.mysqldump : MDEV-22147 - Wrong result; MDEV-14800 - Stack smashing detected; modified in 10.4.13 +main.mysqldump-max : MDEV-21272 - Wrong result +main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug +main.mysqlshow : MDEV-20965 - Wrong result +main.mysqlslap : MDEV-11801 - timeout +main.mysqltest : MDEV-13887 - Wrong result +main.mysqltest_tracking_info : Modified in 10.4.13 +main.old-mode : MDEV-19373 - Wrong result +main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.opt_trace : Modified in 10.4.13 +main.opt_tvc : Modified in 10.4.12 +main.order_by_optimizer_innodb : MDEV-10683 - Wrong result +main.parser : Modified in 10.4.13 +main.partition_alter : Modified in 10.4.13 +main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock +main.partition_innodb : MDEV-20169 - Wrong result; modified in 10.4.13 +main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings +main.partition_innodb_semi_consistent : MDEV-19411 - Failed to start mysqld.1 +main.partition_innodb_stmt : MDEV-20213 - Server crash +main.partition_mrr_aria : Include file modified in 10.4.13 +main.partition_mrr_innodb : Include file modified in 10.4.13 +main.partition_mrr_myisam : Modified in 10.4.13 +main.partition_range : Modified in 10.4.13 +main.plugin_auth : MDEV-20957 - Upgrade file was not properly created +main.plugin_auth_qa_2 : MDEV-20165 - Wrong result +main.pool_of_threads : MDEV-18135 - SSL error: key too small +main.processlist_notembedded : MDEV-22513 - Timeout in wait_until_count_sessions; modified in 10.4.13 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count +main.ps_grant : Modified in 10.4.13 +main.query_cache : MDEV-16180 - Wrong result +main.query_cache_debug : MDEV-15281 - Query cache is disabled +main.range : Modified in 10.4.13 +main.range_innodb : Modified in 10.4.13 +main.range_interrupted-13751 : Modified in 10.4.12 +main.range_vs_index_merge : Modified in 10.4.13 +main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away +main.rowid_filter : Modified in 10.4.13 +main.rowid_filter_innodb : MDEV-20538 - Wrong result; modified in 10.4.13 +main.rpl_mysql_upgrade_slave_repo_check : Added in 10.4.13 +main.select : MDEV-20532 - Floating point differences +main.select_debug : Modified in 10.4.12 +main.select_jcl6 : MDEV-20532 - Floating point differences +main.select_pkeycache : MDEV-20532 - Floating point differences +main.set_statement : MDEV-13183 - Wrong result +main.set_statement_notembedded : MDEV-19414 - Wrong result +main.shm : MDEV-12727 - Mismatch, ERROR 2013 +main.show_explain : MDEV-10674 - Wrong result code; modified in 10.4.12 +main.show_explain_non_select : Modified in 10.4.12 +main.show_explain_ps : Modified in 10.4.12 +main.slowlog_enospace-10508 : Modified in 10.4.12 +main.sp : MDEV-7866 - Mismatch +main.sp-security : MDEV-10607 - sporadic "can't connect" +main.sp_notembedded : MDEV-10607 - internal error +main.ssl : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.ssl_7937 : MDEV-20958 - Wrong result; modified in 10.4.12 +main.ssl_8k_key : Modified in 10.4.12 +main.ssl_ca : MDEV-10895 - SSL connection error on Power +main.ssl_cipher : MDEV-17184 - Failures with OpenSSL 1.1.1 +main.ssl_crl : MDEV-19119 - Wrong error code +main.ssl_crl_clients : Modified in 10.4.12 +main.ssl_system_ca : Added in 10.4.12 +main.ssl_timeout : MDEV-11244 - Crash +main.stat_tables-enospc : Modified in 10.4.12 +main.stat_tables_par : MDEV-13266 - Wrong result +main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding +main.status : MDEV-13255 - Wrong result +main.subselect : MDEV-20551 - Valgrind failure +main.subselect_innodb : MDEV-10614 - Wrong result +main.subselect_sj2_mat : Modified in 10.4.13 +main.tc_heuristic_recover : MDEV-14189 - Wrong result +main.timezone2 : Modified in 10.4.12 +main.tls_version : MDEV-21965 - SSL connection error; MDEV-21965 - SSL connection error +main.tls_version1 : MDEV-21965 - SSL connection error; MDEV-21965 - SSL connection error +main.type_blob : MDEV-15195 - Wrong result; modified in 10.4.13 +main.type_datetime : Modified in 10.4.12 +main.type_datetime_hires : MDEV-10687 - Timeout +main.type_float : MDEV-20532 - Floating point differences +main.type_int : Modified in 10.4.12 +main.type_newdecimal : MDEV-20532 - Floating point differences +main.type_ranges : MDEV-20532 - Floating point differences +main.type_time : Modified in 10.4.12 +main.union_crash-714 : Modified in 10.4.12 +main.upgrade_MDEV-19650 : Added in 10.4.13 +main.userstat : MDEV-12904 - SSL errors +main.wait_timeout : MDEV-19023 - Lost connection to MySQL server during query +main.warnings_debug : Modified in 10.4.12 +main.win : Modified in 10.4.12 +main.xa : MDEV-11769 - lock wait timeout #----------------------------------------------------------------------- @@ -204,7 +241,8 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed binlog.binlog_commit_wait : MDEV-10150 - Mismatch binlog.binlog_index : Include file modified in 10.2.31 -binlog.binlog_invalid_read_in_rotate : Added in 10.4.12 +binlog.binlog_innodb : MDEV-22516 - Wrong result +binlog.binlog_invalid_read_in_rotate : MDEV-22455 - Server crash; added in 10.4.12 binlog.binlog_ioerr : MDEV-20159 - Assertion failure; include file modified in 10.2.31 binlog.binlog_killed : MDEV-12925 - Wrong result binlog.binlog_max_extension : MDEV-19762 - Crash on shutdown @@ -213,7 +251,7 @@ binlog.binlog_mysqlbinlog_row_myisam : MDEV-20530 - Binary files dif binlog.binlog_parallel_replication_marks_row : Include file modified in 10.4.12 binlog.binlog_parallel_replication_marks_stm_mix : Include file modified in 10.4.12 binlog.binlog_row_binlog : MDEV-20213 - Server crash -binlog.binlog_show_binlog_event_random_pos : Added in 10.4.12 +binlog.binlog_show_binlog_event_random_pos : MDEV-22473 - Server crash; added in 10.4.12 binlog.binlog_stm_binlog : MDEV-20412 - Wrong result binlog.binlog_write_error : Include file Include file modified in 10.2.31 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint @@ -233,16 +271,17 @@ binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't binlog_encryption.encrypted_slave : MDEV-18135 - SSL error: key too small binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed binlog_encryption.multisource : MDEV-20213 - Server crash; MDEV-21289 - Wrong error code -binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash +binlog_encryption.mysqlbinlog : MDEV-20213 - Server crash +binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash; include file include file modified in 10.4.13 binlog_encryption.rpl_checksum : MDEV-16951 - Wrong result; include file modified in 10.4.12 -binlog_encryption.rpl_corruption : MDEV-20159 - Assertion failure; MDEV-20953 - Wrong error code; include file modified in 10.4.12 +binlog_encryption.rpl_corruption : MDEV-20159 - Assertion failure; MDEV-20953 - Wrong error code; include file modified in 10.4.13 binlog_encryption.rpl_gtid_basic : MDEV-16947 - Server failed to start -binlog_encryption.rpl_incident : Include file modified in 10.4.12 +binlog_encryption.rpl_incident : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; include file modified in 10.4.12 binlog_encryption.rpl_init_slave_errors : MDEV-20213 - Server crash; include file modified in 10.4.12 binlog_encryption.rpl_loadfile : MDEV-16645 - Timeout in include binlog_encryption.rpl_mixed_binlog_max_cache_size : MDEV-20956 - Incorrect checksum for freed object binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include; include file modified in 10.4.12 -binlog_encryption.rpl_parallel_ignored_errors : Include file modified in 10.4.12 +binlog_encryption.rpl_parallel_ignored_errors : MDEV-22471 - Slave crash; include file modified in 10.4.12 binlog_encryption.rpl_relayrotate : MDEV-15194 - Timeout binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning; MDEV-20573 - Wrong result @@ -267,6 +306,7 @@ connect.grant2 : Modified in 10.1.44 connect.ini_grant : Modified in 10.1.44 connect.json : MDEV-18135 - SSL error: key too small connect.mysql_grant : Modified in 10.1.44 +connect.mysql_index : Modified in 10.4.13 connect.part_file : MDEV-18135 - SSL error: key too small connect.part_table : MDEV-18135 - SSL error: key too small connect.pivot : MDEV-14803 - Failed to discover table @@ -278,6 +318,10 @@ connect.zip : MDEV-13884 - Wrong result #----------------------------------------------------------------------- +disks.disks_notembedded : MDEV-21587 - Wrong result + +#----------------------------------------------------------------------- + encryption.corrupted_during_recovery : MDEV-20159 - Assertion failure encryption.create_or_replace : MDEV-16115 - Trying to access tablespace encryption.debug_key_management : MDEV-13841 - Timeout @@ -302,7 +346,7 @@ encryption.innodb_encrypt_key_rotation_age : MDEV-19763 - Timeout encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encrypt_log_corruption : MDEV-14379 - Server crash encryption.innodb_encrypt_temporary_tables : MDEV-20142 - Wrong result -encryption.innodb_encryption : MDEV-15675 - Timeout +encryption.innodb_encryption : MDEV-14728 - Unable to get certificate; MDEV-15675 - Timeout encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption_filekeys : MDEV-15673 - Timeout @@ -317,7 +361,8 @@ encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests n #----------------------------------------------------------------------- -engines/funcs.* : Not maintained in timely manner +engines/funcs.* : Not maintained in timely manner +engines/funcs.rpl_row_until : MDEV-22474 - Warning, slaves cannot process events #----------------------------------------------------------------------- @@ -329,12 +374,13 @@ engines/rr_trx.* : MDEV-10998 - Not maintained #----------------------------------------------------------------------- -federated.federated_bug_35333 : MDEV-13410 - Wrong result -federated.federated_bug_585688 : MDEV-14805 - Server crash, MDEV-12907 - Valgrind -federated.federated_innodb : MDEV-10617 - Wrong checksum -federated.federated_partition : MDEV-10417 - Fails on Mips -federated.federated_transactions : MDEV-10617 - Wrong checksum -federated.federatedx : MDEV-10617 - Wrong checksum; modified in 10.4.11 +federated.federated_bug_35333 : MDEV-13410 - Wrong result +federated.federated_bug_585688 : MDEV-14805 - Server crash, MDEV-12907 - Valgrind +federated.federated_innodb : MDEV-10617 - Wrong checksum +federated.federated_partition : MDEV-10417 - Fails on Mips +federated.federated_transactions : MDEV-10617 - Wrong checksum +federated.federatedx : MDEV-10617 - Wrong checksum +federated.federatedx_create_handlers : Modified in 10.4.13 #----------------------------------------------------------------------- @@ -365,37 +411,47 @@ galera_3nodes.* : Suite is not stable yet gcol.gcol_rollback : MDEV-16954 - Unknown storage engine 'InnoDB' gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion gcol.innodb_virtual_debug : MDEV-19114 - Assertion failure -gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.4.12 +gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.4.13 gcol.innodb_virtual_fk_restart : MDEV-17466 - Assertion failure #----------------------------------------------------------------------- innodb.101_compatibility : MDEV-13891 - Wrong result +innodb.alter_algorithm : Modified in 10.4.13 +innodb.alter_algorithm2 : Added in 10.4.13 innodb.alter_copy : MDEV-16181 - Assertion failure innodb.alter_crash : MDEV-16944 - The process cannot access the file innodb.alter_large_dml : MDEV-20148 - Debug sync point wait timed out +innodb.alter_missing_tablespace : Modified in 10.4.13 innodb.alter_not_null_debug : Modified in 10.4.12 innodb.autoinc_persist : MDEV-15282 - Assertion failure innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.blob-crash : MDEV-19298 - Assertion failure innodb.blob-update-debug : Modified in 10.4.12 +innodb.buf_pool_resize_oom : Added in 10.4.13 +innodb.corrupted_during_recovery : Modified in 10.4.13 +innodb.create-index : MDEV-20159 - Assertion failure +innodb.default_row_format_compatibility : MDEV-20159 - Assertion failure innodb.doublewrite : MDEV-12905 - Server crash +innodb.foreign_key : Modified in 10.4.13 +innodb.foreign_key_debug : Added in 10.4.13 innodb.full_crc32_import : Modified in 10.4.12 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure -innodb.ibuf_not_empty : MDEV-19021 - Wrong result; modified in 10.4.11 -innodb.innodb-32k-crash : MDEV-20194 - Extra warnings; modified in 10.4.11 -innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup; modified in 10.4.11 +innodb.ibuf_not_empty : MDEV-19021 - Wrong result +innodb.innodb-32k-crash : MDEV-20194 - Extra warnings +innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-table : MDEV-10619 - Testcase timeout +innodb.innodb-alter-timestamp : Modified in 10.4.13 innodb.innodb-bigblob : MDEV-18655 - ASAN unknown crash -innodb.innodb-blob : MDEV-12053 - Client crash +innodb.innodb-blob : MDEV-12053 - Client crash; modified in 10.4.13 innodb.innodb-change-buffer-recovery : MDEV-19115 - Lost connection to MySQL server during query innodb.innodb-dict : MDEV-20159 - Assertion failure innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash innodb.innodb-index-online : MDEV-14809 - Cannot save statistics -innodb.innodb-mdev-7513 : Modified in 10.4.11 +innodb.innodb-online-alter-gis : MDEV-22071 - Uninitialised value innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result innodb.innodb-page_compression_snappy : MDEV-13644 - Assertion failure @@ -405,10 +461,12 @@ innodb.innodb-replace-debug : Modified in 10.4.12 innodb.innodb-stats-initialize-failure : Modified in 10.4.12 innodb.innodb-table-online : MDEV-13894 - Wrong result innodb.innodb-timeout : MDEV-20159 - Assertion failure -innodb.innodb-wl5522 : MDEV-13644 - Assertion failure -innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno +innodb.innodb-wl5522 : MDEV-13644 - Assertion failure; modified in 10.4.13 +innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno; modified in 10.4.13 innodb.innodb_buffer_pool_dump_pct : MDEV-20139 - Timeout in wait_condition.inc +innodb.innodb_buffer_pool_load_now : Added in 10.4.13 innodb.innodb_buffer_pool_resize : MDEV-16964 - Assertion failure +innodb.innodb_buffer_pool_resize_debug : MDEV-22515 - Timeout in wait_condition; added in 10.4.13 innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure innodb.innodb_bug11754376 : Modified in 10.4.12 innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt @@ -420,10 +478,11 @@ innodb.innodb_bug56947 : Modified in 10.4.12 innodb.innodb_bug59641 : MDEV-13830 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start innodb.innodb_corrupt_bit : Modified in 10.4.12 +innodb.innodb_defrag_concurrent : Modified in 10.4.13 innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full innodb.innodb_information_schema : MDEV-8851 - Wrong result -innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed; modified in 10.4.11 -innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result; modified in 10.4.11 +innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed +innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result innodb.innodb_monitor : MDEV-10939 - Testcase timeout innodb.innodb_mysql : MDEV-19873 - Wrong result innodb.innodb_prefix_index_restart_server : MDEV-20213 - Server crash @@ -432,24 +491,25 @@ innodb.innodb_stats : MDEV-10682 - wrong result innodb.innodb_stats_persistent : MDEV-17745 - Wrong result; MDEV-21567 - Wrong result in execution plan innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait; modified in 10.4.12 +innodb.innodb_sys_var_valgrind : Added in 10.4.13 innodb.innodb_wl6326 : Added in 10.4.12 innodb.innodb_wl6326_big : Added in 10.4.12 innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks -innodb.instant_alter : Modified in 10.4.12 -innodb.instant_alter_bugs : Modified in 10.4.11 -innodb.instant_alter_debug : Modified in 10.4.11 +innodb.instant_alter : Modified in 10.4.13 +innodb.instant_alter_bugs : Modified in 10.4.13 +innodb.instant_alter_charset : Modified in 10.4.13 +innodb.instant_alter_debug : Modified in 10.4.13 innodb.instant_alter_extend : MDEV-20963 - Binary files differ -innodb.instant_alter_limit : Modified in 10.4.11 -innodb.leaf_page_corrupted_during_recovery : MDEV-21572 - Server crash +innodb.instant_alter_index_rename : Modified in 10.4.13 innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start; MDEV-20648 - Assertion failure innodb.log_file : MDEV-20159 - Assertion failure innodb.log_file_name : MDEV-14193 - Exception +innodb.log_file_name_debug : Modified in 10.4.13 innodb.log_file_size : MDEV-15668 - Not found pattern innodb.monitor : MDEV-16179 - Wrong result innodb.page_id_innochecksum : MDEV-20159 - Assertion failure innodb.purge_secondary : MDEV-15681 - Wrong result -innodb.purge_secondary_mdev-16222 : MDEV-20528 - Debug sync point wait timed out innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile @@ -459,55 +519,68 @@ innodb.row_size_error_log_warnings_3 : Modified in 10.4.12 innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-13572 - Wrong result; MDEV-19374 - Server failed to start innodb.temporary_table : MDEV-13265 - Wrong result +innodb.truncate_foreign : MDEV-22511 - Wrong error code innodb.truncate_inject : Modified in 10.2.31 -innodb.undo_log : Modified in 10.4.11 innodb.undo_truncate : MDEV-17340 - Server hung; MDEV-20840 - Sporadic timeout innodb.undo_truncate_recover : MDEV-17679 - Server has gone away; MDEV-19200 - Shutdown fails innodb.update_time : MDEV-14804 - Wrong result innodb.xa_recovery : MDEV-15279 - mysqld got exception +innodb.xa_recovery_debug : Added in 10.4.13 #----------------------------------------------------------------------- innodb_fts.concurrent_insert : Modified in 10.4.12 -innodb_fts.innodb_fts_misc : Modified in 10.4.11 +innodb_fts.innodb_fts_misc : Modified in 10.4.13 innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed -innodb_fts.sync : MDEV-14808 - Wrong result +innodb_fts.misc_debug : Modified in 10.4.13 +innodb_fts.misc_debug2 : Added in 10.4.13 +innodb_fts.stopword : Added in 10.4.13 +innodb_fts.sync : Modified in 10.4.13 innodb_fts.sync_block : Modified in 10.4.12 -innodb_fts.sync_ddl : MDEV-18654 - Assertion failure +innodb_fts.sync_ddl : MDEV-21568 - Errno: 2000; MDEV-18654 - Assertion failure #----------------------------------------------------------------------- innodb_gis.alter_spatial_index : MDEV-13745 - Server crash +innodb_gis.bug16236208 : Modified in 10.4.13 +innodb_gis.bug16266012 : Modified in 10.4.13 +innodb_gis.geometry : Modified in 10.4.13 +innodb_gis.gis_split_inf : Modified in 10.4.13 +innodb_gis.gis_split_nan : MDEV-21678 - Cannot get geometry object innodb_gis.innodb_gis_rtree : MDEV-20213 - Server crash +innodb_gis.point_big : Re-enabled in 10.4.13 innodb_gis.rtree_compress2 : MDEV-16269 - Wrong result innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded innodb_gis.rtree_debug : Modified in 10.4.12 +innodb_gis.rtree_multi_pk : Modified in 10.4.13 innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check innodb_gis.rtree_rollback1 : Modified in 10.4.12 innodb_gis.rtree_rollback2 : Modified in 10.4.12 -innodb_gis.rtree_split : MDEV-14208 - Too many arguments +innodb_gis.rtree_split : MDEV-14208 - Too many arguments; modified in 10.4.13 innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed #----------------------------------------------------------------------- -innodb_zip.bug53591 : Modified in 10.4.11 -innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed; modified in 10.4.12 -innodb_zip.innochecksum : MDEV-14486 - Server failed to shut down -innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings -innodb_zip.prefix_index_liftedlimit : Modified in 10.4.11 -innodb_zip.restart : MDEV-20213 - Server crash -innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2 -innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure -innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket -innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 +innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed; modified in 10.4.12 +innodb_zip.index_large_prefix_4k : MDEV-21679 - Row size too large +innodb_zip.innochecksum : MDEV-14486 - Server failed to shut down +innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings +innodb_zip.recover : MDEV-22512 - Server failed to restart +innodb_zip.restart : MDEV-20213 - Server crash +innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2; modified in 10.4.13 +innodb_zip.wl5522_zip : Modified in 10.4.13 +innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure +innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket +innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 #----------------------------------------------------------------------- maria.aria_pack_mdev14183 : Added in 10.4.12 +maria.icp : Include file modified in 10.4.13 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning @@ -515,36 +588,49 @@ maria.maria-no-logging : MDEV-20196 - Crash on shutdown or server can't start #----------------------------------------------------------------------- -mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result -mariabackup.apply-log-only : MDEV-20135 - Timeout -mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.full_backup : MDEV-16571 - Wrong result -mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future; MDEV-18569 - Table doesn't exist -mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure; modified in 10.4.11 -mariabackup.incremental_encrypted : MDEV-15667 - timeout -mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file -mariabackup.innodb_redo_log_overwrite : Added in 10.4.12 -mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result -mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.partial : MDEV-19298 - Assertion failure -mariabackup.partial_exclude : MDEV-15270 - Error on exec -mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error -mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault -mariabackup.xb_file_key_management : MDEV-16571 - Wrong result -mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown -mariabackup.xb_rocksdb : MDEV-17338 - Server hung on shutdown +mariabackup.* : suite.pm modified in 10.4.13 +mariabackup.absolute_ibdata_paths : MDEV-16571 - Wrong result +mariabackup.apply-log-only : MDEV-20135 - Timeout +mariabackup.backup_lock_wait_timeout : Added in 10.4.13 +mariabackup.create_with_data_directory_during_backup : MDEV-20159 - Assertion failure +mariabackup.data_directory : MDEV-15270 - Error on exec +mariabackup.full_backup : MDEV-16571 - Wrong result +mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future; MDEV-18569 - Table doesn't exist +mariabackup.incremental_backup : MDEV-21222 - Memory allocation failure +mariabackup.incremental_encrypted : MDEV-15667 - timeout +mariabackup.incremental_rocksdb : MDEV-20954 - Cannot access the file +mariabackup.innodb_redo_log_overwrite : Added in 10.4.12 +mariabackup.innodb_xa_rollback : MDEV-22398 - Log sequence number is in the future; added in 10.4.13 +mariabackup.log_checksum_mismatch : MDEV-16571 - Wrong result +mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.partial : MDEV-19298 - Assertion failure +mariabackup.partial_exclude : MDEV-15270 - Error on exec; modified in 10.4.13 +mariabackup.unencrypted_page_compressed : MDEV-18653 - Wrong error +mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault +mariabackup.xb_file_key_management : MDEV-16571 - Wrong result +mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 +mariabackup.xb_partition : MDEV-17584 - Crash upon shutdown +mariabackup.xb_rocksdb : MDEV-17338 - Server hung on shutdown #----------------------------------------------------------------------- -mroonga/storage.column_datetime_32bit_2038 : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha -mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha -mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind -mroonga/storage.repair_table_no_index_file : MDEV-9364 - wrong result, MDEV-14807 - wrong error message +mroonga/storage.column_datetime_32bit_2038 : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha +mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha +mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind +mroonga/storage.optimization_count_skip_index_between : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_index_greater : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_index_greater_equal : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_index_less : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_index_less_equal : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_primary_key_between : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_primary_key_greater : Modified in 10.4.13 +mroonga/storage.optimization_count_skip_primary_key_greater_equal : Modified in 10.4.13 +mroonga/storage.repair_table_no_index_file : MDEV-9364 - wrong result, MDEV-14807 - wrong error message +mroonga/storage.variable_max_n_records_for_estimate_not_found_in_limit : Modified in 10.4.13 #----------------------------------------------------------------------- @@ -575,10 +661,15 @@ optimizer_unfixed_bugs.bug43617 : Modified in 10.4.12 #----------------------------------------------------------------------- +oqgraph.social : MDEV-22280 - Timeout; MDEV-22280 - Timeout + +#----------------------------------------------------------------------- + parts.partition_alter1_1_2_innodb : MDEV-18655 - ASAN unknown crash parts.partition_alter1_1_innodb : MDEV-18655 - ASAN unknown crash parts.partition_alter1_2_innodb : MDEV-18655 - ASAN unknown crash parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query +parts.partition_alter_instant : Added in 10.4.13 parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning parts.partition_basic_innodb : MDEV-20214 - ASAN error @@ -586,7 +677,7 @@ parts.partition_debug : Modified in 10.4.12 parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist; modified in 10.4.12 parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind -parts.partition_special_innodb : MDEV-16942 - Timeout +parts.partition_special_innodb : MDEV-16942 - Timeout; modified in 10.4.13 #----------------------------------------------------------------------- @@ -594,6 +685,7 @@ percona.* : MDEV-10997 - Not maintained #----------------------------------------------------------------------- +perfschema.bad_option_1 : MDEV-21571 - Crash on bootstrap perfschema.connect_attrs : MDEV-17283 - Wrong result perfschema.dml_file_instances : MDEV-15179 - Wrong result perfschema.dml_threads : MDEV-17746 - Wrong errno @@ -635,7 +727,6 @@ perfschema.hostcache_ipv6_nameinfo_noname_deny : Modified in 10.4.12 perfschema.hostcache_ipv6_passwd : Modified in 10.4.12 perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash; modified in 10.4.12 perfschema.hostcache_peer_addr : MDEV-21462 - Test condition timeout; modified in 10.4.12 -perfschema.misc : Modified in 10.4.11 perfschema.pfs_upgrade_event : MDEV-20957 - Wrong result perfschema.pfs_upgrade_func : MDEV-20957 - Upgrade file was not properly created perfschema.pfs_upgrade_proc : MDEV-20533 - Upgrade file was not properly created @@ -651,7 +742,6 @@ perfschema.stage_mdl_function : MDEV-20157 - Wrong result perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders perfschema.stage_mdl_procedure : MDEV-11545 - Missing row perfschema.stage_mdl_table : MDEV-12638 - Wrong result -perfschema.start_server_innodb : MDEV-21573 - Wrong result perfschema.start_server_low_digest : MDEV-21221 - Wrong result perfschema.threads_mysql : MDEV-10677 - Wrong result @@ -661,15 +751,16 @@ perfschema_stress.* : MDEV-10996 - Not maintained #----------------------------------------------------------------------- -period.delete : Modified in 10.4.11 +period.alter : Modified in 10.4.13 +period.update : Modified in 10.4.13 period.versioning : MDEV-20159 - Assertion failure #----------------------------------------------------------------------- plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such -plugins.multiauth : MDEV-20163 - Plugin could not be loaded +plugins.multiauth : MDEV-20163 - Plugin could not be loaded; modified in 10.4.13 plugins.processlist : MDEV-16574 - Wrong result -plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.4.11 +plugins.server_audit : MDEV-14295 - Wrong result; modified in 10.4.13 plugins.thread_pool_server_audit : MDEV-14295 - Wrong result #----------------------------------------------------------------------- @@ -710,141 +801,149 @@ rocksdb_sys_vars.rocksdb_rate_limiter_bytes_per_sec_basic : MDEV-16639 - Crash #----------------------------------------------------------------------- roles.create_and_grant_role : MDEV-11772 - wrong result +roles.grant_revoke_current : Modified in 10.4.13 #----------------------------------------------------------------------- -rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.4.12 -rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server -rpl.create_or_replace_mix : MDEV-20523 - Wrong result -rpl.create_or_replace_statement : MDEV-20523 - Wrong result -rpl.create_select : MDEV-14121 - Assertion failure -rpl.kill_race_condition : Modified in 10.4.12 -rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips -rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log -rpl.rpl_binlog_errors : MDEV-12742 - Crash -rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake -rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master -rpl.rpl_binlog_rollback_cleanup : Added in 10.4.12 -rpl.rpl_bug33931 : Modified in 10.4.12 -rpl.rpl_bug41902 : Modified in 10.4.12 -rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown -rpl.rpl_checksum : Include file modified in 10.2.31 -rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash -rpl.rpl_colSize : MDEV-16112 - Server crash -rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code -rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac -rpl.rpl_ddl : MDEV-10417 - Fails on Mips -rpl.rpl_domain_id_filter : MDEV-20213 - Server crash -rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.4.12 -rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed; modified in 10.4.12 -rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed -rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start -rpl.rpl_dual_pos_advance : MDEV-20213 - Server crash -rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning -rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning -rpl.rpl_flushlog_loop : MDEV-21570 - Server crash -rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_get_master_version_and_clock : Modified in 10.4.12 -rpl.rpl_gtid_basic : MDEV-10681 - server startup problem -rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection -rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout -rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash -rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings -rpl.rpl_gtid_reconnect : MDEV-14497 - Crash; modified in 10.4.12 -rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output -rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings -rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_heartbeat : MDEV-20213 - Server crash -rpl.rpl_heartbeat_debug : Modified in 10.4.12 -rpl.rpl_ignore_grant : MDEV-20159 - Assertion failure -rpl.rpl_ignore_table_update : MDEV-20159 - Assertion failure -rpl.rpl_incident : Include file modified in 10.2.31 -rpl.rpl_init_slave_errors : Include file modified in 10.2.31 -rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips -rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_insert_id : MDEV-15197 - Wrong result -rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure -rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query -rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips -rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object -rpl.rpl_lcase_tblnames_rewrite_db : MDEV-20213 - Server crash -rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog; modified in 10.4.12 -rpl.rpl_mdev-11092 : Modified in 10.4.11 -rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed -rpl.rpl_mdev6020 : MDEV-15272 - Server crash -rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout -rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait -rpl.rpl_parallel : MDEV-10653 - Timeouts -rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed -rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash -rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash -rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.4.12 -rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout -rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result -rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_read_only : MDEV-20159 - Assertion failure -rpl.rpl_relayrotate : MDEV-20213 - Server crash -rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails -rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start -rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_big_table_id : Modified in 10.4.12 -rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking -rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result -rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash -rpl.rpl_row_find_row_debug : Modified in 10.4.12 -rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed -rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed -rpl.rpl_row_index_choice : MDEV-15196 - Slave crash; modified in 10.4.12 -rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x -rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum -rpl.rpl_semi_sync : MDEV-11220 - Wrong result -rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result -rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_gtid_reconnect : Added in 10.4.11 -rpl.rpl_semi_sync_skip_repl : Modified in 10.4.12 -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures -rpl.rpl_semi_sync_wait_no_slave : MDEV-20159 - Assertion failure -rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition -rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result -rpl.rpl_set_null_myisam : MDEV-20213 - Server crash -rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning -rpl.rpl_show_slave_hosts : MDEV-10681 - Crash -rpl.rpl_show_slave_running : Modified in 10.4.12 -rpl.rpl_shutdown_wait_semisync_slaves : MDEV-20213 - Server crash -rpl.rpl_skip_replication : MDEV-13258 - Extra warning -rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock -rpl.rpl_slave_load_in : MDEV-20159 - Assertion failure -rpl.rpl_slave_load_remove_tmpfile : Modified in 10.4.12 -rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning -rpl.rpl_slave_shutdown_mdev20821 : Added in 10.4.12 -rpl.rpl_slow_query_log : MDEV-13250 - Test abort -rpl.rpl_sp_effects : MDEV-13249 - Crash -rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout -rpl.rpl_stm_lcase_tblnames : Modified in 10.4.12 -rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master -rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion -rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.4.12 -rpl.rpl_stop_slave : Modified in 10.4.12 -rpl.rpl_sync : MDEV-13830 - Assertion failure -rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master -rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries -rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output -rpl.rpl_trigger : MDEV-18055 - Wrong result -rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error -rpl.rpl_user_variables : MDEV-20522 - Wrong result -rpl.rpl_variables : MDEV-20150 - Server crash -rpl.rpl_view_debug : Modified in 10.4.12 -rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result -rpl.show_status_stop_slave_race-7126 : MDEV-17438 - Timeout +rpl.circular_serverid0 : MDEV-19372 - ASAN heap-use-after-free; modified in 10.4.13 +rpl.create_or_replace2 : MDEV-19412 - Lost connection to MySQL server +rpl.create_or_replace_mix : MDEV-20523 - Wrong result +rpl.create_or_replace_statement : MDEV-20523 - Wrong result +rpl.create_select : MDEV-14121 - Assertion failure +rpl.kill_race_condition : Modified in 10.4.12 +rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips +rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log +rpl.rpl_binlog_errors : MDEV-12742 - Crash; include file modified in 10.4.13 +rpl.rpl_binlog_grant : MDEV-21274 - Lost connection at handshake +rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master +rpl.rpl_binlog_rollback_cleanup : Added in 10.4.12 +rpl.rpl_bug33931 : Modified in 10.4.12 +rpl.rpl_bug41902 : Configuration deleted in 10.4.13 +rpl.rpl_cant_read_event_incident : MDEV-20960 - Abort on shutdown +rpl.rpl_checksum : Include file modified in 10.2.31 +rpl.rpl_checksum_cache : MDEV-22510 - Server crash +rpl.rpl_circular_for_4_hosts : MDEV-20536 - Server crash +rpl.rpl_colSize : MDEV-16112 - Server crash +rpl.rpl_conditional_comments : Modified in 10.4.13 +rpl.rpl_corruption : MDEV-20527 - Slave stopped with wrong error code; include file modified in 10.4.13 +rpl.rpl_create_tmp_table_if_not_exists : MDEV-20159 - Assertion failure +rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac +rpl.rpl_ddl : MDEV-10417 - Fails on Mips +rpl.rpl_domain_id_filter : MDEV-20213 - Server crash +rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash; modified in 10.4.13 +rpl.rpl_domain_id_filter_master_crash : MDEV-19043 - Table marked as crashed; modified in 10.4.12 +rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result; MDEV-19043 - Table marked as crashed +rpl.rpl_drop_db_fail : MDEV-16898 - Slave fails to start +rpl.rpl_dual_pos_advance : MDEV-20213 - Server crash +rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning +rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning +rpl.rpl_fail_register : MDEV-22472 - Wrong result; added in 10.4.13 +rpl.rpl_flushlog_loop : MDEV-21570 - Server crash +rpl.rpl_get_lock : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_get_master_version_and_clock : Re-enabled in 10.4.13; include file modified in 10.4.13 +rpl.rpl_gtid_basic : MDEV-10681 - server startup problem +rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection +rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout +rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash +rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings +rpl.rpl_gtid_reconnect : MDEV-14497 - Crash; modified in 10.4.12 +rpl.rpl_gtid_startpos : MDEV-20141 - mysqltest failed but provided no output +rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings +rpl.rpl_gtid_strict : Modified in 10.4.13 +rpl.rpl_gtid_until : MDEV-10625 - warnings in error log +rpl.rpl_heartbeat : MDEV-20213 - Server crash +rpl.rpl_heartbeat_debug : Modified in 10.4.12 +rpl.rpl_ignore_grant : MDEV-20159 - Assertion failure +rpl.rpl_ignore_table : Modified in 10.4.13 +rpl.rpl_ignore_table_update : MDEV-20159 - Assertion failure +rpl.rpl_incident : Include file modified in 10.2.31 +rpl.rpl_init_slave_errors : Include file modified in 10.2.31 +rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips +rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure +rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query +rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_ipv4_as_ipv6 : MDEV-20147 - Incorrect checksum for freed object +rpl.rpl_lcase_tblnames_rewrite_db : MDEV-20213 - Server crash +rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog; modified in 10.4.12 +rpl.rpl_mdev12179 : MDEV-19043 - Table marked as crashed +rpl.rpl_mdev6020 : MDEV-15272 - Server crash +rpl.rpl_mixed_mixing_engines : MDEV-21266 - Timeout +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait +rpl.rpl_parallel : MDEV-10653 - Timeouts +rpl.rpl_parallel2 : MDEV-17390 - Operation cannot be performed +rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash +rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure +rpl.rpl_parallel_multilevel : MDEV-20160 - Server crash +rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.4.12 +rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout +rpl.rpl_parallel_temptable : MDEV-10356 - Crash; MDEV-19076 - Wrong result +rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips +rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings +rpl.rpl_plugin_load : MDEV-20213 - Server crash +rpl.rpl_read_only : MDEV-20159 - Assertion failure +rpl.rpl_relayrotate : MDEV-20213 - Server crash +rpl.rpl_row_001 : MDEV-16653 - MTR's internal check fails +rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start +rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_big_table_id : Modified in 10.4.12 +rpl.rpl_row_corruption : MDEV-21569 - mutex: LOCK_global_system_variables unlocking; modified in 10.4.13 +rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result +rpl.rpl_row_end_of_statement_loss : MDEV-21237 - Server crash +rpl.rpl_row_find_row_debug : Modified in 10.4.12 +rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed +rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_index_choice : MDEV-15196 - Slave crash; modified in 10.4.12 +rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x +rpl.rpl_row_until : MDEV-14052 - Master will not send events with checksum +rpl.rpl_semi_sync : MDEV-11220 - Wrong result +rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result +rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings +rpl.rpl_semi_sync_skip_repl : Modified in 10.4.12 +rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Assorted failures +rpl.rpl_semi_sync_wait_no_slave : MDEV-20159 - Assertion failure +rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition +rpl.rpl_semisync_ali_issues : MDEV-16272 - Wrong result +rpl.rpl_set_null_myisam : MDEV-20213 - Server crash +rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning +rpl.rpl_show_slave_hosts : MDEV-10681 - Crash +rpl.rpl_show_slave_running : Modified in 10.4.12 +rpl.rpl_shutdown_wait_semisync_slaves : MDEV-20213 - Server crash +rpl.rpl_shutdown_wait_slaves : MDEV-22517 - Timeout on sync_with_master +rpl.rpl_skip_replication : MDEV-13258 - Extra warning +rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock +rpl.rpl_slave_load_in : MDEV-20159 - Assertion failure +rpl.rpl_slave_load_remove_tmpfile : Modified in 10.4.12 +rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning +rpl.rpl_slave_shutdown_mdev20821 : Added in 10.4.12 +rpl.rpl_slow_query_log : MDEV-13250 - Test abort +rpl.rpl_sp_effects : MDEV-13249 - Crash +rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout +rpl.rpl_stm_lcase_tblnames : Modified in 10.4.12 +rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master +rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion +rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash; include file modified in 10.4.13 +rpl.rpl_stop_slave : Modified in 10.4.12 +rpl.rpl_sync : MDEV-13830 - Assertion failure +rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master +rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_test_framework : MDEV-19368 - mysqltest failed but provided no output +rpl.rpl_trigger : MDEV-18055 - Wrong result +rpl.rpl_truncate_3innodb : MDEV-19454 - Syntax error +rpl.rpl_upgrade_master_info : MDEV-16567 - Assertion failure +rpl.rpl_user_variables : MDEV-20522 - Wrong result +rpl.rpl_variables : MDEV-20150 - Server crash +rpl.rpl_view_debug : Modified in 10.4.12 +rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result +rpl.show_status_stop_slave_race-7126 : MDEV-17438 - Timeout #----------------------------------------------------------------------- @@ -865,9 +964,8 @@ sphinx.union-5539 : MDEV-10986 - Sporadic failures #----------------------------------------------------------------------- -spider.* : MDEV-9329, MDEV-18737 - tests are too memory-consuming -spider.basic_sql : MDEV-11186 - Internal check fails -spider.pushdown_not_like : Added in 10.3.21 +spider.* : MDEV-9329, MDEV-18737 - tests are too memory-consuming +spider.basic_sql : MDEV-11186 - Internal check fails #----------------------------------------------------------------------- @@ -883,8 +981,10 @@ spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x #----------------------------------------------------------------------- -spider/bugfix.return_found_rows_insert : Added in 10.4.11 -spider/bugfix.return_found_rows_update : Added in 10.4.11 +spider/bugfix.mdev_20502 : Added in 10.4.13 +spider/bugfix.mdev_21884 : Added in 10.4.13 +spider/bugfix.return_found_rows_insert : Modified in 10.4.13 +spider/bugfix.return_found_rows_update : Modified in 10.4.13 #----------------------------------------------------------------------- @@ -892,39 +992,8 @@ spider/handler.* : MDEV-10987, MDEV-10990 - Tests have not been maintained #----------------------------------------------------------------------- -spider/regression/e1121.load_data_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_ddi1 : Added in 10.4.11 -spider/regression/e1121.load_data_ignore_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_ignore_ddi1 : Added in 10.4.11 -spider/regression/e1121.load_data_local_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_local_ddi1 : Added in 10.4.11 -spider/regression/e1121.load_data_local_ignore_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_local_ignore_ddi1 : Added in 10.4.11 -spider/regression/e1121.load_data_local_replace_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_local_replace_ddi1 : Added in 10.4.11 -spider/regression/e1121.load_data_replace_ddi0 : Added in 10.4.11 -spider/regression/e1121.load_data_replace_ddi1 : Added in 10.4.11 - -#----------------------------------------------------------------------- - -spider/regression/e112122.load_data_part_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_ddi1 : Added in 10.4.11 -spider/regression/e112122.load_data_part_ignore_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_ignore_ddi1 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_ddi1 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_ignore_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_ignore_ddi1 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_replace_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_local_replace_ddi1 : Added in 10.4.11 -spider/regression/e112122.load_data_part_replace_ddi0 : Added in 10.4.11 -spider/regression/e112122.load_data_part_replace_ddi1 : Added in 10.4.11 - -#----------------------------------------------------------------------- - sql_sequence.concurrent_create : MDEV-16635 - Server crash -sql_sequence.rebuild : Added in 10.4.11 -sql_sequence.view : Modified in 10.4.11 +sql_sequence.rebuild : Modified in 10.4.13 #----------------------------------------------------------------------- @@ -936,12 +1005,14 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout #----------------------------------------------------------------------- +sys_vars.alter_algorithm_basic : Added in 10.4.13 sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.debug_dbug_func : Modified in 10.4.12 sys_vars.host_cache_size_auto : MDEV-20112 - Wrong result sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error sys_vars.innodb_buffer_pool_size_basic : Modified in 10.4.12 sys_vars.innodb_checksum_algorithm_basic : MDEV-21568 - Errno: 2000 +sys_vars.innodb_instant_alter_column_allowed_basic : Added in 10.4.13 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion @@ -971,6 +1042,7 @@ tokudb.locks-select-update-1 : MDEV-13406 - Lock wait timeout tokudb.rows-32m-rand-insert : MDEV-12640 - Crash tokudb.rows-32m-seq-insert : MDEV-12640 - Crash tokudb.savepoint-5 : MDEV-15280 - Wrong result +tokudb.type_blob : Modified in 10.4.13 tokudb.type_datetime : MDEV-15193 - Wrong result #----------------------------------------------------------------------- @@ -989,6 +1061,8 @@ tokudb_bugs.frm_store : MDEV-12823 - Valgrind tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind tokudb_bugs.xa : MDEV-11804 - Lock wait timeout +tokudb_bugs.xa-3 : MDEV-22512 - Server failed to restart +tokudb_bugs.xa-4 : MDEV-22512 - Server failed to restart #----------------------------------------------------------------------- @@ -1022,16 +1096,15 @@ vcol.vcol_misc : MDEV-16651 - Wrong error message #----------------------------------------------------------------------- -versioning.delete : Modified in 10.4.11 -versioning.partition : Modified in 10.4.11 -versioning.select : Modified in 10.4.11 -versioning.trx_id : Modified in 10.4.12 -versioning.update : MDEV-20955 - Wrong result code; modified in 10.4.11 -versioning.view : Modified in 10.4.11 +versioning.alter : Modified in 10.4.13 +versioning.partition : Modified in 10.4.13 +versioning.sysvars : Modified in 10.4.13 +versioning.update : MDEV-22475 - Wrong result code; modified in 10.4.13 #----------------------------------------------------------------------- -wsrep.* : Config file modified in 10.4.12 +wsrep.* : suite.pm modified in 10.4.13 +wsrep.MDEV-20625 : Added in 10.4.13 wsrep.alter_table_innodb : Configuration deleted in 10.4.12 wsrep.binlog_format : Configuration added in 10.4.12 wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node @@ -1041,9 +1114,10 @@ wsrep.mysql_tzinfo_to_sql_symlink : Modified in 10.4.12 wsrep.mysql_tzinfo_to_sql_symlink_skip : Modified in 10.4.12 wsrep.plugin : Modified in 10.4.12 wsrep.pool_of_threads : MDEV-17345 - WSREP has not yet prepared node for application use; re-enabled in 10.4.12 -wsrep.trans : Configuration added in 10.4.12 +wsrep.trans : Modified in 10.4.13 wsrep.variables : MDEV-17585 - Deadlock; modified in 10.4.12 #----------------------------------------------------------------------- -wsrep_info.* : Config file modified in 10.3.22 +wsrep_info.* : suite.pm modified in 10.4.13 +wsrep_info.plugin : MDEV-22470 - WSREP: no nodes coming from prim view, prim not possible diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc index 02770644259..e512eee9066 100644 --- a/mysys_ssl/my_crypt.cc +++ b/mysys_ssl/my_crypt.cc @@ -18,7 +18,9 @@ #include <my_global.h> #include <string.h> +#define template _template /* bug in WolfSSL 4.4.0, see also violite.h */ #include <openssl/evp.h> +#undef template #include <openssl/aes.h> #include <openssl/err.h> #include <openssl/rand.h> diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index f1b95e7d91e..28a194927e9 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -43,6 +43,7 @@ IF(HAVE_PAM_APPL_H) IF(INSTALL_PAMDIR) INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server) INSTALL(FILES mapper/user_map.conf DESTINATION ${INSTALL_PAMDATADIR} COMPONENT Server) + SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST} "%config(noreplace) ${INSTALL_PAMDATADIR}/*" PARENT_SCOPE) ENDIF() ENDIF() ENDIF(HAVE_PAM_APPL_H) diff --git a/scripts/maria_add_gis_sp.sql.in b/scripts/maria_add_gis_sp.sql.in index 412b83e3d78..682cf52de22 100644 --- a/scripts/maria_add_gis_sp.sql.in +++ b/scripts/maria_add_gis_sp.sql.in @@ -23,12 +23,12 @@ SET sql_mode=''; DROP PROCEDURE IF EXISTS AddGeometryColumn; DROP PROCEDURE IF EXISTS DropGeometryColumn; -CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), +CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER begin set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end @ADD_GIS_SP_EOL@ -CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), +CREATE DEFINER=`mariadb.sys`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64), t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER begin set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end @ADD_GIS_SP_EOL@ diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 29f2a4c1ef6..6e1377660e9 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -33,9 +33,17 @@ CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db c -- Remember for later if db table already existed set @had_db_table= @@warning_count != 0; -CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User char(80) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY Host (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +CREATE TABLE IF NOT EXISTS global_priv (Host char(60) binary DEFAULT '', User char(80) binary DEFAULT '', Priv JSON NOT NULL DEFAULT '{}' CHECK(JSON_VALID(Priv)), PRIMARY KEY (Host,User)) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -CREATE DEFINER=root@localhost SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT +set @had_sys_user= 0 <> (select count(*) from mysql.global_priv where Host="localhost" and User="mariadb.sys"); + +CREATE TEMPORARY TABLE tmp_user_sys LIKE global_priv; +INSERT INTO tmp_user_sys (Host,User,Priv) VALUES ('localhost','mariadb.sys','{"access":0,"plugin":"mysql_native_password","authentication_string":"","account_locked":true,"password_last_changed":0}'); +INSERT INTO global_priv SELECT * FROM tmp_user_sys WHERE NOT @had_sys_user; +DROP TABLE tmp_user_sys; + + +CREATE DEFINER='mariadb.sys'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS user AS SELECT Host, User, IF(JSON_VALUE(Priv, '$.plugin') IN ('mysql_native_password', 'mysql_old_password'), IFNULL(JSON_VALUE(Priv, '$.authentication_string'), ''), '') AS Password, @@ -101,6 +109,11 @@ CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', H CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TEMPORARY TABLE tmp_user_sys LIKE tables_priv; +INSERT INTO tmp_user_sys (Host,Db,User,Table_name,Grantor,Timestamp,Table_priv) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0','Select,Update,Delete'); +INSERT INTO tables_priv SELECT * FROM tmp_user_sys WHERE NOT @had_sys_user; +DROP TABLE tmp_user_sys; + CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 8faf7bcaf14..c68aa1e4103 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -808,4 +808,9 @@ IF 'BASE TABLE' = (select table_type from information_schema.tables where table_ FROM user; DROP TABLE user; END IF// + +IF 1 = (SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def' and TABLE_SCHEMA = 'mysql' and TABLE_NAME='user' and DEFINER = 'root@localhost') THEN + DROP VIEW IF EXISTS mysql.user; +END IF// + DELIMITER ; diff --git a/sql/handler.cc b/sql/handler.cc index c371da22a87..a7e7e2554cb 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -5970,22 +5970,22 @@ int handler::compare_key2(key_range *range) const /** ICP callback - to be called by an engine to check the pushed condition */ -extern "C" enum icp_result handler_index_cond_check(void* h_arg) +extern "C" check_result_t handler_index_cond_check(void* h_arg) { handler *h= (handler*)h_arg; THD *thd= h->table->in_use; - enum icp_result res; + check_result_t res; enum thd_kill_levels abort_at= h->has_transactions() ? THD_ABORT_SOFTLY : THD_ABORT_ASAP; if (thd_kill_level(thd) > abort_at) - return ICP_ABORTED_BY_USER; + return CHECK_ABORTED_BY_USER; if (h->end_range && h->compare_key2(h->end_range) > 0) - return ICP_OUT_OF_RANGE; + return CHECK_OUT_OF_RANGE; h->increment_statistics(&SSV::ha_icp_attempts); - if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) == - ICP_MATCH) + if ((res= h->pushed_idx_cond->val_int()? CHECK_POS : CHECK_NEG) == + CHECK_POS) h->increment_statistics(&SSV::ha_icp_match); return res; } @@ -5996,12 +5996,30 @@ extern "C" enum icp_result handler_index_cond_check(void* h_arg) keys of the rows whose data is to be fetched against the used rowid filter */ -extern "C" int handler_rowid_filter_check(void *h_arg) +extern "C" +check_result_t handler_rowid_filter_check(void *h_arg) { handler *h= (handler*) h_arg; TABLE *tab= h->get_table(); + + /* + Check for out-of-range and killed conditions only if we haven't done it + already in the pushed index condition check + */ + if (!h->pushed_idx_cond) + { + THD *thd= h->table->in_use; + enum thd_kill_levels abort_at= h->has_transactions() ? + THD_ABORT_SOFTLY : THD_ABORT_ASAP; + if (thd_kill_level(thd) > abort_at) + return CHECK_ABORTED_BY_USER; + + if (h->end_range && h->compare_key2(h->end_range) > 0) + return CHECK_OUT_OF_RANGE; + } + h->position(tab->record[0]); - return h->pushed_rowid_filter->check((char *) h->ref); + return h->pushed_rowid_filter->check((char*)h->ref)? CHECK_POS: CHECK_NEG; } diff --git a/sql/handler.h b/sql/handler.h index 756481f06bb..c764915cc51 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2913,9 +2913,9 @@ public: {} }; -extern "C" enum icp_result handler_index_cond_check(void* h_arg); +extern "C" check_result_t handler_index_cond_check(void* h_arg); -extern "C" int handler_rowid_filter_check(void* h_arg); +extern "C" check_result_t handler_rowid_filter_check(void* h_arg); extern "C" int handler_rowid_filter_is_active(void* h_arg); uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map); @@ -4837,7 +4837,8 @@ public: virtual void set_lock_type(enum thr_lock_type lock); - friend enum icp_result handler_index_cond_check(void* h_arg); + friend check_result_t handler_index_cond_check(void* h_arg); + friend check_result_t handler_rowid_filter_check(void *h_arg); /** Find unique record by index or unique constrain diff --git a/sql/rowid_filter.cc b/sql/rowid_filter.cc index 6ab9e40de32..9faab828871 100644 --- a/sql/rowid_filter.cc +++ b/sql/rowid_filter.cc @@ -469,6 +469,14 @@ TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no, covering_keys.is_set(access_key_no)) return 0; + // Disallow use of range filter if the key contains partially-covered + // columns. + for (uint i= 0; i < key_info[access_key_no].usable_key_parts; i++) + { + if (key_info[access_key_no].key_part[i].field->type() == MYSQL_TYPE_BLOB) + return 0; + } + /* Currently we do not support usage of range filters if the table is accessed by the clustered primary key. It does not make sense diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 8298ae8dedc..ae9eda628a8 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -1230,7 +1230,7 @@ void Session_tracker::store(THD *thd, String *buf) if ((size= net_length_size(length)) != 1) { - if (buf->reserve(size - 1, EXTRA_ALLOC)) + if (buf->reserve(size - 1, 0)) { buf->length(start); // it is safer to have 0-length block in case of error return; @@ -1240,6 +1240,7 @@ void Session_tracker::store(THD *thd, String *buf) The 'buf->reserve()' can change the buf->ptr() so we cannot calculate the 'data' earlier. */ + buf->length(buf->length() + (size - 1)); data= (uchar *)(buf->ptr() + start); memmove(data + (size - 1), data, length); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 284534eee9b..529dd815b51 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4870,10 +4870,19 @@ bool Lock_tables_prelocking_strategy:: handle_table(THD *thd, Query_tables_list *prelocking_ctx, TABLE_LIST *table_list, bool *need_prelocking) { + TABLE_LIST **last= prelocking_ctx->query_tables_last; + if (DML_prelocking_strategy::handle_table(thd, prelocking_ctx, table_list, need_prelocking)) return TRUE; + /* + normally we don't need to open FK-prelocked tables for RESTRICT, + MDL is enough. But under LOCK TABLES we have to open everything + */ + for (TABLE_LIST *tl= *last; tl; tl= tl->next_global) + tl->open_strategy= TABLE_LIST::OPEN_NORMAL; + /* We rely on a caller to check that table is going to be changed. */ DBUG_ASSERT(table_list->lock_type >= TL_WRITE_ALLOW_WRITE); diff --git a/sql/table.h b/sql/table.h index e9bbd1d6966..90a46db355d 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2109,6 +2109,9 @@ struct TABLE_LIST OT_BASE_ONLY); belong_to_view= belong_to_view_arg; trg_event_map= trg_event_map_arg; + /* MDL is enough for read-only FK checks, we don't need the table */ + if (prelocking_type == PRELOCK_FK && lock_type < TL_WRITE_ALLOW_WRITE) + open_strategy= OPEN_STUB; **last_ptr= this; prev_global= *last_ptr; diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 490dc726f0f..394689225e5 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -3877,9 +3877,9 @@ exhausted: /*********************************************************************//** Check a pushed-down index condition. -@return ICP_NO_MATCH, ICP_MATCH, or ICP_OUT_OF_RANGE */ +@return CHECK_NEG, CHECK_POS, or CHECK_OUT_OF_RANGE */ static -ICP_RESULT +check_result_t row_search_idx_cond_check( /*======================*/ byte* mysql_rec, /*!< out: record @@ -3897,7 +3897,7 @@ row_search_idx_cond_check( if (!prebuilt->idx_cond) { if (!handler_rowid_filter_is_active(prebuilt->pk_filter)) { - return(ICP_MATCH); + return(CHECK_POS); } } else { MONITOR_INC(MONITOR_ICP_ATTEMPTS); @@ -3922,7 +3922,7 @@ row_search_idx_cond_check( rec, prebuilt->index, offsets, templ->icp_rec_field_no, templ)) { - return(ICP_NO_MATCH); + return(CHECK_NEG); } } @@ -3932,12 +3932,12 @@ row_search_idx_cond_check( index, if the case of the column has been updated in the past, or a record has been deleted and a record inserted in a different case. */ - ICP_RESULT result = prebuilt->idx_cond + check_result_t result = prebuilt->idx_cond ? handler_index_cond_check(prebuilt->idx_cond) - : ICP_MATCH; + : CHECK_POS; switch (result) { - case ICP_MATCH: + case CHECK_POS: if (handler_rowid_filter_is_active(prebuilt->pk_filter)) { ut_ad(!prebuilt->index->is_primary()); if (prebuilt->clust_index_was_generated) { @@ -3952,9 +3952,18 @@ row_search_idx_cond_check( ut_ad(len == DATA_ROW_ID_LEN); memcpy(prebuilt->row_id, data, DATA_ROW_ID_LEN); } - if (!handler_rowid_filter_check(prebuilt->pk_filter)) { - MONITOR_INC(MONITOR_ICP_MATCH); - return(ICP_NO_MATCH); + result = handler_rowid_filter_check(prebuilt->pk_filter); + switch (result) { + case CHECK_NEG: + MONITOR_INC(MONITOR_ICP_NO_MATCH); + return(result); + case CHECK_OUT_OF_RANGE: + MONITOR_INC(MONITOR_ICP_OUT_OF_RANGE); + return(result); + case CHECK_POS: + break; + default: + ut_error; } } /* Convert the remaining fields to MySQL format. @@ -3966,19 +3975,19 @@ row_search_idx_cond_check( mysql_rec, prebuilt, rec, NULL, false, prebuilt->index, offsets)) { ut_ad(dict_index_is_clust(prebuilt->index)); - return(ICP_NO_MATCH); + return(CHECK_NEG); } } MONITOR_INC(MONITOR_ICP_MATCH); return(result); - case ICP_NO_MATCH: + case CHECK_NEG: MONITOR_INC(MONITOR_ICP_NO_MATCH); return(result); - case ICP_OUT_OF_RANGE: + case CHECK_OUT_OF_RANGE: MONITOR_INC(MONITOR_ICP_OUT_OF_RANGE); return(result); - case ICP_ERROR: - case ICP_ABORTED_BY_USER: + case CHECK_ERROR: + case CHECK_ABORTED_BY_USER: return(result); } @@ -4414,12 +4423,12 @@ row_search_mvcc( switch (row_search_idx_cond_check( buf, prebuilt, rec, offsets)) { - case ICP_NO_MATCH: - case ICP_OUT_OF_RANGE: - case ICP_ABORTED_BY_USER: - case ICP_ERROR: + case CHECK_NEG: + case CHECK_OUT_OF_RANGE: + case CHECK_ABORTED_BY_USER: + case CHECK_ERROR: goto shortcut_mismatch; - case ICP_MATCH: + case CHECK_POS: goto shortcut_match; } } @@ -5198,14 +5207,14 @@ no_gap_lock: index entry. */ switch (row_search_idx_cond_check( buf, prebuilt, rec, offsets)) { - case ICP_NO_MATCH: + case CHECK_NEG: goto next_rec; - case ICP_OUT_OF_RANGE: - case ICP_ABORTED_BY_USER: - case ICP_ERROR: + case CHECK_OUT_OF_RANGE: + case CHECK_ABORTED_BY_USER: + case CHECK_ERROR: err = DB_RECORD_NOT_FOUND; goto idx_cond_failed; - case ICP_MATCH: + case CHECK_POS: goto requires_clust_rec; } @@ -5255,17 +5264,17 @@ locks_ok_del_marked: /* Check if the record matches the index condition. */ switch (row_search_idx_cond_check(buf, prebuilt, rec, offsets)) { - case ICP_NO_MATCH: + case CHECK_NEG: if (did_semi_consistent_read) { row_unlock_for_mysql(prebuilt, TRUE); } goto next_rec; - case ICP_OUT_OF_RANGE: - case ICP_ABORTED_BY_USER: - case ICP_ERROR: + case CHECK_OUT_OF_RANGE: + case CHECK_ABORTED_BY_USER: + case CHECK_ERROR: err = DB_RECORD_NOT_FOUND; goto idx_cond_failed; - case ICP_MATCH: + case CHECK_POS: break; } diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index ef0ceb1cd32..f6b00420c9c 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -32,7 +32,7 @@ #define HA_RECOVER_QUICK 8 /* Don't check rows in data file */ C_MODE_START -ICP_RESULT index_cond_func_maria(void *arg); +check_result_t index_cond_func_maria(void *arg); C_MODE_END extern TYPELIB maria_recover_typelib; @@ -187,7 +187,7 @@ public: int find_unique_row(uchar *record, uint unique_idx); private: DsMrr_impl ds_mrr; - friend ICP_RESULT index_cond_func_maria(void *arg); + friend check_result_t index_cond_func_maria(void *arg); friend void reset_thd_trn(THD *thd); }; diff --git a/storage/maria/ma_key.c b/storage/maria/ma_key.c index 9e804a1e9dc..5061f3d0143 100644 --- a/storage/maria/ma_key.c +++ b/storage/maria/ma_key.c @@ -666,20 +666,20 @@ int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos) will look for column values there) RETURN - ICP_ERROR Error ; my_errno set to HA_ERR_CRASHED - ICP_NO_MATCH Index condition is not satisfied, continue scanning - ICP_MATCH Index condition is satisfied - ICP_OUT_OF_RANGE Index condition is not satisfied, end the scan. + CHECK_ERROR Error ; my_errno set to HA_ERR_CRASHED + CHECK_NEG Index condition is not satisfied, continue scanning + CHECK_POS Index condition is satisfied + CHECK_OUT_OF_RANGE Index condition is not satisfied, end the scan. my_errno set to HA_ERR_END_OF_FILE - info->cur_row.lastpos is set to HA_OFFSET_ERROR in case of ICP_ERROR or - ICP_OUT_OF_RANGE to indicate that we don't have any active row. + info->cur_row.lastpos is set to HA_OFFSET_ERROR in case of CHECK_ERROR or + CHECK_OUT_OF_RANGE to indicate that we don't have any active row. */ -ICP_RESULT ma_check_index_cond(register MARIA_HA *info, uint keynr, - uchar *record) +check_result_t ma_check_index_cond(register MARIA_HA *info, uint keynr, + uchar *record) { - ICP_RESULT res= ICP_MATCH; + check_result_t res= CHECK_POS; if (info->index_cond_func) { if (_ma_put_key_in_record(info, keynr, FALSE, record)) @@ -688,10 +688,10 @@ ICP_RESULT ma_check_index_cond(register MARIA_HA *info, uint keynr, maria_print_error(info->s, HA_ERR_CRASHED); info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */ my_errno= HA_ERR_CRASHED; - res= ICP_ERROR; + res= CHECK_ERROR; } else if ((res= info->index_cond_func(info->index_cond_func_arg)) == - ICP_OUT_OF_RANGE) + CHECK_OUT_OF_RANGE) { /* We got beyond the end of scanned range */ info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */ diff --git a/storage/maria/ma_rkey.c b/storage/maria/ma_rkey.c index d19caaf6137..b48b0fc0c6b 100644 --- a/storage/maria/ma_rkey.c +++ b/storage/maria/ma_rkey.c @@ -34,7 +34,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data, HA_KEYSEG *last_used_keyseg; uint32 nextflag; MARIA_KEY key; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; DBUG_ENTER("maria_rkey"); DBUG_PRINT("enter", ("base:%p buf:%p inx: %d search_flag: %d", info, buf, inx, search_flag)); @@ -115,7 +115,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data, not satisfied with an out-of-range condition. */ if ((*share->row_is_visible)(info) && - ((icp_res= ma_check_index_cond(info, inx, buf)) != ICP_NO_MATCH)) + ((check= ma_check_index_cond(info, inx, buf)) != CHECK_NEG)) break; /* The key references a concurrently inserted record. */ @@ -174,7 +174,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data, } } while (!(*share->row_is_visible)(info) || - ((icp_res= ma_check_index_cond(info, inx, buf)) == 0)); + ((check= ma_check_index_cond(info, inx, buf)) == 0)); } else { @@ -186,7 +186,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data, if (info->cur_row.lastpos == HA_OFFSET_ERROR) { - if (icp_res == ICP_OUT_OF_RANGE) + if (check == CHECK_OUT_OF_RANGE) { /* We don't want HA_ERR_END_OF_FILE in this particular case */ my_errno= HA_ERR_KEY_NOT_FOUND; diff --git a/storage/maria/ma_rnext.c b/storage/maria/ma_rnext.c index 5ea90a242fc..6fd6f89139f 100644 --- a/storage/maria/ma_rnext.c +++ b/storage/maria/ma_rnext.c @@ -30,7 +30,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx) uint flag; MARIA_SHARE *share= info->s; MARIA_KEYDEF *keyinfo; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; uint update_mask= HA_STATE_NEXT_FOUND; DBUG_ENTER("maria_rnext"); @@ -107,7 +107,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx) if (!error) { while (!(*share->row_is_visible)(info) || - ((icp_res= ma_check_index_cond(info, inx, buf)) == ICP_NO_MATCH)) + ((check= ma_check_index_cond(info, inx, buf)) == CHECK_NEG)) { /* If we are at the last key on the key page, allow writers to @@ -135,7 +135,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= update_mask; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_ma_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/maria/ma_rnext_same.c b/storage/maria/ma_rnext_same.c index b07967ca9e9..19a950d31bb 100644 --- a/storage/maria/ma_rnext_same.c +++ b/storage/maria/ma_rnext_same.c @@ -30,7 +30,7 @@ int maria_rnext_same(MARIA_HA *info, uchar *buf) int error; uint inx,not_used[2]; MARIA_KEYDEF *keyinfo; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; DBUG_ENTER("maria_rnext_same"); if ((int) (inx= info->lastinx) < 0 || @@ -92,7 +92,7 @@ int maria_rnext_same(MARIA_HA *info, uchar *buf) } /* Skip rows that are inserted by other threads since we got a lock */ if ((info->s->row_is_visible)(info) && - ((icp_res= ma_check_index_cond(info, inx, buf)) != ICP_NO_MATCH)) + ((check= ma_check_index_cond(info, inx, buf)) != CHECK_NEG)) break; } } @@ -102,7 +102,7 @@ int maria_rnext_same(MARIA_HA *info, uchar *buf) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_ma_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/maria/ma_rprev.c b/storage/maria/ma_rprev.c index eebc8cba0c7..15010d962bb 100644 --- a/storage/maria/ma_rprev.c +++ b/storage/maria/ma_rprev.c @@ -28,7 +28,7 @@ int maria_rprev(MARIA_HA *info, uchar *buf, int inx) register uint flag; MARIA_SHARE *share= info->s; MARIA_KEYDEF *keyinfo; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; DBUG_ENTER("maria_rprev"); if ((inx = _ma_check_index(info,inx)) < 0) @@ -58,7 +58,7 @@ int maria_rprev(MARIA_HA *info, uchar *buf, int inx) { my_off_t cur_keypage= info->last_keypage; while (!(*share->row_is_visible)(info) || - ((icp_res= ma_check_index_cond(info, inx, buf)) == ICP_NO_MATCH)) + ((check= ma_check_index_cond(info, inx, buf)) == CHECK_NEG)) { /* If we are at the last (i.e. first?) key on the key page, @@ -86,7 +86,7 @@ int maria_rprev(MARIA_HA *info, uchar *buf, int inx) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= HA_STATE_PREV_FOUND; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_ma_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 3c0574fd783..c89623daea9 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -1433,7 +1433,7 @@ extern my_bool maria_flush_log_for_page_none(PAGECACHE_IO_HOOK_ARGS *args); extern PAGECACHE *maria_log_pagecache; extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func, void *func_arg); -ICP_RESULT ma_check_index_cond(MARIA_HA *info, uint keynr, uchar *record); +check_result_t ma_check_index_cond(MARIA_HA *info, uint keynr, uchar *record); extern my_bool ma_yield_and_check_if_killed(MARIA_HA *info, int inx); extern my_bool ma_killed_standalone(MARIA_HA *); diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 0af4215e8f9..70c99a617f6 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -38,7 +38,7 @@ extern const char *myisam_recover_names[]; extern ulonglong myisam_recover_options; C_MODE_START -ICP_RESULT index_cond_func_myisam(void *arg); +check_result_t index_cond_func_myisam(void *arg); C_MODE_END class ha_myisam: public handler @@ -175,5 +175,5 @@ public: private: DsMrr_impl ds_mrr; - friend ICP_RESULT index_cond_func_myisam(void *arg); + friend check_result_t index_cond_func_myisam(void *arg); }; diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index d1bf903bd46..67cb714e7bf 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -424,7 +424,7 @@ void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t func, void mi_set_rowid_filter_func(MI_INFO *info, rowid_filter_func_t check_func, - rowid_filter_func_t is_active_func, + rowid_filter_is_active_func_t is_active_func, void *func_arg) { info->rowid_filter_func= check_func; diff --git a/storage/myisam/mi_key.c b/storage/myisam/mi_key.c index dd838a05ada..d17eef06969 100644 --- a/storage/myisam/mi_key.c +++ b/storage/myisam/mi_key.c @@ -490,58 +490,83 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf) } +static +int mi_unpack_index_tuple(MI_INFO *info, uint keynr, uchar *record) +{ + if (_mi_put_key_in_record(info, keynr, FALSE, record)) + { + /* Impossible case; Can only happen if bug in code */ + mi_print_error(info->s, HA_ERR_CRASHED); + info->lastpos= HA_OFFSET_ERROR; /* No active record */ + my_errno= HA_ERR_CRASHED; + return 1; + } + return 0; +} + + +static int mi_check_rowid_filter_is_active(MI_INFO *info) +{ + if (info->rowid_filter_is_active_func == NULL) + return 0; + return info->rowid_filter_is_active_func(info->rowid_filter_func_arg); +} + + /* - Save current key tuple to record and call index condition check function + Check the current index tuple: Check ICP condition and/or Rowid Filter SYNOPSIS - mi_check_index_cond() + mi_check_index_tuple() info MyISAM handler keynr Index we're running a scan on record Record buffer to use (it is assumed that index check function will look for column values there) RETURN - ICP_ERROR Error - ICP_NO_MATCH Index condition is not satisfied, continue scanning - ICP_MATCH Index condition is satisfied - ICP_OUT_OF_RANGE Index condition is not satisfied, end the scan. + Check result according to check_result_t definition */ -ICP_RESULT mi_check_index_cond(register MI_INFO *info, uint keynr, - uchar *record) +check_result_t mi_check_index_tuple(MI_INFO *info, uint keynr, uchar *record) { - ICP_RESULT res; - if (_mi_put_key_in_record(info, keynr, FALSE, record)) + int need_unpack= TRUE; + check_result_t res= CHECK_POS; + + if (info->index_cond_func) { - /* Impossible case; Can only happen if bug in code */ - mi_print_error(info->s, HA_ERR_CRASHED); - info->lastpos= HA_OFFSET_ERROR; /* No active record */ - my_errno= HA_ERR_CRASHED; - res= ICP_ERROR; + if (mi_unpack_index_tuple(info, keynr, record)) + res= CHECK_ERROR; + else if ((res= info->index_cond_func(info->index_cond_func_arg)) == + CHECK_OUT_OF_RANGE) + { + /* We got beyond the end of scanned range */ + info->lastpos= HA_OFFSET_ERROR; /* No active record */ + my_errno= HA_ERR_END_OF_FILE; + } + + /* + If we got an error, out-of-range condition, or ICP condition computed to + FALSE - we don't need to check the Rowid Filter. + */ + if (res != CHECK_POS) + return res; + + need_unpack= FALSE; } - else if ((res= info->index_cond_func(info->index_cond_func_arg)) == - ICP_OUT_OF_RANGE) + + /* Check the Rowid Filter, if present */ + if (mi_check_rowid_filter_is_active(info)) { - /* We got beyond the end of scanned range */ - info->lastpos= HA_OFFSET_ERROR; /* No active record */ - my_errno= HA_ERR_END_OF_FILE; + /* Unpack the index tuple if we haven't done it already */ + if (need_unpack && mi_unpack_index_tuple(info, keynr, record)) + res= CHECK_ERROR; + else + res= info->rowid_filter_func(info->rowid_filter_func_arg); } return res; } -int mi_check_rowid_filter(MI_INFO *info) -{ - return info->rowid_filter_func(info->rowid_filter_func_arg); -} - -int mi_check_rowid_filter_is_active(MI_INFO *info) -{ - if (info->rowid_filter_is_active_func == NULL) - return 0; - return info->rowid_filter_is_active_func(info->rowid_filter_func_arg); -} - /* Retrieve auto_increment info diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index 8ef1d917f38..bf6f3ef852c 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -30,7 +30,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, MI_KEYDEF *keyinfo; HA_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; - ICP_RESULT res= ICP_NO_MATCH; + check_result_t res= CHECK_NEG; DBUG_ENTER("mi_rkey"); DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", info, buf, inx, search_flag)); @@ -119,10 +119,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, while ((info->lastpos >= info->state->data_file_length && (search_flag != HA_READ_KEY_EXACT || last_used_keyseg != keyinfo->seg + keyinfo->keysegs)) || - (info->index_cond_func && - (res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) || - (mi_check_rowid_filter_is_active(info) && - !mi_check_rowid_filter(info))) + (res= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG) { uint not_used[2]; /* @@ -162,12 +159,12 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, /* Aborted by user */ DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR && my_errno == HA_ERR_ABORTED_BY_USER); - res= ICP_ERROR; + res= CHECK_ERROR; buf= 0; /* Fast abort */ break; } } - if (res == ICP_OUT_OF_RANGE) + if (res == CHECK_OUT_OF_RANGE) { /* Change error from HA_ERR_END_OF_FILE */ DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR); diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c index 9f5f4702ed2..7124c102f82 100644 --- a/storage/myisam/mi_rnext.c +++ b/storage/myisam/mi_rnext.c @@ -28,7 +28,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx) { int error,changed; uint flag; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; uint update_mask= HA_STATE_NEXT_FOUND; DBUG_ENTER("mi_rnext"); @@ -101,10 +101,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx) { while ((info->s->concurrent_insert && info->lastpos >= info->state->data_file_length) || - (info->index_cond_func && - (icp_res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) || - (mi_check_rowid_filter_is_active(info) && - !mi_check_rowid_filter(info))) + (check= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG) { /* If we are at the last key on the key page, allow writers to @@ -137,7 +134,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= update_mask; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_mi_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/myisam/mi_rnext_same.c b/storage/myisam/mi_rnext_same.c index ee6b962c8c3..480b54f742c 100644 --- a/storage/myisam/mi_rnext_same.c +++ b/storage/myisam/mi_rnext_same.c @@ -30,7 +30,7 @@ int mi_rnext_same(MI_INFO *info, uchar *buf) int error; uint inx,not_used[2]; MI_KEYDEF *keyinfo; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; DBUG_ENTER("mi_rnext_same"); if ((int) (inx=info->lastinx) < 0 || info->lastpos == HA_OFFSET_ERROR) @@ -94,10 +94,7 @@ int mi_rnext_same(MI_INFO *info, uchar *buf) - rows that don't match index condition */ if (info->lastpos < info->state->data_file_length && - (!info->index_cond_func || - (icp_res= mi_check_index_cond(info, inx, buf)) != ICP_NO_MATCH) && - (!mi_check_rowid_filter_is_active(info) || - mi_check_rowid_filter(info))) + (check= mi_check_index_tuple(info, inx, buf)) != CHECK_NEG) break; } } @@ -109,7 +106,7 @@ int mi_rnext_same(MI_INFO *info, uchar *buf) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_mi_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/myisam/mi_rprev.c b/storage/myisam/mi_rprev.c index cac0d672765..698e3b5957f 100644 --- a/storage/myisam/mi_rprev.c +++ b/storage/myisam/mi_rprev.c @@ -28,7 +28,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx) int error,changed; register uint flag; MYISAM_SHARE *share=info->s; - ICP_RESULT icp_res= ICP_MATCH; + check_result_t check= CHECK_POS; DBUG_ENTER("mi_rprev"); if ((inx = _mi_check_index(info,inx)) < 0) @@ -58,10 +58,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx) my_off_t cur_keypage= info->last_keypage; while ((share->concurrent_insert && info->lastpos >= info->state->data_file_length) || - (info->index_cond_func && - (icp_res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) || - (mi_check_rowid_filter_is_active(info) && - !mi_check_rowid_filter(info))) + (check= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG) { /* If we are at the last (i.e. first?) key on the key page, @@ -95,7 +92,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx) info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); info->update|= HA_STATE_PREV_FOUND; - if (error || icp_res != ICP_MATCH) + if (error || check != CHECK_POS) { fast_mi_writeinfo(info); if (my_errno == HA_ERR_KEY_NOT_FOUND) diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index f7b61ae638c..06de992d6de 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -307,7 +307,7 @@ struct st_myisam_info index_cond_func_t index_cond_func; /* Index condition function */ void *index_cond_func_arg; /* parameter for the func */ rowid_filter_func_t rowid_filter_func; /* rowid filter check function */ - rowid_filter_func_t rowid_filter_is_active_func; /* is activefunction */ + rowid_filter_is_active_func_t rowid_filter_is_active_func; /* is activefunction */ void *rowid_filter_func_arg; /* parameter for the func */ THR_LOCK_DATA lock; uchar *rtree_recursion_state; /* For RTREE */ @@ -725,9 +725,8 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size); int mi_munmap_file(MI_INFO *info); void mi_remap_file(MI_INFO *info, my_off_t size); -ICP_RESULT mi_check_index_cond(MI_INFO *info, uint keynr, uchar *record); -int mi_check_rowid_filter(MI_INFO *info); -int mi_check_rowid_filter_is_active(MI_INFO *info); +check_result_t mi_check_index_tuple(MI_INFO *info, uint keynr, uchar *record); + /* Functions needed by mi_check */ int killed_ptr(HA_CHECK *param); void mi_check_print_error(HA_CHECK *param, const char *fmt, ...); @@ -738,7 +737,7 @@ extern void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t check_func, void *func_arg); extern void mi_set_rowid_filter_func(MI_INFO *info, rowid_filter_func_t check_func, - rowid_filter_func_t is_active_func, + rowid_filter_is_active_func_t is_active_func, void *func_arg); int flush_blocks(HA_CHECK *param, KEY_CACHE *key_cache, File file, ulonglong *dirty_part_map); diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index ca7880779e8..1f4b53029b8 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8680,17 +8680,18 @@ int ha_rocksdb::find_icp_matching_index_rec(const bool move_forward, return err; } - const enum icp_result icp_status= handler_index_cond_check(this); - if (icp_status == ICP_NO_MATCH) { + const check_result_t icp_status= handler_index_cond_check(this); + if (icp_status == CHECK_NEG) { rocksdb_smart_next(!move_forward, m_scan_it); continue; /* Get the next (or prev) index tuple */ } - else if (icp_status == ICP_OUT_OF_RANGE || icp_status == ICP_ABORTED_BY_USER) { + else if (icp_status == CHECK_OUT_OF_RANGE || + icp_status == CHECK_ABORTED_BY_USER) { /* We have walked out of range we are scanning */ table->status = STATUS_NOT_FOUND; return HA_ERR_END_OF_FILE; } - else /* icp_status == ICP_MATCH */ + else /* icp_status == CHECK_POS */ { /* Index Condition is satisfied. We have rc==0, proceed to fetch the * row. */ diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 67888216849..b8b4d86ce1c 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -5223,10 +5223,10 @@ static int smart_dbt_bf_callback( info->key_to_compare); } -enum icp_result ha_tokudb::toku_handler_index_cond_check( +check_result_t ha_tokudb::toku_handler_index_cond_check( Item* pushed_idx_cond) { - enum icp_result res; + check_result_t res; if (end_range) { int cmp; #ifdef MARIADB_BASE_VERSION @@ -5235,10 +5235,10 @@ enum icp_result ha_tokudb::toku_handler_index_cond_check( cmp = compare_key_icp(end_range); #endif if (cmp > 0) { - return ICP_OUT_OF_RANGE; + return CHECK_OUT_OF_RANGE; } } - res = pushed_idx_cond->val_int() ? ICP_MATCH : ICP_NO_MATCH; + res = pushed_idx_cond->val_int() ? CHECK_POS : CHECK_NEG; return res; } @@ -5278,19 +5278,19 @@ int ha_tokudb::fill_range_query_buf( if (toku_pushed_idx_cond && (tokudb_active_index == toku_pushed_idx_cond_keyno)) { unpack_key(buf, key, tokudb_active_index); - enum icp_result result = + check_result_t result = toku_handler_index_cond_check(toku_pushed_idx_cond); // If we have reason to stop, we set icp_went_out_of_range and get out // otherwise, if we simply see that the current key is no match, // we tell the cursor to continue and don't store // the key locally - if (result == ICP_OUT_OF_RANGE || thd_kill_level(thd)) { + if (result == CHECK_OUT_OF_RANGE || thd_kill_level(thd)) { icp_went_out_of_range = true; error = 0; DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range"); goto cleanup; - } else if (result == ICP_NO_MATCH) { + } else if (result == CHECK_NEG) { // Optimizer change for MyRocks also benefits us here in TokuDB as // opt_range.cc QUICK_SELECT::get_next now sets end_range during // descending scan. We should not ever hit this condition, but diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index fb1d2cd7a67..d74c99a5f8b 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -1027,7 +1027,7 @@ private: int get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_key_read); int read_data_from_range_query_buff(uchar* buf, bool need_val, bool do_key_read); // for ICP, only in MariaDB and MySQL 5.6 - enum icp_result toku_handler_index_cond_check(Item* pushed_idx_cond); + check_result_t toku_handler_index_cond_check(Item* pushed_idx_cond); void invalidate_bulk_fetch(); void invalidate_icp(); int delete_all_rows_internal(); |