Merge branch '10.4' into 10.5

This commit is contained in:
Sergei Golubchik 2020-05-09 20:43:36 +02:00
commit 13038e4705
100 changed files with 1571 additions and 289 deletions

View File

@ -251,8 +251,6 @@ IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
ENDIF() ENDIF()
INCLUDE(wsrep) INCLUDE(wsrep)
INCLUDE(cpack_rpm)
INCLUDE(cpack_deb)
OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_EXIT()" ON) OPTION(WITH_DBUG_TRACE "Enable DBUG_ENTER()/DBUG_EXIT()" ON)
IF(WITH_DBUG_TRACE) IF(WITH_DBUG_TRACE)
@ -383,8 +381,6 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE() MYSQL_CHECK_READLINE()
SET(MALLOC_LIBRARY "system") SET(MALLOC_LIBRARY "system")
SET(PYTHON_SHEBANG "/usr/bin/env python" CACHE STRING "python shebang")
MARK_AS_ADVANCED(PYTHON_SHEBANG)
CHECK_PCRE() CHECK_PCRE()
@ -421,6 +417,12 @@ UNSET (MYSQLD_STATIC_PLUGIN_LIBS CACHE)
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb) 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. # Add storage engines and plugins.
CONFIGURE_PLUGINS() CONFIGURE_PLUGINS()

View File

@ -114,12 +114,16 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d" "%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/sysusers.d"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64" "%ignore ${CMAKE_INSTALL_PREFIX}/lib64"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig"
"%ignore ${CMAKE_INSTALL_PREFIX}/sbin" "%ignore ${CMAKE_INSTALL_PREFIX}/sbin"
"%ignore ${CMAKE_INSTALL_PREFIX}/share" "%ignore ${CMAKE_INSTALL_PREFIX}/share"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal" "%ignore ${CMAKE_INSTALL_PREFIX}/share/aclocal"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/doc" "%ignore ${CMAKE_INSTALL_PREFIX}/share/doc"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man" "%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/man1*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*" "%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig" "%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) SET(CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
MACRO(ALTERNATIVE_NAME real alt) MACRO(ALTERNATIVE_NAME real alt)
SET(ver "%{version}-%{release}") IF(${ARGC} GREATER 2)
IF (${epoch}) SET(ver ${ARGV2})
SET(ver "${epoch}:${ver}") ELSE()
SET(ver "${epoch}%{version}-%{release}")
ENDIF() ENDIF()
SET(p "CPACK_RPM_${real}_PACKAGE_PROVIDES") 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 # Argh! Different distributions call packages differently, to be a drop-in
# replacement we have to fake distribution-specific dependencies # 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") IF(RPM MATCHES "(rhel|centos)6")
ALTERNATIVE_NAME("client" "mysql") ALTERNATIVE_NAME("client" "mysql")
ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7") 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" "mariadb")
ALTERNATIVE_NAME("client" "mysql") ALTERNATIVE_NAME("client" "mysql")
ALTERNATIVE_NAME("devel" "mariadb-devel") ALTERNATIVE_NAME("devel" "mariadb-devel")
ALTERNATIVE_NAME("server" "mariadb-server") ALTERNATIVE_NAME("server" "mariadb-server")
ALTERNATIVE_NAME("server" "mysql-compat-server") ALTERNATIVE_NAME("server" "mysql-compat-server")
ALTERNATIVE_NAME("test" "mariadb-test") 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() ENDIF()
IF(RPM MATCHES "fedora31" OR RPM MATCHES "(rhel|centos)8") IF(RPM MATCHES "fedora31" OR RPM MATCHES "(rhel|centos)8")
SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang") SET(PYTHON_SHEBANG "/usr/bin/python3" CACHE STRING "python shebang")

View File

@ -47,3 +47,6 @@ IF(UNIX)
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})" WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})"
COMPONENT Development) COMPONENT Development)
ENDIF() 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}")

View File

@ -20,14 +20,19 @@
#define WOLFSSL_AES_COUNTER #define WOLFSSL_AES_COUNTER
#define NO_WOLFSSL_STUB #define NO_WOLFSSL_STUB
#define OPENSSL_ALL #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 WOLFSSL_AESNI
#cmakedefine USE_FAST_MATH #cmakedefine USE_FAST_MATH
#cmakedefine TFM_TIMING_RESISTANT #cmakedefine TFM_TIMING_RESISTANT
#cmakedefine HAVE_INTEL_RDSEED #cmakedefine HAVE_INTEL_RDSEED
#cmakedefine USE_INTEL_SPEEDUP #cmakedefine USE_INTEL_SPEEDUP
#cmakedefine FP_MAX_BITS @FP_MAX_BITS@
#cmakedefine USE_FAST_MATH #cmakedefine USE_FAST_MATH
#cmakedefine WOLFSSL_X86_64_BUILD #cmakedefine WOLFSSL_X86_64_BUILD

@ -1 +1 @@
Subproject commit 3f13b49fa318fbd3216d7da36d942e7c276d3413 Subproject commit e116c89a58af750421d82ece13f80516d2bde02e

View File

@ -128,31 +128,32 @@ extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a);
#endif #endif
/** /**
Return values of index_cond_func_xxx functions. Return values for pushed index condition or rowid filter check functions.
0=ICP_NO_MATCH - index tuple doesn't satisfy the pushed index condition (the 0=CHECK_NEG - The filter is not satisfied. The engine should discard this
engine should discard the tuple and go to the next one) index tuple and continue the scan.
1=ICP_MATCH - index tuple satisfies the pushed index condition (the 1=CHECK_POS - The filter is statisfied. Current index tuple should be
engine should fetch and return the record) returned to the SQL layer.
2=ICP_OUT_OF_RANGE - index tuple is out range that we're scanning, e.g. this 2=CHECK_OUT_OF_RANGE - the index tuple is outside of the range that we're
if we're scanning "t.key BETWEEN 10 AND 20" and got a scanning. (Example: if we're scanning "t.key BETWEEN 10 AND
"t.key=21" tuple (the engine should stop scanning and 20" and got a "t.key=21" tuple) Tthe engine should stop
return HA_ERR_END_OF_FILE right away). scanning and return HA_ERR_END_OF_FILE right away).
3=ICP_ABORTED_BY_USER - engine must stop scanning and should return 3=CHECK_ABORTED_BY_USER - the engine must stop scanning and should return
HA_ERR_ABORTED_BY_USER right away HA_ERR_ABORTED_BY_USER right away
-1= ICP_ERROR - Reserved for internal errors in engines. Should not be -1=CHECK_ERROR - Reserved for internal errors in engines. Should not be
returned by index_cond_func_xxx returned by ICP or rowid filter check functions.
*/ */
typedef enum icp_result { typedef enum check_result {
ICP_ERROR=-1, CHECK_ERROR=-1,
ICP_NO_MATCH=0, CHECK_NEG=0,
ICP_MATCH=1, CHECK_POS=1,
ICP_OUT_OF_RANGE=2, CHECK_OUT_OF_RANGE=2,
ICP_ABORTED_BY_USER=3 CHECK_ABORTED_BY_USER=3
} ICP_RESULT; } check_result_t;
typedef ICP_RESULT (*index_cond_func_t)(void *param); typedef check_result_t (*index_cond_func_t)(void *param);
typedef int (*rowid_filter_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 */ #endif /* _my_compare_h */

View File

@ -45,7 +45,7 @@ extern "C" {
/* The max key length of all supported algorithms */ /* The max key length of all supported algorithms */
#define MY_AES_MAX_KEY_LENGTH 32 #define MY_AES_MAX_KEY_LENGTH 32
#define MY_AES_CTX_SIZE 600 #define MY_AES_CTX_SIZE 640
enum my_aes_mode { enum my_aes_mode {
MY_AES_ECB, MY_AES_CBC MY_AES_ECB, MY_AES_CBC

View File

@ -81,8 +81,8 @@
#ifndef HAVE_WOLFSSL #ifndef HAVE_WOLFSSL
#define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X) #define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X)
#endif
#define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X) #define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X)
#endif
#define X509_get0_notBefore(X) X509_get_notBefore(X) #define X509_get0_notBefore(X) X509_get_notBefore(X)
#define X509_get0_notAfter(X) X509_get_notAfter(X) #define X509_get0_notAfter(X) X509_get_notAfter(X)
#endif #endif

View File

@ -149,9 +149,9 @@ int vio_getnameinfo(const struct sockaddr *sa,
/* Set yaSSL to use same type as MySQL do for socket handles */ /* Set yaSSL to use same type as MySQL do for socket handles */
typedef my_socket YASSL_SOCKET_T; typedef my_socket YASSL_SOCKET_T;
#define YASSL_SOCKET_T_DEFINED #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> #include <openssl/ssl.h>
#undef Timeval #undef template
#include <openssl/err.h> #include <openssl/err.h>
#ifdef DEPRECATED #ifdef DEPRECATED
#undef DEPRECATED #undef DEPRECATED

@ -1 +1 @@
Subproject commit ca8f94f727dba19a6ac43691df53fdc829e2124e Subproject commit 2759b87d72926b7c9b5426437a7c8dd15ff57945

View File

@ -229,7 +229,7 @@ INSERT INTO t1 VALUES (1),(2);
EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 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 TABLE t1;
DROP VIEW v1; DROP VIEW v1;
# #

View File

@ -4,14 +4,14 @@ create user baz identified via mysql_old_password;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u1; connect fail,localhost,u1;
ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO) ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,uu2,,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2; connect fail,localhost,uu2;
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
connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,uu2,password,test,MASTER_PORT,MASTER_SOCKET);
connect fail,localhost,u2,password; connect fail,localhost,uu2,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 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 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 '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 '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
delete from mysql.user where plugin = 'mysql_old_password'; delete from mysql.user where plugin = 'mysql_old_password';
flush privileges; flush privileges;

View File

@ -16,20 +16,20 @@ connect (fail,localhost,u1);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --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 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (fail,localhost,u2,password); connect (fail,localhost,uu2,password);
--error ER_ACCESS_DENIED_ERROR --error ER_ACCESS_DENIED_ERROR
change_user u1; change_user u1;
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --error ER_SERVER_IS_IN_SECURE_AUTH_MODE
change_user u2; change_user uu2;
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE --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'; delete from mysql.user where plugin = 'mysql_old_password';
flush privileges; flush privileges;

View File

@ -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; flush privileges;
connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'USER'@'localhost' ERROR 28000: Access denied for user 'USER'@'localhost'
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; flush privileges;

View File

@ -4,7 +4,7 @@
# MDEV-3909 remote user enumeration # MDEV-3909 remote user enumeration
# unix_socket tests # 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; flush privileges;
# Make sure that the replace works, even if $USER is 'user' or something else # 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 --error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
change_user $USER; 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; flush privileges;

View File

@ -1,13 +1,13 @@
show create procedure mysql.AddGeometryColumn; show create procedure mysql.AddGeometryColumn;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 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) t_name varchar(64), geometry_column varchar(64), t_srid int)
SQL SECURITY INVOKER SQL SECURITY INVOKER
begin 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 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; show create procedure mysql.DropGeometryColumn;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation 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)) t_name varchar(64), geometry_column varchar(64))
SQL SECURITY INVOKER SQL SECURITY INVOKER
begin begin

View File

@ -663,9 +663,9 @@ GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost;
GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost; GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
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`.`dummytable` TO `dummy`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
GRANT USAGE ON *.* TO `dummy`@`localhost`
use INFORMATION_SCHEMA; use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@ -676,9 +676,9 @@ mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DELETE HISTORY, DROP, IN
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
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`.`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 SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@ -707,9 +707,9 @@ GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost;
GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost; GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
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`.`dummytable` TO `dummy`@`localhost`
GRANT CREATE VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
GRANT USAGE ON *.* TO `dummy`@`localhost`
use INFORMATION_SCHEMA; use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@ -720,9 +720,9 @@ mysqltest dummyview CREATE VIEW
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
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`.`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 SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@ -742,8 +742,8 @@ GRANT SHOW VIEW ON mysqltest.dummyview TO dummy@localhost;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost Grants for dummy@localhost
GRANT USAGE ON *.* TO `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`.`dummytable` TO `dummy`@`localhost`
GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
use INFORMATION_SCHEMA; use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
@ -755,8 +755,8 @@ FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost Grants for dummy@localhost
GRANT USAGE ON *.* TO `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`.`dummytable` TO `dummy`@`localhost`
GRANT SHOW VIEW ON `mysqltest`.`dummyview` TO `dummy`@`localhost`
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
@ -974,6 +974,9 @@ GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%`
select * from information_schema.table_privileges; select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 UPDATE NO '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,,; connect conn5,localhost,mysqltest_8,,;
select * from t1; select * from t1;
a a
@ -988,6 +991,9 @@ Grants for mysqltest_8@%
GRANT USAGE ON *.* TO `mysqltest_8`@`%` GRANT USAGE ON *.* TO `mysqltest_8`@`%`
select * from information_schema.table_privileges; select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE 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; flush privileges;
show grants for mysqltest_8@''; show grants for mysqltest_8@'';
Grants for mysqltest_8@% Grants for mysqltest_8@%

View File

@ -440,12 +440,14 @@ CREATE TABLE mysqltest.dummytable (dummyfield INT);
CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable; CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost; GRANT ALL PRIVILEGES ON mysqltest.dummytable TO dummy@localhost;
GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost; GRANT ALL PRIVILEGES ON mysqltest.dummyview TO dummy@localhost;
--sorted_result
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
use INFORMATION_SCHEMA; use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
--sorted_result
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE 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; CREATE VIEW mysqltest.dummyview AS SELECT dummyfield FROM mysqltest.dummytable;
GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost; GRANT CREATE VIEW ON mysqltest.dummytable TO dummy@localhost;
GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost; GRANT CREATE VIEW ON mysqltest.dummyview TO dummy@localhost;
--sorted_result
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
use INFORMATION_SCHEMA; use INFORMATION_SCHEMA;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
--sorted_result
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE

View File

@ -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; 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 User Host Password plugin authentication_string Insert_priv
root localhost *0BB7188CF0DE9B403BA66E9DD810D82652D002EB mysql_native_password *0BB7188CF0DE9B403BA66E9DD810D82652D002EB Y 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; FLUSH PRIVILEGES;
USE test; USE test;
End of 5.1 tests End of 5.1 tests

View File

@ -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'; 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; 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; FLUSH PRIVILEGES;
USE test; USE test;

View File

@ -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; create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
select * from information_schema.views; 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 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 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 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 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 'joe'@'localhost' def test t1 a SELECT YES
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES; select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE 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 view v1, v2, v3;
drop table t1; drop table t1;
delete from mysql.user where user='joe'; delete from mysql.user where user='joe';

View File

@ -48,6 +48,7 @@ select * from T1;
connection default; connection default;
GRANT SELECT ON t1 to user_1@localhost; GRANT SELECT ON t1 to user_1@localhost;
connection con1; connection con1;
--sorted_result
select * from information_schema.table_privileges; select * from information_schema.table_privileges;
connection default; connection default;
disconnect con1; disconnect con1;

View File

@ -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 Phase 1/7: Checking and upgrading mysql database
Processing databases Processing databases
mysql mysql
@ -63,6 +63,6 @@ test
Phase 7/7: Running 'FLUSH PRIVILEGES' Phase 7/7: Running 'FLUSH PRIVILEGES'
OK OK
connect con1,localhost,root,foo,,,; 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; flush privileges;
set global event_scheduler=OFF; set global event_scheduler=OFF;

View File

@ -11,13 +11,13 @@
# In this setup MYSQL_UPGRADE cannot continue after issuing FLUSH PRIVILEGES # 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 --exec $MYSQL_UPGRADE
connect(con1,localhost,root,foo,,,); 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; flush privileges;
# Load event table # Load event table
set global event_scheduler=OFF; set global event_scheduler=OFF;

View File

@ -639,7 +639,7 @@ alter table mysql.user change authentication_string auth_string text collate utf
# mysql_upgrade --force --silent 2>&1 # mysql_upgrade --force --silent 2>&1
select count(*) from mysql.global_priv; select count(*) from mysql.global_priv;
count(*) count(*)
4 5
drop table mysql.global_priv; drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv;
# End of 10.4 tests # End of 10.4 tests

View File

@ -1,3 +1,4 @@
set @save_session_track_system_variables=@@session_track_system_variables;
SELECT @@session.character_set_connection; SELECT @@session.character_set_connection;
@@session.character_set_connection @@session.character_set_connection
latin1 latin1
@ -28,7 +29,22 @@ SET NAMES 'utf8';
# tracking info off once # tracking info off once
SET NAMES 'big5'; 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,not_null_range_scan=off
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
# #
# MDEV-16470 - Session user variables tracker # MDEV-16470 - Session user variables tracker
# #
@ -48,3 +64,4 @@ on long MULTIPOLYGON query with session_track_user_variables=1
set @@session.session_track_user_variables=1; set @@session.session_track_user_variables=1;
set @a=repeat('X', 1029); set @a=repeat('X', 1029);
set @@session.session_track_user_variables=0; set @@session.session_track_user_variables=0;
# End of 10.5 tests

View File

@ -2,6 +2,9 @@
--source include/no_protocol.inc --source include/no_protocol.inc
--source include/not_embedded.inc --source include/not_embedded.inc
set @save_session_track_system_variables=@@session_track_system_variables;
SELECT @@session.character_set_connection; SELECT @@session.character_set_connection;
SET @@session.session_track_system_variables='character_set_connection'; SET @@session.session_track_system_variables='character_set_connection';
@ -22,7 +25,26 @@ SET NAMES 'utf8';
SET NAMES 'big5'; SET NAMES 'big5';
--disable_session_track_info --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
--echo # --echo #
--echo # MDEV-16470 - Session user variables tracker --echo # MDEV-16470 - Session user variables tracker
@ -46,3 +68,5 @@ set @@session.session_track_user_variables=1;
set @a=repeat('X', 1029); set @a=repeat('X', 1029);
--disable_session_track_info --disable_session_track_info
set @@session.session_track_user_variables=0; set @@session.session_track_user_variables=0;
--echo # End of 10.5 tests

View File

@ -2,37 +2,44 @@ set sql_mode="";
CREATE DATABASE test_user_db; CREATE DATABASE test_user_db;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
========== test 1.1 ====================================================== ========== test 1.1 ======================================================
CREATE USER plug IDENTIFIED WITH test_plugin_server; CREATE USER plug IDENTIFIED WITH test_plugin_server;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
DROP USER plug; DROP USER plug;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
DROP USER plug; DROP USER plug;
CREATE USER plug IDENTIFIED WITH test_plugin_server AS ''; CREATE USER plug IDENTIFIED WITH test_plugin_server AS '';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS ''; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug test_plugin_server
REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
DROP USER 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 ============================ ========== test 1.1.1.6/1.1.2.5 ============================
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
DROP USER plug; DROP USER plug;
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS '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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS '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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
DROP USER plug; DROP USER plug;
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug, plug_dest; DROP USER plug, plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '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'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; 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'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
plug mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119 plug mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug; DROP USER plug;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; 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'; CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest test_plugin_server plug_dest plug_dest test_plugin_server plug_dest
DROP USER plug,plug_dest; DROP USER plug,plug_dest;
CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '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'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest
IDENTIFIED WITH test_plugin_server AS 'plug_dest'; IDENTIFIED WITH test_plugin_server AS 'plug_dest';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
plug test_plugin_server plug_dest plug test_plugin_server plug_dest
plug_dest test_plugin_server plug_dest plug_dest test_plugin_server plug_dest
DROP USER plug,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'; CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg test_plugin_server plüg_dest plüg test_plugin_server plüg_dest
DROP USER plüg; DROP USER plüg;
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plüg_dest; DROP USER plüg_dest;
SET NAMES ascii; SET NAMES ascii;
CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS '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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
pl??g test_plugin_server pl??g_dest pl??g test_plugin_server pl??g_dest
DROP USER 'plüg'; DROP USER 'plüg';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
pl??g_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 pl??g_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
SET NAMES latin1; 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'; CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server plüg_dest plug test_plugin_server plüg_dest
DROP USER 'plug'; DROP USER 'plug';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
SET NAMES utf8; 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'; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg test_plugin_server plüg_dest plüg test_plugin_server plüg_dest
DROP USER 'plüg'; DROP USER 'plüg';
CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER 'plüg_dest'; DROP USER 'plüg_dest';
CREATE USER plüg IDENTIFIED WITH test_plugin_server AS '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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg test_plugin_server plüg_dest plüg test_plugin_server plüg_dest
DROP USER plüg; DROP USER plüg;
CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plüg_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
DROP USER plüg_dest; DROP USER plüg_dest;
========== test 1.1.1.2/1.1.2.2============================= ========== 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'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug test_plugin_server hh's_plug_dest plug test_plugin_server hh's_plug_dest
DROP USER plug; DROP USER plug;
CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
hh's_plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 hh's_plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
mariadb.sys mysql_native_password
DROP USER 'hh''s_plug_dest'; DROP USER 'hh''s_plug_dest';
========== test 1.1.1.4 ==================================== ========== test 1.1.1.4 ====================================
CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
CREATE USER plug_dest; CREATE USER plug_dest;
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
plug_dest mysql_native_password plug_dest mysql_native_password
DROP USER grant_user,plug_dest; DROP USER grant_user,plug_dest;
set @save_sql_mode= @@sql_mode; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
CREATE USER plug_dest; CREATE USER plug_dest;
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 *939AEE68989794C0F408277411C26055CDF41119
DROP USER plug_dest; DROP USER plug_dest;
GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; 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'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
grant_user test_plugin_server plug_dest grant_user test_plugin_server plug_dest
mariadb.sys mysql_native_password
plug_dest mysql_native_password *560881EB651416CEF77314D07D55EDCD5FC1BD6D *560881EB651416CEF77314D07D55EDCD5FC1BD6D plug_dest mysql_native_password *560881EB651416CEF77314D07D55EDCD5FC1BD6D *560881EB651416CEF77314D07D55EDCD5FC1BD6D
DROP USER grant_user,plug_dest; DROP USER grant_user,plug_dest;
set @@sql_mode= @save_sql_mode; set @@sql_mode= @save_sql_mode;

View File

@ -1,6 +1,7 @@
CREATE DATABASE test_user_db; CREATE DATABASE test_user_db;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
========== test 1.1.3.2 ==================================== ========== test 1.1.3.2 ====================================
CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; 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; GRANT PROXY ON plug_dest TO plug_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
1) 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) ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_user,new_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) ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_user,new_dest; DROP USER plug_user,new_dest;
@ -113,6 +117,7 @@ new_user@localhost plug_dest@%
connection default; connection default;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_user test_plugin_server plug_dest new_user test_plugin_server plug_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
disconnect plug_user; disconnect plug_user;
@ -120,6 +125,7 @@ UPDATE mysql.global_priv SET user='plug_user' WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
DROP USER plug_dest,plug_user; DROP USER plug_dest,plug_user;
@ -136,24 +142,28 @@ connection default;
disconnect plug_user; disconnect plug_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
plug_user test_plugin_server plug_dest plug_user test_plugin_server plug_dest
UPDATE mysql.global_priv SET user='new_user' WHERE user='plug_user'; UPDATE mysql.global_priv SET user='new_user' WHERE user='plug_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_user test_plugin_server plug_dest new_user test_plugin_server plug_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.authentication_string', 'new_dest') WHERE user='new_user'; UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.authentication_string', 'new_dest') WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.plugin', 'new_plugin_server') WHERE user='new_user'; UPDATE mysql.global_priv SET priv=JSON_SET(priv, '$.plugin', 'new_plugin_server') WHERE user='new_user';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_user new_plugin_server new_dest new_user new_plugin_server new_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
ERROR HY000: Plugin 'new_plugin_server' is not loaded ERROR HY000: Plugin 'new_plugin_server' is not loaded
@ -163,6 +173,7 @@ FLUSH PRIVILEGES;
GRANT PROXY ON new_dest TO new_user; GRANT PROXY ON new_dest TO new_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 new_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
connect plug_user,localhost,new_user,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'; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
new_dest mysql_native_password *01422E86A6FFF84618914AF149F9AEF64B84170A new_dest mysql_native_password *01422E86A6FFF84618914AF149F9AEF64B84170A
new_user test_plugin_server new_dest new_user test_plugin_server new_dest
plug_dest mysql_native_password *939AEE68989794C0F408277411C26055CDF41119 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
mariadb.sys mysql_native_password
proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD
connect proxy_con,localhost,proxied_user,proxied_user_passwd; connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER(); 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
mariadb.sys mysql_native_password
proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD proxied_user mysql_native_password *D7A51428CD38DB3C5293B9321DA1228BFB1611DD
connect proxy_con,localhost,proxied_user,proxied_user_passwd; connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER(); 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
test_plugin_server proxied_user test_plugin_server proxied_user
mariadb.sys mysql_native_password
proxied_user_1 mysql_native_password *551D5A5177FCC3340F7D2FB0F4D8D1EEA7F7EF71 proxied_user_1 mysql_native_password *551D5A5177FCC3340F7D2FB0F4D8D1EEA7F7EF71
proxied_user_2 mysql_native_password *3D948F77C6A988AFDCA9755AB2A6724362557220 proxied_user_2 mysql_native_password *3D948F77C6A988AFDCA9755AB2A6724362557220
proxied_user_3 mysql_native_password *41A18925D237DEE738C76581153990B037F462E3 proxied_user_3 mysql_native_password *41A18925D237DEE738C76581153990B037F462E3

View File

@ -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; GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_1_user qa_auth_interface qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest
SELECT @@proxy_user; 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 qa_test_1_user@% qa_test_1_user@localhost NULL NULL
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_1_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_1_user qa_auth_interface qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest
DROP USER qa_test_1_user; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
mariadb.sys mysql_native_password
qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_user qa_auth_interface qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest
SELECT @@proxy_user; 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'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 authenticated_as mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
mariadb.sys mysql_native_password
qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_2_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_2_user qa_auth_interface qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest
DROP USER qa_test_2_user; 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'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22
mariadb.sys mysql_native_password
qa_test_5_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_5_user qa_auth_interface qa_test_5_dest 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 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; GRANT PROXY ON qa_test_6_dest TO qa_test_6_user;
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest 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 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'; 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'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest 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 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; REVOKE PROXY ON qa_test_6_dest FROM root;
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
User plugin authentication_string User plugin authentication_string
mariadb.sys mysql_native_password
qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_dest mysql_native_password *DFCACE76914AD7BD801FC1A1ECF6562272621A22
qa_test_6_user qa_auth_interface qa_test_6_dest 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 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'; DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface';
SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
User plugin authentication_string Password User plugin authentication_string Password
mariadb.sys mysql_native_password
=== Test of the --default_auth option for clients ==== === 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_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest';
CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd';

View File

@ -3,10 +3,11 @@
# #
connect con1,localhost,root,,; connect con1,localhost,root,,;
connection con1; 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; connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; 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; disconnect con1;
SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET';
End of 5.5 tests End of 5.5 tests

View File

@ -1,6 +1,7 @@
source include/have_debug.inc; source include/have_debug.inc;
source include/have_debug_sync.inc; source include/have_debug_sync.inc;
source include/not_embedded.inc; source include/not_embedded.inc;
source include/count_sessions.inc;
--echo # --echo #
--echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes --echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
@ -10,9 +11,9 @@ connect (con1,localhost,root,,);
connection con1; 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 --disable_query_log
--send_eval $q; --send_eval $q;
--enable_query_log --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; exec $MYSQL test -e "SHOW PROCESSLIST" > $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
let SEARCH_FILE=$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; source include/search_pattern_in_file.inc;
remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20466.text; remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
SET DEBUG_SYNC= 'now SIGNAL go';
disconnect con1; disconnect con1;
SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET';
source include/wait_until_count_sessions.inc;
--echo End of 5.5 tests --echo End of 5.5 tests

View File

@ -11,8 +11,8 @@ grant select on mysqltest.t9 to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`t9` TO `second_user`@`localhost`
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
connect con3,localhost,second_user,looser,mysqltest; connect con3,localhost,second_user,looser,mysqltest;
connection con3; connection con3;
select current_user(); select current_user();
@ -34,21 +34,21 @@ grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`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 ; drop table mysqltest.t9 ;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`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; connection con3;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`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' ; prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ; execute s_t1 ;
my_col my_col
@ -63,13 +63,13 @@ connection default;
revoke all privileges on mysqltest.t1 from second_user@localhost; revoke all privileges on mysqltest.t1 from second_user@localhost;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`t9` TO `second_user`@`localhost`
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
connection con3; connection con3;
show grants for second_user@localhost ; show grants for second_user@localhost ;
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`.`t9` TO `second_user`@`localhost`
GRANT USAGE ON *.* TO `second_user`@`localhost` IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
execute s_t1 ; execute s_t1 ;
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
connection default; connection default;

View File

@ -40,6 +40,7 @@ grant usage on mysqltest.* to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
grant select on mysqltest.t9 to second_user@localhost grant select on mysqltest.t9 to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
@ -64,8 +65,10 @@ select a as my_col from t1;
connection default; connection default;
grant select on mysqltest.t1 to second_user@localhost grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ; identified by 'looser' ;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
drop table mysqltest.t9 ; drop table mysqltest.t9 ;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
@ -73,6 +76,7 @@ show grants for second_user@localhost ;
## switch to the second session ## switch to the second session
connection con3; connection con3;
######## Question 1: The table t1 should be now accessible. ######## ######## Question 1: The table t1 should be now accessible. ########
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
prepare s_t1 from 'select a as my_col from t1' ; prepare s_t1 from 'select a as my_col from t1' ;
execute s_t1 ; execute s_t1 ;
@ -86,11 +90,13 @@ deallocate prepare s_t9;
## switch back to the first session ## switch back to the first session
connection default; connection default;
revoke all privileges on mysqltest.t1 from second_user@localhost; revoke all privileges on mysqltest.t1 from second_user@localhost;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
#### check the access as new user #### check the access as new user
## switch to the second session ## switch to the second session
connection con3; connection con3;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
######## Question 2: The table t1 should be now not accessible. ######## ######## Question 2: The table t1 should be now not accessible. ########
--error 1142 --error 1142
@ -103,6 +109,7 @@ connection default;
disconnect con3 ; disconnect con3 ;
## remove all rights of second_user@localhost ## remove all rights of second_user@localhost
revoke all privileges, grant option from second_user@localhost ; revoke all privileges, grant option from second_user@localhost ;
--sorted_result
show grants for second_user@localhost ; show grants for second_user@localhost ;
drop user second_user@localhost ; drop user second_user@localhost ;
commit ; commit ;

View File

@ -54,6 +54,17 @@ orders CREATE TABLE `orders` (
KEY `i_o_totalprice` (`o_totalprice`) KEY `i_o_totalprice` (`o_totalprice`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
set optimizer_use_condition_selectivity=2; 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 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 WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
l_quantity > 45; 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 WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
l_quantity > 45; l_quantity > 45;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 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 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 WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
l_quantity > 45; l_quantity > 45;
@ -117,7 +128,7 @@ ANALYZE
"rows": 702, "rows": 702,
"selectivity_pct": 11.69025812, "selectivity_pct": 11.69025812,
"r_rows": 605, "r_rows": 605,
"r_selectivity_pct": 3.685503686, "r_selectivity_pct": 11.76470588,
"r_buffer_size": "REPLACED", "r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED" "r_filling_time_ms": "REPLACED"
}, },
@ -647,7 +658,7 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
l_quantity > 45 AND l_quantity > 45 AND
o_totalprice between 180000 and 230000; o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 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 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 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 FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@ -681,7 +692,7 @@ ANALYZE
"rows": 702, "rows": 702,
"selectivity_pct": 11.69025812, "selectivity_pct": 11.69025812,
"r_rows": 605, "r_rows": 605,
"r_selectivity_pct": 3.685503686, "r_selectivity_pct": 11.76470588,
"r_buffer_size": "REPLACED", "r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED" "r_filling_time_ms": "REPLACED"
}, },
@ -2131,6 +2142,37 @@ EXPLAIN
} }
DROP TABLE t1,t2; 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 # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
# #
set @save_optimizer_switch= @@optimizer_switch; set @save_optimizer_switch= @@optimizer_switch;

View File

@ -39,6 +39,16 @@ set statement optimizer_switch='rowid_filter=on' for;
let $without_filter= let $without_filter=
set statement optimizer_switch='rowid_filter=off' for; 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= let $q1=
SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND 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; 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 #
--echo # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT --echo # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT

View File

@ -55,6 +55,17 @@ orders CREATE TABLE `orders` (
KEY `i_o_totalprice` (`o_totalprice`) KEY `i_o_totalprice` (`o_totalprice`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
set optimizer_use_condition_selectivity=2; 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 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 WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
l_quantity > 45; l_quantity > 45;
@ -2080,6 +2091,37 @@ EXPLAIN
} }
DROP TABLE t1,t2; 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 # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
# #
set @save_optimizer_switch= @@optimizer_switch; set @save_optimizer_switch= @@optimizer_switch;

View File

@ -9,6 +9,7 @@ create user oldpassold@localhost identified with 'mysql_old_password';
set password for oldpassold@localhost = '378b243e220ca493'; set password for oldpassold@localhost = '378b243e220ca493';
select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
User Host Password plugin authentication_string User Host Password plugin authentication_string
mariadb.sys localhost mysql_native_password
natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpassnat 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'); set password for oldpassold@localhost = PASSWORD('test2');
select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
User Host Password plugin authentication_string User Host Password plugin authentication_string
mariadb.sys localhost mysql_native_password
natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E

View File

@ -592,7 +592,7 @@ explain
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL 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 @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables; set use_stat_tables=@save_use_stat_tables;
# #

View File

@ -624,7 +624,7 @@ explain
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL 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 @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables; set use_stat_tables=@save_use_stat_tables;
# #

View File

@ -62,7 +62,7 @@ db CREATE TABLE `db` (
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
show create table user; show create table user;
View Create View character_set_client collation_connection 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; show create table func;
Table Create Table Table Create Table
func CREATE TABLE `func` ( func CREATE TABLE `func` (

View File

@ -100,7 +100,7 @@ db CREATE TABLE `db` (
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
show create table user; show create table user;
View Create View character_set_client collation_connection 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; show create table func;
Table Create Table Table Create Table
func CREATE TABLE `func` ( func CREATE TABLE `func` (

View File

@ -104,7 +104,7 @@ db CREATE TABLE `db` (
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
show create table user; show create table user;
View Create View character_set_client collation_connection 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; show create table func;
Table Create Table Table Create Table
func CREATE TABLE `func` ( func CREATE TABLE `func` (

View File

@ -84,7 +84,7 @@ db CREATE TABLE `db` (
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
show create table user; show create table user;
View Create View character_set_client collation_connection 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; show create table func;
Table Create Table Table Create Table
func CREATE TABLE `func` ( func CREATE TABLE `func` (

View File

@ -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)

View File

@ -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)

View File

@ -848,8 +848,8 @@ connection inv2;
SHOW GRANTS; SHOW GRANTS;
Grants for inv_17254@localhost Grants for inv_17254@localhost
GRANT SET USER ON *.* TO `inv_17254`@`localhost` GRANT SET USER ON *.* TO `inv_17254`@`localhost`
GRANT SELECT ON `db17254`.`t1` TO `inv_17254`@`localhost`
GRANT SELECT ON `db17254`.`v1` TO `inv_17254`@`localhost` GRANT SELECT ON `db17254`.`v1` TO `inv_17254`@`localhost`
GRANT SELECT ON `db17254`.`t1` TO `inv_17254`@`localhost`
SELECT CURRENT_USER, SYSTEM_USER(), USER(); SELECT CURRENT_USER, SYSTEM_USER(), USER();
CURRENT_USER SYSTEM_USER() USER() CURRENT_USER SYSTEM_USER() USER()
inv_17254@localhost inv_17254@localhost inv_17254@localhost inv_17254@localhost inv_17254@localhost inv_17254@localhost
@ -1360,6 +1360,9 @@ disconnect root;
connection default; connection default;
select * from information_schema.table_privileges; select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE 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. End of 5.0 tests.
connection default; connection default;
DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1;

View File

@ -74,6 +74,9 @@ sub skip_combinations {
$skip{'main/ssl_verify_ip.test'} = 'x509v3 support required' $skip{'main/ssl_verify_ip.test'} = 'x509v3 support required'
unless $openssl_ver ge "1.0.2"; 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; %skip;
} }

View File

@ -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_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 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 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 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; connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.routines; 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 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_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 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 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 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; connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.routines; 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 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_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 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 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 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; connection default;
disconnect testuser1; disconnect testuser1;
disconnect testuser2; disconnect testuser2;

View File

@ -239,8 +239,8 @@ def db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost'; SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost Grants for testuser1@localhost
GRANT USAGE ON *.* TO `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 (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'; SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost Grants for testuser2@localhost
GRANT USAGE ON *.* TO `testuser2`@`localhost` GRANT USAGE ON *.* TO `testuser2`@`localhost`
@ -258,8 +258,8 @@ def db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
SHOW GRANTS FOR 'testuser1'@'localhost'; SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost Grants for testuser1@localhost
GRANT USAGE ON *.* TO `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 (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'; SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql' ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
connection testuser2; connection testuser2;

View File

@ -55,6 +55,9 @@ IS_GRANTABLE varchar(3) NO
SELECT table_catalog, table_schema, table_name, privilege_type SELECT table_catalog, table_schema, table_name, privilege_type
FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL; FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name privilege_type 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: # Testcase 3.2.11.2+3.2.11.3+3.2.11.4:
# INFORMATION_SCHEMA.TABLE_PRIVILEGES accessible information # 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'; SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost Grants for the_user@localhost
GRANT USAGE ON *.* TO `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_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 SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
WHERE table_name LIKE 't1_%' WHERE table_name LIKE 't1_%'
ORDER BY table_schema,table_name; ORDER BY table_schema,table_name;
@ -247,8 +250,8 @@ test t1_view
SHOW GRANTS FOR 'the_user'@'localhost'; SHOW GRANTS FOR 'the_user'@'localhost';
Grants for the_user@localhost Grants for the_user@localhost
GRANT USAGE ON *.* TO `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_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_table FROM 'the_user'@'localhost';
REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost'; REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost';
DROP VIEW test.t1_view; DROP VIEW test.t1_view;

View File

@ -210,6 +210,7 @@ ERROR 70100: Query execution was interrupted
connection con1; connection con1;
ROLLBACK; ROLLBACK;
connection default; connection default;
disconnect con1;
DROP TABLE t3,t1; DROP TABLE t3,t1;
# #
# MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N # MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
@ -287,6 +288,121 @@ ALTER TABLE t1 DROP f3;
ALTER TABLE t1 CHANGE f f3 INT; ALTER TABLE t1 CHANGE f f3 INT;
DROP TABLE t1; DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=1; 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 # Start of 10.2 tests
# #
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint # MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
@ -324,6 +440,7 @@ INSERT INTO matchmaking_group_users VALUES (10,1),(11,2);
INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66); INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66);
BEGIN; BEGIN;
UPDATE users SET name = 'qux' WHERE id = 1; UPDATE users SET name = 'qux' WHERE id = 1;
connect con1,localhost,root;
connection con1; connection con1;
SET innodb_lock_wait_timeout= 1; SET innodb_lock_wait_timeout= 1;
DELETE FROM matchmaking_groups WHERE id = 10; DELETE FROM matchmaking_groups WHERE id = 10;
@ -534,6 +651,65 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; 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 # End of 10.2 tests
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)), CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB; FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;

View File

@ -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;

View File

@ -195,6 +195,7 @@ reap;
connection con1; connection con1;
ROLLBACK; ROLLBACK;
connection default; connection default;
disconnect con1;
DROP TABLE t3,t1; DROP TABLE t3,t1;
@ -281,6 +282,136 @@ DROP TABLE t1;
SET FOREIGN_KEY_CHECKS=1; 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 # Start of 10.2 tests
--echo # --echo #
@ -326,6 +457,7 @@ INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66);
BEGIN; BEGIN;
UPDATE users SET name = 'qux' WHERE id = 1; UPDATE users SET name = 'qux' WHERE id = 1;
connect (con1,localhost,root);
--connection con1 --connection con1
SET innodb_lock_wait_timeout= 1; SET innodb_lock_wait_timeout= 1;
DELETE FROM matchmaking_groups WHERE id = 10; DELETE FROM matchmaking_groups WHERE id = 10;
@ -520,6 +652,52 @@ CHECK TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; 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 --echo # End of 10.2 tests
# MDEV-21792 Server aborts upon attempt to create foreign key on spatial field # MDEV-21792 Server aborts upon attempt to create foreign key on spatial field

View File

@ -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
#

View File

@ -117,6 +117,7 @@ wait/io/table/sql/handler TABLE mysql global_priv fetch 1
wait/io/table/sql/handler TABLE mysql global_priv fetch 1 wait/io/table/sql/handler TABLE mysql global_priv fetch 1
wait/io/table/sql/handler TABLE mysql global_priv fetch 1 wait/io/table/sql/handler TABLE mysql global_priv fetch 1
wait/io/table/sql/handler TABLE mysql global_priv fetch 1 wait/io/table/sql/handler TABLE mysql global_priv fetch 1
wait/io/table/sql/handler TABLE mysql global_priv fetch 1
wait/io/table/sql/handler TABLE mysql db fetch 1 wait/io/table/sql/handler TABLE mysql db fetch 1
wait/io/table/sql/handler TABLE mysql db fetch 1 wait/io/table/sql/handler TABLE mysql db fetch 1
wait/io/table/sql/handler TABLE mysql db fetch 1 wait/io/table/sql/handler TABLE mysql db fetch 1
@ -125,6 +126,7 @@ wait/io/table/sql/handler TABLE mysql proxies_priv fetch 1
wait/io/table/sql/handler TABLE mysql proxies_priv fetch 1 wait/io/table/sql/handler TABLE mysql proxies_priv fetch 1
wait/io/table/sql/handler TABLE mysql roles_mapping fetch 1 wait/io/table/sql/handler TABLE mysql roles_mapping fetch 1
wait/io/table/sql/handler TABLE mysql tables_priv fetch 1 wait/io/table/sql/handler TABLE mysql tables_priv fetch 1
wait/io/table/sql/handler TABLE mysql tables_priv fetch 1
wait/io/table/sql/handler TABLE mysql procs_priv fetch 1 wait/io/table/sql/handler TABLE mysql procs_priv fetch 1
wait/io/table/sql/handler TABLE mysql servers fetch 1 wait/io/table/sql/handler TABLE mysql servers fetch 1
wait/io/table/sql/handler TABLE mysql table_stats fetch 1 wait/io/table/sql/handler TABLE mysql table_stats fetch 1

View File

@ -9,8 +9,8 @@ Acl_package_body_grants 0
Acl_proxy_users 2 Acl_proxy_users 2
Acl_role_grants 0 Acl_role_grants 0
Acl_roles 0 Acl_roles 0
Acl_table_grants 0 Acl_table_grants 1
Acl_users 4 Acl_users 5
SELECT count(*) COLUMN_GRANTS from mysql.columns_priv; SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
COLUMN_GRANTS COLUMN_GRANTS
0 0
@ -34,10 +34,10 @@ ROLES
0 0
SELECT count(*) TABLE_GRANTS from mysql.tables_priv; SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
TABLE_GRANTS TABLE_GRANTS
0 1
SELECT count(*) USERS from mysql.user where is_role='N'; SELECT count(*) USERS from mysql.user where is_role='N';
USERS USERS
4 5
CREATE USER u1; CREATE USER u1;
CREATE ROLE r1; CREATE ROLE r1;
CREATE ROLE r2; CREATE ROLE r2;
@ -74,8 +74,8 @@ Acl_package_body_grants 0
Acl_proxy_users 3 Acl_proxy_users 3
Acl_role_grants 4 Acl_role_grants 4
Acl_roles 2 Acl_roles 2
Acl_table_grants 2 Acl_table_grants 3
Acl_users 5 Acl_users 6
SELECT count(*) COLUMN_GRANTS from mysql.columns_priv; SELECT count(*) COLUMN_GRANTS from mysql.columns_priv;
COLUMN_GRANTS COLUMN_GRANTS
2 2
@ -99,10 +99,10 @@ ROLES
2 2
SELECT count(*) TABLE_GRANTS from mysql.tables_priv; SELECT count(*) TABLE_GRANTS from mysql.tables_priv;
TABLE_GRANTS TABLE_GRANTS
2 3
SELECT count(*) USERS from mysql.user where is_role='N'; SELECT count(*) USERS from mysql.user where is_role='N';
USERS USERS
5 6
DROP PROCEDURE mysql.test_proc; DROP PROCEDURE mysql.test_proc;
DROP FUNCTION mysql.test_func; DROP FUNCTION mysql.test_func;
DROP ROLE r2; DROP ROLE r2;

View File

@ -41,4 +41,4 @@ GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO `r1` GRANT USAGE ON *.* TO `r1`
set password=''; set password='';
drop role r1; 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';

View File

@ -29,4 +29,4 @@ set password='';
#cleanup #cleanup
drop role r1; 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';

View File

@ -6,6 +6,7 @@ grant test_role2 to test_user@localhost;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_user localhost test_user localhost

View File

@ -3,6 +3,7 @@ create role test_role1;
grant test_role1 to test_user@localhost; grant test_role1 to test_user@localhost;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_user localhost test_user localhost
select * from mysql.roles_mapping; select * from mysql.roles_mapping;

View File

@ -5,6 +5,7 @@ create role test_role2;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_user localhost test_user localhost

View File

@ -7,6 +7,7 @@ grant test_role3 to test_user@localhost;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_role3 test_role3

View File

@ -3,6 +3,7 @@ create role test_role1;
grant test_role1 to test_user@localhost; grant test_role1 to test_user@localhost;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_user localhost test_user localhost
select * from mysql.roles_mapping; select * from mysql.roles_mapping;

View File

@ -5,6 +5,7 @@ grant test_role1 to test_user@localhost;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_user localhost 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'; drop user 'test_user'@'localhost';
select * from mysql.tables_priv; select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_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 mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2; revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%'; delete from mysql.user where user like'test_%';

View File

@ -5,6 +5,7 @@ grant test_role1 to test_user@localhost;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_user localhost 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'; drop user 'test_user'@'localhost';
select * from mysql.tables_priv; select * from mysql.tables_priv;
Host Db User Table_name Grantor Timestamp Table_priv Column_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 mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2; revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%'; delete from mysql.user where user like'test_%';

View File

@ -6,6 +6,7 @@ grant test_role2 to test_user@localhost;
grant test_role2 to test_role1; grant test_role2 to test_role1;
select user, host from mysql.user where user not like 'root'; select user, host from mysql.user where user not like 'root';
User Host User Host
mariadb.sys localhost
test_role1 test_role1
test_role2 test_role2
test_user localhost test_user localhost

View File

@ -19,3 +19,4 @@ rpl_parallel2 : fails after MDEV-16172
rpl_semi_sync_after_sync : fails after MDEV-16172 rpl_semi_sync_after_sync : fails after MDEV-16172
rpl_slave_grp_exec: MDEV-10514 rpl_slave_grp_exec: MDEV-10514
rpl_auto_increment_update_failure : disabled for now rpl_auto_increment_update_failure : disabled for now
rpl_current_user : waits for MDEV-22374 fix

View File

@ -39,27 +39,27 @@ GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost; GRANT INSERT ON test.t1 TO mysqltest6@localhost;
show grants for mysqltest1@localhost; show grants for mysqltest1@localhost;
Grants for mysqltest1@localhost Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
GRANT SELECT ON `test`.`t1` TO `mysqltest1`@`localhost` GRANT SELECT ON `test`.`t1` TO `mysqltest1`@`localhost`
GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
show grants for mysqltest2@localhost; show grants for mysqltest2@localhost;
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 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; show grants for mysqltest3@localhost;
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 (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; show grants for mysqltest4@localhost;
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 SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
show grants for mysqltest6@localhost; show grants for mysqltest6@localhost;
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`.* TO `mysqltest6`@`localhost`
GRANT INSERT ON `test`.`t1` TO `mysqltest6`@`localhost` GRANT INSERT ON `test`.`t1` TO `mysqltest6`@`localhost`
GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
flush privileges; flush privileges;
show grants for mysqltest5@somehost; show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost Grants for mysqltest5@somehost
@ -69,24 +69,24 @@ connection slave;
**** Checking grants on slave **** **** Checking grants on slave ****
show grants for mysqltest2@localhost; show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost Grants for mysqltest2@localhost
GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost` GRANT INSERT ON `test`.`t4` TO `mysqltest2`@`localhost`
GRANT USAGE ON *.* TO `mysqltest2`@`localhost`
show grants for mysqltest3@localhost; show grants for mysqltest3@localhost;
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 (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; show grants for mysqltest4@localhost;
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 SELECT ON `mysqltest2`.`t2` TO `mysqltest4`@`localhost`
GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
show grants for mysqltest5@somehost; show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO `mysqltest5`@`somehost` GRANT USAGE ON *.* TO `mysqltest5`@`somehost`
show grants for mysqltest6@localhost; show grants for mysqltest6@localhost;
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`.* TO `mysqltest6`@`localhost`
GRANT SELECT, INSERT ON *.* TO `mysqltest6`@`localhost`
show grants for mysqltest1@localhost; show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost' ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master **** **** Revoking grants on master ****
@ -100,9 +100,9 @@ Grants for mysqltest1@localhost
GRANT USAGE ON *.* TO `mysqltest1`@`localhost` GRANT USAGE ON *.* TO `mysqltest1`@`localhost`
show grants for mysqltest3@localhost; show grants for mysqltest3@localhost;
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 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; show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' GRANT USAGE ON *.* TO `mysqltest4`@`localhost` IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'

View File

@ -77,10 +77,15 @@ GRANT INSERT ON *.* TO mysqltest6@localhost;
GRANT INSERT ON test.* TO mysqltest6@localhost; GRANT INSERT ON test.* TO mysqltest6@localhost;
GRANT INSERT ON test.t1 TO mysqltest6@localhost; GRANT INSERT ON test.t1 TO mysqltest6@localhost;
--sorted_result
show grants for mysqltest1@localhost; show grants for mysqltest1@localhost;
--sorted_result
show grants for mysqltest2@localhost; show grants for mysqltest2@localhost;
--sorted_result
show grants for mysqltest3@localhost; show grants for mysqltest3@localhost;
--sorted_result
show grants for mysqltest4@localhost; show grants for mysqltest4@localhost;
--sorted_result
show grants for mysqltest6@localhost; show grants for mysqltest6@localhost;
flush privileges; flush privileges;
@ -92,10 +97,15 @@ sync_slave_with_master;
--echo **** Checking grants on slave **** --echo **** Checking grants on slave ****
# Check that grants are replicated to slave # Check that grants are replicated to slave
--sorted_result
show grants for mysqltest2@localhost; show grants for mysqltest2@localhost;
--sorted_result
show grants for mysqltest3@localhost; show grants for mysqltest3@localhost;
--sorted_result
show grants for mysqltest4@localhost; show grants for mysqltest4@localhost;
--sorted_result
show grants for mysqltest5@somehost; show grants for mysqltest5@somehost;
--sorted_result
show grants for mysqltest6@localhost; show grants for mysqltest6@localhost;
# mysqltest1 should not be on slave # mysqltest1 should not be on slave
@ -109,8 +119,11 @@ REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost;
REVOKE select(a) on t4 REVOKE select(a) on t4
from mysqltest3@localhost; from mysqltest3@localhost;
--sorted_result
show grants for mysqltest1@localhost; show grants for mysqltest1@localhost;
--sorted_result
show grants for mysqltest3@localhost; show grants for mysqltest3@localhost;
--sorted_result
show grants for mysqltest4@localhost; show grants for mysqltest4@localhost;
sync_slave_with_master; sync_slave_with_master;

View File

@ -18,7 +18,9 @@
#include <my_global.h> #include <my_global.h>
#include <string.h> #include <string.h>
#define template _template /* bug in WolfSSL 4.4.0, see also violite.h */
#include <openssl/evp.h> #include <openssl/evp.h>
#undef template
#include <openssl/aes.h> #include <openssl/aes.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h> #include <openssl/rand.h>

View File

@ -43,6 +43,7 @@ IF(HAVE_PAM_APPL_H)
IF(INSTALL_PAMDIR) IF(INSTALL_PAMDIR)
INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server) INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server)
INSTALL(FILES mapper/user_map.conf DESTINATION ${INSTALL_PAMDATADIR} 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() ENDIF()
ENDIF(HAVE_PAM_APPL_H) ENDIF(HAVE_PAM_APPL_H)

View File

@ -23,12 +23,12 @@ SET sql_mode='';
DROP PROCEDURE IF EXISTS AddGeometryColumn; DROP PROCEDURE IF EXISTS AddGeometryColumn;
DROP PROCEDURE IF EXISTS DropGeometryColumn; 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 t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
begin 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@ 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 t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
begin 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@ 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@

View File

@ -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 -- Remember for later if db table already existed
set @had_db_table= @@warning_count != 0; 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, Host,
User, 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, '$.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 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'; 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';

View File

@ -808,4 +808,9 @@ IF 'BASE TABLE' = (select table_type from information_schema.tables where table_
FROM user; FROM user;
DROP TABLE user; DROP TABLE user;
END IF// 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 ; DELIMITER ;

View File

@ -6161,22 +6161,22 @@ int handler::compare_key2(key_range *range) const
/** /**
ICP callback - to be called by an engine to check the pushed condition 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; handler *h= (handler*)h_arg;
THD *thd= h->table->in_use; THD *thd= h->table->in_use;
enum icp_result res; check_result_t res;
enum thd_kill_levels abort_at= h->has_transactions() ? enum thd_kill_levels abort_at= h->has_transactions() ?
THD_ABORT_SOFTLY : THD_ABORT_ASAP; THD_ABORT_SOFTLY : THD_ABORT_ASAP;
if (thd_kill_level(thd) > abort_at) 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) 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); h->increment_statistics(&SSV::ha_icp_attempts);
if ((res= h->pushed_idx_cond->val_int()? ICP_MATCH : ICP_NO_MATCH) == if ((res= h->pushed_idx_cond->val_int()? CHECK_POS : CHECK_NEG) ==
ICP_MATCH) CHECK_POS)
h->increment_statistics(&SSV::ha_icp_match); h->increment_statistics(&SSV::ha_icp_match);
return res; return res;
} }
@ -6187,12 +6187,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 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; handler *h= (handler*) h_arg;
TABLE *tab= h->get_table(); 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]); 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;
} }

View File

@ -2956,9 +2956,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); extern "C" int handler_rowid_filter_is_active(void* h_arg);
uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map); uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
@ -4975,7 +4975,8 @@ public:
virtual void set_lock_type(enum thr_lock_type lock); 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 Find unique record by index or unique constrain

View File

@ -469,6 +469,14 @@ TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no,
covering_keys.is_set(access_key_no)) covering_keys.is_set(access_key_no))
return 0; 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 Currently we do not support usage of range filters if the table
is accessed by the clustered primary key. It does not make sense is accessed by the clustered primary key. It does not make sense

View File

@ -1269,7 +1269,7 @@ void Session_tracker::store(THD *thd, String *buf)
if ((size= net_length_size(length)) != 1) 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 buf->length(start); // it is safer to have 0-length block in case of error
return; return;
@ -1279,6 +1279,7 @@ void Session_tracker::store(THD *thd, String *buf)
The 'buf->reserve()' can change the buf->ptr() so we cannot The 'buf->reserve()' can change the buf->ptr() so we cannot
calculate the 'data' earlier. calculate the 'data' earlier.
*/ */
buf->length(buf->length() + (size - 1));
data= (uchar *)(buf->ptr() + start); data= (uchar *)(buf->ptr() + start);
memmove(data + (size - 1), data, length); memmove(data + (size - 1), data, length);
} }

View File

@ -4756,10 +4756,19 @@ bool Lock_tables_prelocking_strategy::
handle_table(THD *thd, Query_tables_list *prelocking_ctx, handle_table(THD *thd, Query_tables_list *prelocking_ctx,
TABLE_LIST *table_list, bool *need_prelocking) 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, if (DML_prelocking_strategy::handle_table(thd, prelocking_ctx, table_list,
need_prelocking)) need_prelocking))
return TRUE; 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. */ /* We rely on a caller to check that table is going to be changed. */
DBUG_ASSERT(table_list->lock_type >= TL_WRITE_ALLOW_WRITE); DBUG_ASSERT(table_list->lock_type >= TL_WRITE_ALLOW_WRITE);

View File

@ -2078,6 +2078,9 @@ struct TABLE_LIST
OT_BASE_ONLY); OT_BASE_ONLY);
belong_to_view= belong_to_view_arg; belong_to_view= belong_to_view_arg;
trg_event_map= trg_event_map_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; **last_ptr= this;
prev_global= *last_ptr; prev_global= *last_ptr;

View File

@ -3888,9 +3888,9 @@ exhausted:
/*********************************************************************//** /*********************************************************************//**
Check a pushed-down index condition. 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 static
ICP_RESULT check_result_t
row_search_idx_cond_check( row_search_idx_cond_check(
/*======================*/ /*======================*/
byte* mysql_rec, /*!< out: record byte* mysql_rec, /*!< out: record
@ -3908,7 +3908,7 @@ row_search_idx_cond_check(
if (!prebuilt->idx_cond) { if (!prebuilt->idx_cond) {
if (!handler_rowid_filter_is_active(prebuilt->pk_filter)) { if (!handler_rowid_filter_is_active(prebuilt->pk_filter)) {
return(ICP_MATCH); return(CHECK_POS);
} }
} else { } else {
MONITOR_INC(MONITOR_ICP_ATTEMPTS); MONITOR_INC(MONITOR_ICP_ATTEMPTS);
@ -3933,7 +3933,7 @@ row_search_idx_cond_check(
rec, prebuilt->index, offsets, rec, prebuilt->index, offsets,
templ->icp_rec_field_no, templ->icp_rec_field_no,
templ)) { templ)) {
return(ICP_NO_MATCH); return(CHECK_NEG);
} }
} }
@ -3943,12 +3943,12 @@ row_search_idx_cond_check(
index, if the case of the column has been updated in index, if the case of the column has been updated in
the past, or a record has been deleted and a record the past, or a record has been deleted and a record
inserted in a different case. */ 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) ? handler_index_cond_check(prebuilt->idx_cond)
: ICP_MATCH; : CHECK_POS;
switch (result) { switch (result) {
case ICP_MATCH: case CHECK_POS:
if (handler_rowid_filter_is_active(prebuilt->pk_filter)) { if (handler_rowid_filter_is_active(prebuilt->pk_filter)) {
ut_ad(!prebuilt->index->is_primary()); ut_ad(!prebuilt->index->is_primary());
if (prebuilt->clust_index_was_generated) { if (prebuilt->clust_index_was_generated) {
@ -3963,9 +3963,18 @@ row_search_idx_cond_check(
ut_ad(len == DATA_ROW_ID_LEN); ut_ad(len == DATA_ROW_ID_LEN);
memcpy(prebuilt->row_id, data, DATA_ROW_ID_LEN); memcpy(prebuilt->row_id, data, DATA_ROW_ID_LEN);
} }
if (!handler_rowid_filter_check(prebuilt->pk_filter)) { result = handler_rowid_filter_check(prebuilt->pk_filter);
MONITOR_INC(MONITOR_ICP_MATCH); switch (result) {
return(ICP_NO_MATCH); 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. /* Convert the remaining fields to MySQL format.
@ -3977,19 +3986,19 @@ row_search_idx_cond_check(
mysql_rec, prebuilt, rec, NULL, false, mysql_rec, prebuilt, rec, NULL, false,
prebuilt->index, offsets)) { prebuilt->index, offsets)) {
ut_ad(dict_index_is_clust(prebuilt->index)); ut_ad(dict_index_is_clust(prebuilt->index));
return(ICP_NO_MATCH); return(CHECK_NEG);
} }
} }
MONITOR_INC(MONITOR_ICP_MATCH); MONITOR_INC(MONITOR_ICP_MATCH);
return(result); return(result);
case ICP_NO_MATCH: case CHECK_NEG:
MONITOR_INC(MONITOR_ICP_NO_MATCH); MONITOR_INC(MONITOR_ICP_NO_MATCH);
return(result); return(result);
case ICP_OUT_OF_RANGE: case CHECK_OUT_OF_RANGE:
MONITOR_INC(MONITOR_ICP_OUT_OF_RANGE); MONITOR_INC(MONITOR_ICP_OUT_OF_RANGE);
return(result); return(result);
case ICP_ERROR: case CHECK_ERROR:
case ICP_ABORTED_BY_USER: case CHECK_ABORTED_BY_USER:
return(result); return(result);
} }
@ -4419,13 +4428,13 @@ early_not_found:
switch (row_search_idx_cond_check( switch (row_search_idx_cond_check(
buf, prebuilt, buf, prebuilt,
rec, offsets)) { rec, offsets)) {
case ICP_NO_MATCH: case CHECK_NEG:
case ICP_OUT_OF_RANGE: case CHECK_OUT_OF_RANGE:
case ICP_ABORTED_BY_USER: case CHECK_ABORTED_BY_USER:
case ICP_ERROR: case CHECK_ERROR:
err = DB_RECORD_NOT_FOUND; err = DB_RECORD_NOT_FOUND;
goto shortcut_done; goto shortcut_done;
case ICP_MATCH: case CHECK_POS:
goto shortcut_done; goto shortcut_done;
} }
} }
@ -5155,14 +5164,14 @@ no_gap_lock:
index entry. */ index entry. */
switch (row_search_idx_cond_check( switch (row_search_idx_cond_check(
buf, prebuilt, rec, offsets)) { buf, prebuilt, rec, offsets)) {
case ICP_NO_MATCH: case CHECK_NEG:
goto next_rec; goto next_rec;
case ICP_OUT_OF_RANGE: case CHECK_OUT_OF_RANGE:
case ICP_ABORTED_BY_USER: case CHECK_ABORTED_BY_USER:
case ICP_ERROR: case CHECK_ERROR:
err = DB_RECORD_NOT_FOUND; err = DB_RECORD_NOT_FOUND;
goto idx_cond_failed; goto idx_cond_failed;
case ICP_MATCH: case CHECK_POS:
goto requires_clust_rec; goto requires_clust_rec;
} }
@ -5212,17 +5221,17 @@ locks_ok_del_marked:
/* Check if the record matches the index condition. */ /* Check if the record matches the index condition. */
switch (row_search_idx_cond_check(buf, prebuilt, rec, offsets)) { switch (row_search_idx_cond_check(buf, prebuilt, rec, offsets)) {
case ICP_NO_MATCH: case CHECK_NEG:
if (did_semi_consistent_read) { if (did_semi_consistent_read) {
row_unlock_for_mysql(prebuilt, TRUE); row_unlock_for_mysql(prebuilt, TRUE);
} }
goto next_rec; goto next_rec;
case ICP_OUT_OF_RANGE: case CHECK_OUT_OF_RANGE:
case ICP_ABORTED_BY_USER: case CHECK_ABORTED_BY_USER:
case ICP_ERROR: case CHECK_ERROR:
err = DB_RECORD_NOT_FOUND; err = DB_RECORD_NOT_FOUND;
goto idx_cond_failed; goto idx_cond_failed;
case ICP_MATCH: case CHECK_POS:
break; break;
} }

View File

@ -32,7 +32,7 @@
#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */ #define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
C_MODE_START C_MODE_START
ICP_RESULT index_cond_func_maria(void *arg); check_result_t index_cond_func_maria(void *arg);
C_MODE_END C_MODE_END
extern TYPELIB maria_recover_typelib; extern TYPELIB maria_recover_typelib;
@ -194,7 +194,7 @@ public:
private: private:
DsMrr_impl ds_mrr; 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); friend void reset_thd_trn(THD *thd);
friend class ha_s3; friend class ha_s3;
}; };

View File

@ -668,20 +668,20 @@ int _ma_read_key_record(MARIA_HA *info, uchar *buf, MARIA_RECORD_POS filepos)
will look for column values there) will look for column values there)
RETURN RETURN
ICP_ERROR Error ; my_errno set to HA_ERR_CRASHED CHECK_ERROR Error ; my_errno set to HA_ERR_CRASHED
ICP_NO_MATCH Index condition is not satisfied, continue scanning CHECK_NEG Index condition is not satisfied, continue scanning
ICP_MATCH Index condition is satisfied CHECK_POS Index condition is satisfied
ICP_OUT_OF_RANGE Index condition is not satisfied, end the scan. CHECK_OUT_OF_RANGE Index condition is not satisfied, end the scan.
my_errno set to HA_ERR_END_OF_FILE 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 info->cur_row.lastpos is set to HA_OFFSET_ERROR in case of CHECK_ERROR or
ICP_OUT_OF_RANGE to indicate that we don't have any active row. 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, check_result_t ma_check_index_cond(register MARIA_HA *info, uint keynr,
uchar *record) uchar *record)
{ {
ICP_RESULT res= ICP_MATCH; check_result_t res= CHECK_POS;
if (info->index_cond_func) if (info->index_cond_func)
{ {
if (_ma_put_key_in_record(info, keynr, FALSE, record)) if (_ma_put_key_in_record(info, keynr, FALSE, record))
@ -690,10 +690,10 @@ ICP_RESULT ma_check_index_cond(register MARIA_HA *info, uint keynr,
maria_print_error(info->s, HA_ERR_CRASHED); maria_print_error(info->s, HA_ERR_CRASHED);
info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */ info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */
my_errno= HA_ERR_CRASHED; my_errno= HA_ERR_CRASHED;
res= ICP_ERROR; res= CHECK_ERROR;
} }
else if ((res= info->index_cond_func(info->index_cond_func_arg)) == 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 */ /* We got beyond the end of scanned range */
info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */ info->cur_row.lastpos= HA_OFFSET_ERROR; /* No active record */

View File

@ -34,7 +34,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data,
HA_KEYSEG *last_used_keyseg; HA_KEYSEG *last_used_keyseg;
uint32 nextflag; uint32 nextflag;
MARIA_KEY key; MARIA_KEY key;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
DBUG_ENTER("maria_rkey"); DBUG_ENTER("maria_rkey");
DBUG_PRINT("enter", ("base:%p buf:%p inx: %d search_flag: %d", DBUG_PRINT("enter", ("base:%p buf:%p inx: %d search_flag: %d",
info, buf, inx, search_flag)); 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. not satisfied with an out-of-range condition.
*/ */
if ((*share->row_is_visible)(info) && 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; break;
/* The key references a concurrently inserted record. */ /* 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) || } 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 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 (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 */ /* We don't want HA_ERR_END_OF_FILE in this particular case */
my_errno= HA_ERR_KEY_NOT_FOUND; my_errno= HA_ERR_KEY_NOT_FOUND;

View File

@ -30,7 +30,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
uint flag; uint flag;
MARIA_SHARE *share= info->s; MARIA_SHARE *share= info->s;
MARIA_KEYDEF *keyinfo; MARIA_KEYDEF *keyinfo;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
uint update_mask= HA_STATE_NEXT_FOUND; uint update_mask= HA_STATE_NEXT_FOUND;
DBUG_ENTER("maria_rnext"); DBUG_ENTER("maria_rnext");
@ -107,7 +107,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
if (!error) if (!error)
{ {
while (!(*share->row_is_visible)(info) || 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 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&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= update_mask; info->update|= update_mask;
if (error || icp_res != ICP_MATCH) if (error || check != CHECK_POS)
{ {
fast_ma_writeinfo(info); fast_ma_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -30,7 +30,7 @@ int maria_rnext_same(MARIA_HA *info, uchar *buf)
int error; int error;
uint inx,not_used[2]; uint inx,not_used[2];
MARIA_KEYDEF *keyinfo; MARIA_KEYDEF *keyinfo;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
DBUG_ENTER("maria_rnext_same"); DBUG_ENTER("maria_rnext_same");
if ((int) (inx= info->lastinx) < 0 || 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 */ /* Skip rows that are inserted by other threads since we got a lock */
if ((info->s->row_is_visible)(info) && 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; 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_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; 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); fast_ma_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -28,7 +28,7 @@ int maria_rprev(MARIA_HA *info, uchar *buf, int inx)
register uint flag; register uint flag;
MARIA_SHARE *share= info->s; MARIA_SHARE *share= info->s;
MARIA_KEYDEF *keyinfo; MARIA_KEYDEF *keyinfo;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
DBUG_ENTER("maria_rprev"); DBUG_ENTER("maria_rprev");
if ((inx = _ma_check_index(info,inx)) < 0) 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; my_off_t cur_keypage= info->last_keypage;
while (!(*share->row_is_visible)(info) || 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, 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_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_PREV_FOUND; info->update|= HA_STATE_PREV_FOUND;
if (error || icp_res != ICP_MATCH) if (error || check != CHECK_POS)
{ {
fast_ma_writeinfo(info); fast_ma_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -1460,7 +1460,7 @@ extern my_bool maria_flush_log_for_page_none(PAGECACHE_IO_HOOK_ARGS *args);
extern PAGECACHE *maria_log_pagecache; extern PAGECACHE *maria_log_pagecache;
extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func, extern void ma_set_index_cond_func(MARIA_HA *info, index_cond_func_t func,
void *func_arg); 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_yield_and_check_if_killed(MARIA_HA *info, int inx);
extern my_bool ma_killed_standalone(MARIA_HA *); extern my_bool ma_killed_standalone(MARIA_HA *);

View File

@ -38,7 +38,7 @@ extern const char *myisam_recover_names[];
extern ulonglong myisam_recover_options; extern ulonglong myisam_recover_options;
C_MODE_START C_MODE_START
ICP_RESULT index_cond_func_myisam(void *arg); check_result_t index_cond_func_myisam(void *arg);
C_MODE_END C_MODE_END
class ha_myisam: public handler class ha_myisam: public handler
@ -176,5 +176,5 @@ public:
private: private:
DsMrr_impl ds_mrr; DsMrr_impl ds_mrr;
friend ICP_RESULT index_cond_func_myisam(void *arg); friend check_result_t index_cond_func_myisam(void *arg);
}; };

View File

@ -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, void mi_set_rowid_filter_func(MI_INFO *info,
rowid_filter_func_t check_func, 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) void *func_arg)
{ {
info->rowid_filter_func= check_func; info->rowid_filter_func= check_func;

View File

@ -492,58 +492,83 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, uchar *buf)
} }
/* static
Save current key tuple to record and call index condition check function int mi_unpack_index_tuple(MI_INFO *info, uint keynr, uchar *record)
SYNOPSIS
mi_check_index_cond()
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.
*/
ICP_RESULT mi_check_index_cond(register MI_INFO *info, uint keynr,
uchar *record)
{ {
ICP_RESULT res;
if (_mi_put_key_in_record(info, keynr, FALSE, record)) if (_mi_put_key_in_record(info, keynr, FALSE, record))
{ {
/* Impossible case; Can only happen if bug in code */ /* Impossible case; Can only happen if bug in code */
mi_print_error(info->s, HA_ERR_CRASHED); mi_print_error(info->s, HA_ERR_CRASHED);
info->lastpos= HA_OFFSET_ERROR; /* No active record */ info->lastpos= HA_OFFSET_ERROR; /* No active record */
my_errno= HA_ERR_CRASHED; my_errno= HA_ERR_CRASHED;
res= ICP_ERROR; return 1;
} }
else if ((res= info->index_cond_func(info->index_cond_func_arg)) == return 0;
ICP_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;
}
return res;
} }
int mi_check_rowid_filter(MI_INFO *info) static int mi_check_rowid_filter_is_active(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) if (info->rowid_filter_is_active_func == NULL)
return 0; return 0;
return info->rowid_filter_is_active_func(info->rowid_filter_func_arg); return info->rowid_filter_is_active_func(info->rowid_filter_func_arg);
} }
/*
Check the current index tuple: Check ICP condition and/or Rowid Filter
SYNOPSIS
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
Check result according to check_result_t definition
*/
check_result_t mi_check_index_tuple(MI_INFO *info, uint keynr, uchar *record)
{
int need_unpack= TRUE;
check_result_t res= CHECK_POS;
if (info->index_cond_func)
{
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;
}
/* Check the Rowid Filter, if present */
if (mi_check_rowid_filter_is_active(info))
{
/* 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;
}
/* /*
Retrieve auto_increment info Retrieve auto_increment info

View File

@ -30,7 +30,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
MI_KEYDEF *keyinfo; MI_KEYDEF *keyinfo;
HA_KEYSEG *last_used_keyseg; HA_KEYSEG *last_used_keyseg;
uint pack_key_length, use_key_length, nextflag; 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_ENTER("mi_rkey");
DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d",
info, buf, inx, search_flag)); 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 && while ((info->lastpos >= info->state->data_file_length &&
(search_flag != HA_READ_KEY_EXACT || (search_flag != HA_READ_KEY_EXACT ||
last_used_keyseg != keyinfo->seg + keyinfo->keysegs)) || last_used_keyseg != keyinfo->seg + keyinfo->keysegs)) ||
(info->index_cond_func && (res= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG)
(res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) ||
(mi_check_rowid_filter_is_active(info) &&
!mi_check_rowid_filter(info)))
{ {
uint not_used[2]; uint not_used[2];
/* /*
@ -162,12 +159,12 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
/* Aborted by user */ /* Aborted by user */
DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR && DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR &&
my_errno == HA_ERR_ABORTED_BY_USER); my_errno == HA_ERR_ABORTED_BY_USER);
res= ICP_ERROR; res= CHECK_ERROR;
buf= 0; /* Fast abort */ buf= 0; /* Fast abort */
break; break;
} }
} }
if (res == ICP_OUT_OF_RANGE) if (res == CHECK_OUT_OF_RANGE)
{ {
/* Change error from HA_ERR_END_OF_FILE */ /* Change error from HA_ERR_END_OF_FILE */
DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR); DBUG_ASSERT(info->lastpos == HA_OFFSET_ERROR);

View File

@ -28,7 +28,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
{ {
int error,changed; int error,changed;
uint flag; uint flag;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
uint update_mask= HA_STATE_NEXT_FOUND; uint update_mask= HA_STATE_NEXT_FOUND;
DBUG_ENTER("mi_rnext"); DBUG_ENTER("mi_rnext");
@ -101,10 +101,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
{ {
while ((info->s->concurrent_insert && while ((info->s->concurrent_insert &&
info->lastpos >= info->state->data_file_length) || info->lastpos >= info->state->data_file_length) ||
(info->index_cond_func && (check= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG)
(icp_res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) ||
(mi_check_rowid_filter_is_active(info) &&
!mi_check_rowid_filter(info)))
{ {
/* /*
If we are at the last key on the key page, allow writers to 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&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= update_mask; info->update|= update_mask;
if (error || icp_res != ICP_MATCH) if (error || check != CHECK_POS)
{ {
fast_mi_writeinfo(info); fast_mi_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -30,7 +30,7 @@ int mi_rnext_same(MI_INFO *info, uchar *buf)
int error; int error;
uint inx,not_used[2]; uint inx,not_used[2];
MI_KEYDEF *keyinfo; MI_KEYDEF *keyinfo;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
DBUG_ENTER("mi_rnext_same"); DBUG_ENTER("mi_rnext_same");
if ((int) (inx=info->lastinx) < 0 || info->lastpos == HA_OFFSET_ERROR) 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 - rows that don't match index condition
*/ */
if (info->lastpos < info->state->data_file_length && if (info->lastpos < info->state->data_file_length &&
(!info->index_cond_func || (check= mi_check_index_tuple(info, inx, buf)) != CHECK_NEG)
(icp_res= mi_check_index_cond(info, inx, buf)) != ICP_NO_MATCH) &&
(!mi_check_rowid_filter_is_active(info) ||
mi_check_rowid_filter(info)))
break; 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_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; 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); fast_mi_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -28,7 +28,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx)
int error,changed; int error,changed;
register uint flag; register uint flag;
MYISAM_SHARE *share=info->s; MYISAM_SHARE *share=info->s;
ICP_RESULT icp_res= ICP_MATCH; check_result_t check= CHECK_POS;
DBUG_ENTER("mi_rprev"); DBUG_ENTER("mi_rprev");
if ((inx = _mi_check_index(info,inx)) < 0) 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; my_off_t cur_keypage= info->last_keypage;
while ((share->concurrent_insert && while ((share->concurrent_insert &&
info->lastpos >= info->state->data_file_length) || info->lastpos >= info->state->data_file_length) ||
(info->index_cond_func && (check= mi_check_index_tuple(info, inx, buf)) == CHECK_NEG)
(icp_res= mi_check_index_cond(info, inx, buf)) == ICP_NO_MATCH) ||
(mi_check_rowid_filter_is_active(info) &&
!mi_check_rowid_filter(info)))
{ {
/* /*
If we are at the last (i.e. first?) key on the key page, 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_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_PREV_FOUND; info->update|= HA_STATE_PREV_FOUND;
if (error || icp_res != ICP_MATCH) if (error || check != CHECK_POS)
{ {
fast_mi_writeinfo(info); fast_mi_writeinfo(info);
if (my_errno == HA_ERR_KEY_NOT_FOUND) if (my_errno == HA_ERR_KEY_NOT_FOUND)

View File

@ -307,7 +307,7 @@ struct st_myisam_info
index_cond_func_t index_cond_func; /* Index condition function */ index_cond_func_t index_cond_func; /* Index condition function */
void *index_cond_func_arg; /* parameter for the func */ 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_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 */ void *rowid_filter_func_arg; /* parameter for the func */
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
uchar *rtree_recursion_state; /* For RTREE */ uchar *rtree_recursion_state; /* For RTREE */
@ -742,9 +742,8 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size);
int mi_munmap_file(MI_INFO *info); int mi_munmap_file(MI_INFO *info);
void mi_remap_file(MI_INFO *info, my_off_t size); void mi_remap_file(MI_INFO *info, my_off_t size);
ICP_RESULT mi_check_index_cond(MI_INFO *info, uint keynr, uchar *record); check_result_t mi_check_index_tuple(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);
/* Functions needed by mi_check */ /* Functions needed by mi_check */
int killed_ptr(HA_CHECK *param); int killed_ptr(HA_CHECK *param);
void mi_check_print_error(HA_CHECK *param, const char *fmt, ...); void mi_check_print_error(HA_CHECK *param, const char *fmt, ...);
@ -755,7 +754,7 @@ extern void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t check_func,
void *func_arg); void *func_arg);
extern void mi_set_rowid_filter_func(MI_INFO *info, extern void mi_set_rowid_filter_func(MI_INFO *info,
rowid_filter_func_t check_func, 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); void *func_arg);
int flush_blocks(HA_CHECK *param, KEY_CACHE *key_cache, File file, int flush_blocks(HA_CHECK *param, KEY_CACHE *key_cache, File file,
ulonglong *dirty_part_map); ulonglong *dirty_part_map);

View File

@ -8690,17 +8690,18 @@ int ha_rocksdb::find_icp_matching_index_rec(const bool move_forward,
return err; return err;
} }
const enum icp_result icp_status= handler_index_cond_check(this); const check_result_t icp_status= handler_index_cond_check(this);
if (icp_status == ICP_NO_MATCH) { if (icp_status == CHECK_NEG) {
rocksdb_smart_next(!move_forward, m_scan_it); rocksdb_smart_next(!move_forward, m_scan_it);
continue; /* Get the next (or prev) index tuple */ 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 */ /* We have walked out of range we are scanning */
table->status = STATUS_NOT_FOUND; table->status = STATUS_NOT_FOUND;
return HA_ERR_END_OF_FILE; 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 /* Index Condition is satisfied. We have rc==0, proceed to fetch the
* row. */ * row. */

View File

@ -5223,10 +5223,10 @@ static int smart_dbt_bf_callback(
info->key_to_compare); 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) { Item* pushed_idx_cond) {
enum icp_result res; check_result_t res;
if (end_range) { if (end_range) {
int cmp; int cmp;
#ifdef MARIADB_BASE_VERSION #ifdef MARIADB_BASE_VERSION
@ -5235,10 +5235,10 @@ enum icp_result ha_tokudb::toku_handler_index_cond_check(
cmp = compare_key_icp(end_range); cmp = compare_key_icp(end_range);
#endif #endif
if (cmp > 0) { 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; return res;
} }
@ -5278,19 +5278,19 @@ int ha_tokudb::fill_range_query_buf(
if (toku_pushed_idx_cond && if (toku_pushed_idx_cond &&
(tokudb_active_index == toku_pushed_idx_cond_keyno)) { (tokudb_active_index == toku_pushed_idx_cond_keyno)) {
unpack_key(buf, key, tokudb_active_index); unpack_key(buf, key, tokudb_active_index);
enum icp_result result = check_result_t result =
toku_handler_index_cond_check(toku_pushed_idx_cond); 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 // 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, // otherwise, if we simply see that the current key is no match,
// we tell the cursor to continue and don't store // we tell the cursor to continue and don't store
// the key locally // 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; icp_went_out_of_range = true;
error = 0; error = 0;
DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range"); DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range");
goto cleanup; goto cleanup;
} else if (result == ICP_NO_MATCH) { } else if (result == CHECK_NEG) {
// Optimizer change for MyRocks also benefits us here in TokuDB as // Optimizer change for MyRocks also benefits us here in TokuDB as
// opt_range.cc QUICK_SELECT::get_next now sets end_range during // opt_range.cc QUICK_SELECT::get_next now sets end_range during
// descending scan. We should not ever hit this condition, but // descending scan. We should not ever hit this condition, but

View File

@ -1025,7 +1025,7 @@ private:
int get_next(uchar* buf, int direction, DBT* key_to_compare, bool do_key_read); 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); 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 // 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_bulk_fetch();
void invalidate_icp(); void invalidate_icp();
int delete_all_rows_internal(); int delete_all_rows_internal();