Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä 2021-05-25 15:38:57 +03:00
commit 1dea7f7977
41 changed files with 509 additions and 92 deletions

View file

@ -115,11 +115,13 @@ FOREACH(_base
ENDIF()
ENDFOREACH()
IF(NOT RPM AND NOT DEB)
FOREACH(tool gtar tar)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()
ENDIF()
FIND_PACKAGE(Git)

13
cmake/FindGit.cmake Normal file
View file

@ -0,0 +1,13 @@
if(GIT_EXECUTABLE)
set(GIT_FOUND TRUE)
return()
endif()
if(DEFINED GIT_EXECUTABLE)
set(GIT_FOUND FALSE)
return()
endif()
set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
unset(CMAKE_MODULE_PATH)
include(FindGit)
set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})

View file

@ -1,4 +1,9 @@
if(JAVA_AWT_LIBRARY)
set(JNI_FOUND TRUE)
return()
endif()
if(DEFINED JAVA_AWT_LIBRARY)
set(JNI_FOUND FALSE)
return()
endif()

View file

@ -1,4 +1,9 @@
if(Java_JAVA_EXECUTABLE)
set(JAVA_FOUND TRUE)
return()
endif()
if(DEFINED Java_JAVA_EXECUTABLE)
set(JAVA_FOUND FALSE)
return()
endif()

View file

@ -88,6 +88,12 @@ ENDIF()
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
SET(WITH_NUMA 0 CACHE BOOL "")
SET(CPU_LEVEL1_DCACHE_LINESIZE 0)
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git)
SET(GIT_EXECUTABLE GIT_EXECUTABLE-NOTFOUND CACHE FILEPATH "")
ENDIF()
IF(WIN32)
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")

View file

@ -124,8 +124,6 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man1*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/man/man8*"
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)

View file

@ -15,6 +15,8 @@
# Symbols with information about the CPU.
IF(NOT DEFINED CPU_LEVEL1_DCACHE_LINESIZE)
IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PROGRAM(SYSCTL sysctl)
MARK_AS_ADVANCED(SYSCTL)
@ -37,3 +39,5 @@ ELSE()
)
ENDIF()
ENDIF()
ENDIF()

View file

@ -29,7 +29,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
TARGET_LINK_LIBRARIES(factorial dbug)
ENDIF()
IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode AND NOT RPM AND NOT DEB)
FIND_PROGRAM(GROFF groff)
FIND_PROGRAM(NROFF nroff)
MARK_AS_ADVANCED(GROFF)

View file

@ -1,2 +1,6 @@
etc/mysql/conf.d/connect.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_connect.so
usr/share/mysql/Mongo2.jar
usr/share/mysql/Mongo3.jar
usr/share/mysql/JavaWrappers.jar
usr/share/mysql/JdbcInterface.jar

View file

@ -22,9 +22,40 @@ SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a
@a BINARY @a REVERSE(@a) HEX(@a) HEX(REVERSE(@a))
aя a@r1 яa 61407231 40723161
#
# Beginning of 10.2 test.
#
# MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
# m_status == DA_OK_BULK' failed in Diagnostics_area::message from
# get_schema_tables_record
#
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
utf8 utf8 utf8
SET @old_character_set_client= @@character_set_client;
SET @old_character_set_connection= @@character_set_connection;
SET @old_character_set_results= @@character_set_results;
SET NAMES 'filename';
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'filename'
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
@@character_set_client @@character_set_connection @@character_set_results
utf8 utf8 utf8
CREATE VIEW v2 AS SELECT 1;
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL VIEW NULL NULL
DROP VIEW v2;
SET @@character_set_client= @old_character_set_client;
SET @@character_set_connection= @old_character_set_connection;
SET @@character_set_results= @old_character_set_results;
#
# End of 10.2 test
#
#
# MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
#
SET CHARACTER_SET_CLIENT=17;
ERROR 42000: Variable 'character_set_client' can't be set to the value of '17'
SELECT doc.`Children`.0 FROM t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?Children??0?FROM?t1' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.0 FROM t1' at line 1
SET NAMES latin1;
# End of 10.3 tests

View file

@ -28,12 +28,40 @@ select convert(convert(',' using filename) using binary);
SET NAMES utf8;
SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a), HEX(REVERSE(@a));
--echo #
--echo # Beginning of 10.2 test.
--echo #
--echo # MDEV-25462: Assertion `m_status == DA_ERROR || m_status == DA_OK ||
--echo # m_status == DA_OK_BULK' failed in Diagnostics_area::message from
--echo # get_schema_tables_record
--echo #
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
SET @old_character_set_client= @@character_set_client;
SET @old_character_set_connection= @@character_set_connection;
SET @old_character_set_results= @@character_set_results;
--error ER_WRONG_VALUE_FOR_VAR
SET NAMES 'filename';
SELECT @@character_set_client, @@character_set_connection, @@character_set_results;
CREATE VIEW v2 AS SELECT 1;
SHOW TABLE STATUS;
DROP VIEW v2;
SET @@character_set_client= @old_character_set_client;
SET @@character_set_connection= @old_character_set_connection;
SET @@character_set_results= @old_character_set_results;
--echo #
--echo # End of 10.2 test
--echo #
--echo #
--echo # MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
--echo #
--error ER_WRONG_VALUE_FOR_VAR
SET CHARACTER_SET_CLIENT=17;
--error ER_PARSE_ERROR
SELECT doc.`Children`.0 FROM t1;
SET NAMES latin1;
--echo # End of 10.3 tests

View file

@ -1519,7 +1519,7 @@ lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
local-infile TRUE
lock-wait-timeout 86400
log-bin (No default value)
log-bin foo
log-bin-compress FALSE
log-bin-compress-min-len 256
log-bin-index (No default value)

View file

@ -13,7 +13,7 @@
# force symbolic-links=0 (valgrind build has a different default)
#
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --log-bin=foo --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
# The inline perl code below will copy $MYSQL_TMP_DIR/mysqld--help.txt
# to output, but filter away some variable stuff (e.g. paths).

View file

@ -2721,7 +2721,15 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
a
DROP TABLE t1,t2;
# End of 10.2 tests
#
# MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
#
select 1 from dual where 1 in (select 5 from dual where 1);
1
create table t1 (a int);
insert into t1 values (1),(2),(3);
update t1 set a = 2 where a in (select a from dual where a = a);
drop table t1;
#
# MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
#
@ -2847,6 +2855,17 @@ INSERT INTO t2 VALUES (3),(4);
SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
ERROR 21000: Subquery returns more than 1 row
drop table t1,t2;
#
# MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
#
CREATE TABLE t1 (i1 int);
insert into t1 values (1),(2);
SELECT 1
FROM (t1 JOIN t1 AS ref_t1 ON
(t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1;
# End of 10.2 tests
# End of 10.3 tests
#
# MDEV-19134: EXISTS() slower if ORDER BY is defined

View file

@ -2236,7 +2236,17 @@ SELECT a FROM t1 WHERE (a, a) IN (SELECT 1, 2) AND a = (SELECT MIN(b) FROM t2);
DROP TABLE t1,t2;
--echo # End of 10.2 tests
--echo #
--echo # MDEV-22462: Item_in_subselect::create_single_in_to_exists_cond(JOIN *, Item **, Item **): Assertion `false' failed.
--echo #
select 1 from dual where 1 in (select 5 from dual where 1);
create table t1 (a int);
insert into t1 values (1),(2),(3);
update t1 set a = 2 where a in (select a from dual where a = a);
drop table t1;
--echo #
--echo # MDEV-18335: Assertion `!error || error == 137' failed in subselect_rowid_merge_engine::init
@ -2353,6 +2363,21 @@ INSERT INTO t2 VALUES (3),(4); # Optional, fails either way
SELECT 1 IN (SELECT (SELECT a FROM t1) AS x FROM t2 GROUP BY x);
drop table t1,t2;
--echo #
--echo # MDEV-25629: Crash in get_sort_by_table() in subquery with order by having outer ref
--echo #
CREATE TABLE t1 (i1 int);
insert into t1 values (1),(2);
--error ER_SUBQUERY_NO_1_ROW
SELECT 1
FROM (t1 JOIN t1 AS ref_t1 ON
(t1.i1 > (SELECT ref_t1.i1 AS c0 FROM t1 b ORDER BY -c0)));
DROP TABLE t1;
--echo # End of 10.2 tests
--echo # End of 10.3 tests
--echo #

View file

@ -20,7 +20,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (f INT) ENGINE=INNODB
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (f INT) ENGINE=INNODB
DROP TABLE t1,t2;
FLUSH LOGS;
RESET MASTER;
#
# Kill OPTIMIZE command after table modification
#

View file

@ -56,7 +56,7 @@ SET debug_sync = 'reset';
--source include/show_binlog_events.inc
DROP TABLE t1,t2;
FLUSH LOGS;
RESET MASTER;
--echo #
--echo # Kill OPTIMIZE command after table modification
@ -81,6 +81,9 @@ eval KILL $thd_id;
SET debug_sync = 'reset';
--disconnect con1
--let $wait_binlog_event= OPTIMIZE
--source include/wait_for_binlog_event.inc
DROP TABLE t1,t2;
let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
FLUSH LOGS;

View file

@ -40,11 +40,9 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang
galera_var_reject_queries : assertion in inline_mysql_socket_send
galera_var_replicate_myisam_on : MDEV-24062 Galera test failure on galera_var_replicate_myisam_on
galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit
#galera_wan : MDEV-17259 Test failure on galera.galera_wan
mysql-wsrep#198 : MDEV-24446: galera.mysql-wsrep#198 MTR failed: query 'reap' failed: 2000: Unknown MySQL error
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache
#sql_log_bin : MDEV-21491 galera.sql_log_bin
versioning_trx_id: MDEV-18590: galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
pxc-421: wsrep_provider is read-only for security reasons

View file

@ -264,6 +264,18 @@ t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-25271 Double free of table when inplace alter
# FTS add index fails
#
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: Error number .* means");
call mtr.add_suppression("InnoDB: Cannot create file");
call mtr.add_suppression("InnoDB: Failed to create");
CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
DROP TABLE t1;

View file

@ -52,3 +52,16 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
#
# MDEV-25663 Double free of transaction during TRUNCATE
#
call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)");
SET DEBUG_DBUG='-d,ib_create_table_fail_too_many_trx';
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET @save_dbug= @@debug_dbug;
SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
TRUNCATE t1;
ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB
SET debug_dbug=@save_dbug;
DROP TABLE t1;
# End of 10.3 tests

View file

@ -0,0 +1 @@
--enable-plugin-innodb-sys-tables

View file

@ -319,6 +319,25 @@ ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-25271 Double free of table when inplace alter
--echo # FTS add index fails
--echo #
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
call mtr.add_suppression("InnoDB: Error number .* means");
call mtr.add_suppression("InnoDB: Cannot create file");
call mtr.add_suppression("InnoDB: Failed to create");
let MYSQLD_DATADIR=`select @@datadir`;
CREATE TABLE t1(a TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL UNIQUE) ENGINE=InnoDB;
let $fts_aux_file= `select concat('FTS_',right(concat(repeat('0',16), lower(hex(TABLE_ID))),16),'_BEING_DELETED.ibd') FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME='test/t1'`;
write_file $MYSQLD_DATADIR/test/$fts_aux_file;
EOF
--error ER_GET_ERRNO
ALTER TABLE t1 ADD FULLTEXT(a), ALGORITHM=INPLACE;
DROP TABLE t1;
remove_file $MYSQLD_DATADIR/test/$fts_aux_file;
# Add more than one FTS index
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);

View file

@ -83,3 +83,18 @@ ALTER TABLE t1 ADD bl INT AS (LENGTH(b)) VIRTUAL;
CHECK TABLE t1;
DROP TABLE t1;
--source include/wait_until_count_sessions.inc
--echo #
--echo # MDEV-25663 Double free of transaction during TRUNCATE
--echo #
call mtr.add_suppression("InnoDB: \\(Too many concurrent transactions\\)");
SET DEBUG_DBUG='-d,ib_create_table_fail_too_many_trx';
CREATE TABLE t1 (b CHAR(12), FULLTEXT KEY(b)) engine=InnoDB;
SET @save_dbug= @@debug_dbug;
SET debug_dbug='+d,ib_create_table_fail_too_many_trx';
--error ER_GET_ERRNO
TRUNCATE t1;
SET debug_dbug=@save_dbug;
DROP TABLE t1;
--echo # End of 10.3 tests

View file

@ -0,0 +1,121 @@
install soname 'auth_ed25519';
flush status;
flush hosts;
flush user_resources;
flush privileges;
select `User`, `Host` from mysql.`user` where `host` like '%\\%%';
User Host
select `User`, `Host` from mysql.`user` where `user` like '192.%';
User Host
select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user plug1@'santa.claus.ipv4.example.com'
identified with ed25519;
update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'foo') where user='plug1';
flush privileges;
create user plug2@'santa.claus.ipv4.example.com'
identified with ED25519 as 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI';
set @saved_dbug = @@global.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
connect(127.0.0.1,plug1,foo,test,PORT,SOCKET);
connect con1, 127.0.0.1, plug1,foo,,$MASTER_MYPORT;
ERROR 28000: Access denied for user 'plug1'@'santa.claus.ipv4.example.com' (using password: YES)
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
HOST_VALIDATED YES
SUM_CONNECT_ERRORS 1
COUNT_HOST_BLOCKED_ERRORS 0
COUNT_NAMEINFO_TRANSIENT_ERRORS 0
COUNT_NAMEINFO_PERMANENT_ERRORS 0
COUNT_FORMAT_ERRORS 0
COUNT_ADDRINFO_TRANSIENT_ERRORS 0
COUNT_ADDRINFO_PERMANENT_ERRORS 0
COUNT_FCRDNS_ERRORS 0
COUNT_HOST_ACL_ERRORS 0
COUNT_NO_AUTH_PLUGIN_ERRORS 0
COUNT_AUTH_PLUGIN_ERRORS 0
COUNT_HANDSHAKE_ERRORS 1
COUNT_PROXY_USER_ERRORS 0
COUNT_PROXY_USER_ACL_ERRORS 0
COUNT_AUTHENTICATION_ERRORS 0
COUNT_SSL_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
COUNT_DEFAULT_DATABASE_ERRORS 0
COUNT_INIT_CONNECT_ERRORS 0
COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
connect(127.0.0.1,plug2,bar,test,PORT,SOCKET);
connect con1, 127.0.0.1, plug2,bar,,$MASTER_MYPORT;
ERROR 28000: Access denied for user 'plug2'@'santa.claus.ipv4.example.com' (using password: YES)
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
HOST_VALIDATED YES
SUM_CONNECT_ERRORS 1
COUNT_HOST_BLOCKED_ERRORS 0
COUNT_NAMEINFO_TRANSIENT_ERRORS 0
COUNT_NAMEINFO_PERMANENT_ERRORS 0
COUNT_FORMAT_ERRORS 0
COUNT_ADDRINFO_TRANSIENT_ERRORS 0
COUNT_ADDRINFO_PERMANENT_ERRORS 0
COUNT_FCRDNS_ERRORS 0
COUNT_HOST_ACL_ERRORS 0
COUNT_NO_AUTH_PLUGIN_ERRORS 0
COUNT_AUTH_PLUGIN_ERRORS 0
COUNT_HANDSHAKE_ERRORS 1
COUNT_PROXY_USER_ERRORS 0
COUNT_PROXY_USER_ACL_ERRORS 0
COUNT_AUTHENTICATION_ERRORS 1
COUNT_SSL_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
COUNT_DEFAULT_DATABASE_ERRORS 0
COUNT_INIT_CONNECT_ERRORS 0
COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
connect con1, 127.0.0.1, plug2,foo,,$MASTER_MYPORT;
select current_user();
current_user()
plug2@santa.claus.ipv4.example.com
disconnect con1;
connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
HOST_VALIDATED YES
SUM_CONNECT_ERRORS 0
COUNT_HOST_BLOCKED_ERRORS 0
COUNT_NAMEINFO_TRANSIENT_ERRORS 0
COUNT_NAMEINFO_PERMANENT_ERRORS 0
COUNT_FORMAT_ERRORS 0
COUNT_ADDRINFO_TRANSIENT_ERRORS 0
COUNT_ADDRINFO_PERMANENT_ERRORS 0
COUNT_FCRDNS_ERRORS 0
COUNT_HOST_ACL_ERRORS 0
COUNT_NO_AUTH_PLUGIN_ERRORS 0
COUNT_AUTH_PLUGIN_ERRORS 0
COUNT_HANDSHAKE_ERRORS 1
COUNT_PROXY_USER_ERRORS 0
COUNT_PROXY_USER_ACL_ERRORS 0
COUNT_AUTHENTICATION_ERRORS 1
COUNT_SSL_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_ERRORS 0
COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 0
COUNT_DEFAULT_DATABASE_ERRORS 0
COUNT_INIT_CONNECT_ERRORS 0
COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
drop user plug1@'santa.claus.ipv4.example.com';
drop user plug2@'santa.claus.ipv4.example.com';
set @@global.debug_dbug = @saved_dbug;
uninstall plugin ed25519;

View file

@ -0,0 +1,56 @@
#
# Tests for the performance_schema host_cache.
#
# Test authorization with auth plugins.
# error reporting in:
# - column COUNT_AUTH_PLUGIN_ERRORS
# - column COUNT_PROXY_USER_ERRORS
# - column COUNT_PROXY_USER_ACL_ERRORS
source include/not_embedded.inc;
source include/have_debug.inc;
source include/have_perfschema.inc;
source include/have_plugin_auth.inc;
source include/have_hostname_cache.inc;
if (!$AUTH_ED25519_SO) {
skip No auth_ed25519 plugin;
}
install soname 'auth_ed25519';
# Enforce a clean state
source ../include/wait_for_pfs_thread_count.inc;
source ../include/hostcache_set_state.inc;
create user plug1@'santa.claus.ipv4.example.com'
identified with ed25519;
update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'foo') where user='plug1';
flush privileges;
create user plug2@'santa.claus.ipv4.example.com'
identified with ED25519 as 'vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI';
set @saved_dbug = @@global.debug_dbug;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET;
error ER_ACCESS_DENIED_ERROR;
connect con1, 127.0.0.1, plug1,foo,,$MASTER_MYPORT;
source ../include/hostcache_dump.inc;
replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET;
error ER_ACCESS_DENIED_ERROR;
connect con1, 127.0.0.1, plug2,bar,,$MASTER_MYPORT;
source ../include/hostcache_dump.inc;
connect con1, 127.0.0.1, plug2,foo,,$MASTER_MYPORT;
select current_user();
disconnect con1;
connection default;
source ../include/hostcache_dump.inc;
drop user plug1@'santa.claus.ipv4.example.com';
drop user plug2@'santa.claus.ipv4.example.com';
set @@global.debug_dbug = @saved_dbug;
uninstall plugin ed25519;

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2017, MariaDB
Copyright (c) 2017, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -42,7 +42,7 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
/* prepare random nonce */
if (my_random_bytes((unsigned char *)nonce, (int)sizeof(nonce)))
return CR_AUTH_USER_CREDENTIALS;
return CR_ERROR; // eh? OpenSSL error
/* send it */
if (vio->write_packet(vio, reply + CRYPTO_BYTES, NONCE_BYTES))
@ -55,7 +55,7 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
if (crypto_sign_open(reply, CRYPTO_BYTES + NONCE_BYTES,
(unsigned char*)info->auth_string))
return CR_ERROR;
return CR_AUTH_USER_CREDENTIALS; // wrong password provided by the user
return CR_OK;
}

View file

@ -875,7 +875,9 @@ get_openssl()
readonly OPENSSL_BINARY
}
#
# Generate a string equivalent to 16 random bytes
#
wsrep_gen_secret()
{
get_openssl
@ -889,16 +891,36 @@ wsrep_gen_secret()
fi
}
#
# Checking if the address passed to us is local.
# If the second parameter is nonzero, then this function
# does not check for matches with local domain names:
#
is_local_ip()
{
[ "$1" = '127.0.0.1' ] && return 0
[ "$1" = '127.0.0.2' ] && return 0
[ "$1" = 'localhost' ] && return 0
[ "$1" = '[::1]' ] && return 0
[ "$1" = "$(hostname -s)" ] && return 0
[ "$1" = "$(hostname -f)" ] && return 0
[ "$1" = "$(hostname -d)" ] && return 0
# Rapid recognition of the most common cases:
[ "$1" = '127.0.0.1' -o \
"$1" = '127.0.0.2' -o \
"$1" = 'localhost' -o \
"$1" = '[::1]' ] && return 0
# If the address starts with "127." this is probably a local
# address, but we need to clarify what follows this prefix:
if [ "${1#127.}" != "$1" ]; then
# All 127.0.0.0/8 addresses are local:
if echo "$1" | grep -q -E '^127\.[0-9]+\.[0-9]+\.[0-9]+$'; then
return 0
fi
fi
# If the second parameter is nonzero, then we will skip
# the domain name check:
if [ "${2:-0}" -eq 0 ]; then
# We consider all the names of a given host to be local addresses:
[ "$1" = "$(hostname -s)" -o \
"$1" = "$(hostname -f)" -o \
"$1" = "$(hostname -d)" ] && return 0
fi
# Now let's check if the given address is assigned to
# one of the network cards:
local ip_util="$(command -v ip)"
if [ -n "$ip_util" ]; then
# ip address show ouput format is " inet[6] <address>/<mask>":
@ -914,7 +936,6 @@ is_local_ip()
| grep -F " $1 " >/dev/null && return 0
fi
fi
return 1
}

View file

@ -5830,6 +5830,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
*/
set_max_sum_func_level(thd, select);
set_field(new_field);
depended_from= (*((Item_field**)res))->depended_from;
return 0;
}
else

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2016, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -2285,7 +2285,8 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
*/
Item *item= (Item*) select_lex->item_list.head();
if (select_lex->table_list.elements)
if (select_lex->table_list.elements ||
!(select_lex->master_unit()->is_unit_op()))
{
Item *having= item;
Item *orig_item= item;
@ -2333,8 +2334,7 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
}
else
{
if (select_lex->master_unit()->is_unit_op())
{
DBUG_ASSERT(select_lex->master_unit()->is_unit_op());
LEX_CSTRING field_name= {STRING_WITH_LEN("<result>") };
Item *new_having=
func->create(thd, expr,
@ -2357,9 +2357,6 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
DBUG_RETURN(true);
*having_item= new_having;
}
else
DBUG_ASSERT(false);
}
}
DBUG_RETURN(false);

View file

@ -5126,7 +5126,7 @@ static int init_server_components()
}
#endif /* WITH_WSREP */
if (opt_bin_log)
if (!opt_help && opt_bin_log)
{
if (mysql_bin_log.open_index_file(opt_binlog_index_name, opt_bin_logname,
TRUE))

View file

@ -582,7 +582,7 @@ extern ulonglong my_pcre_frame_size;
*/
extern my_bool opt_large_pages;
extern uint opt_large_page_size;
extern char lc_messages_dir[FN_REFLEN];
extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
extern char *lc_messages_dir_ptr, *log_error_file_ptr;
extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;

View file

@ -13526,7 +13526,12 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
done:
if (set_user_salt_if_needed(mpvio->acl_user, mpvio->curr_auth, mpvio->plugin))
{
ai->thd->clear_error(); // authenticating user should not see these errors
my_error(ER_ACCESS_DENIED_ERROR, MYF(0), ai->thd->security_ctx->user,
ai->thd->security_ctx->host_or_ip, ER_THD(ai->thd, ER_YES));
goto err;
}
ai->user_name= ai->thd->security_ctx->user;
ai->user_name_length= (uint) strlen(ai->user_name);

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB Corporation.
Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -990,7 +990,7 @@ mysqld_collation_get_by_name(const char *name,
static inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
return MY_TEST(cs->mbminlen == 1 && cs->number != 17 /* filename */);
}
#ifdef MYSQL_SERVER
@ -4993,7 +4993,6 @@ public:
THD_TRANS::EXECUTED_TABLE_ADMIN_CMD));
}
uint get_net_wait_timeout()
{
if (in_active_multi_stmt_transaction())

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB Corporation
Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -8886,7 +8886,7 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type, bool for_update
tables->lock_type= lock_type;
tables->updating= for_update;
if (tables->db.str && tables->db.str[0])
if (tables->db.length)
tables->mdl_request.set_type((lock_type >= TL_WRITE_ALLOW_WRITE) ?
MDL_SHARED_WRITE : MDL_SHARED_READ);
}

View file

@ -884,6 +884,13 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
{
LEX *lex= thd->lex;
/*
Ensure character set number != 17 (character set = filename) and mbminlen=1
because these character sets are not parser friendly, which can give weird
sequence in .frm file of view and later give parsing error.
*/
DBUG_ASSERT(thd->charset()->mbminlen == 1 && thd->charset()->number != 17);
/*
View definition query -- a SELECT statement that fully defines view. It
is generated from the Item-tree built from the original (specified by

View file

@ -413,11 +413,11 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/JavaWrappers.jar
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT connect-engine)
IF(CONNECT_WITH_MONGO)
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/Mongo2.jar
${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/connect/std_data/Mongo3.jar
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT connect-engine)
ENDIF()
ENDIF()

View file

@ -57,8 +57,8 @@ extern "C" HINSTANCE s_hModule; // Saved module handle
extern char *JvmPath; // The connect_jvm_path global variable value
extern char *ClassPath; // The connect_class_path global variable value
char *GetPluginDir(void);
char *GetJavaWrapper(void); // The connect_java_wrapper variable value
extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
/***********************************************************************/
/* Static JAVAConn objects. */
@ -401,23 +401,23 @@ bool JAVAConn::Open(PGLOBAL g)
} // endif ClassPath
#if 0
// Java source will be compiled as a jar file installed in the plugin dir
// Java source will be compiled as a jar file installed in the mysql share dir
jpop->Append(sep);
jpop->Append(GetPluginDir());
jpop->Append(lc_messages_dir);
jpop->Append("JdbcInterface.jar");
#endif // 0
// All wrappers are pre-compiled in JavaWrappers.jar in the plugin dir
// All wrappers are pre-compiled in JavaWrappers.jar in the mysql share dir
jpop->Append(sep);
jpop->Append(GetPluginDir());
jpop->Append(lc_messages_dir);
jpop->Append("JavaWrappers.jar");
#if defined(MONGO_SUPPORT)
jpop->Append(sep);
jpop->Append(GetPluginDir());
jpop->Append(lc_messages_dir);
jpop->Append("Mongo3.jar");
jpop->Append(sep);
jpop->Append(GetPluginDir());
jpop->Append(lc_messages_dir);
jpop->Append("Mongo2.jar");
#endif // MONGO_SUPPORT

View file

@ -1787,7 +1787,6 @@ fts_create_one_common_table(
dict_table_add_system_columns(new_table, heap);
error = row_create_table_for_mysql(new_table, trx,
FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);
if (error == DB_SUCCESS) {
dict_index_t* index = dict_mem_index_create(
@ -1808,17 +1807,22 @@ fts_create_one_common_table(
error = row_create_index_for_mysql(index, trx, NULL);
trx->dict_operation = op;
} else {
err_exit:
new_table = NULL;
ib::warn() << "Failed to create FTS common table "
<< fts_table_name;
trx->error_state = error;
return NULL;
}
if (error != DB_SUCCESS) {
dict_mem_table_free(new_table);
new_table = NULL;
ib::warn() << "Failed to create FTS common table "
<< fts_table_name;
trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(fts_table_name, trx, SQLCOM_DROP_DB);
trx->error_state = error;
goto err_exit;
}
return(new_table);
}
@ -1864,6 +1868,8 @@ fts_create_common_tables(
FTS_INIT_FTS_TABLE(&fts_table, NULL, FTS_COMMON_TABLE, table);
op = trx_get_dict_operation(trx);
error = fts_drop_common_tables(trx, &fts_table);
if (error != DB_SUCCESS) {
@ -1879,7 +1885,8 @@ fts_create_common_tables(
dict_table_t* common_table = fts_create_one_common_table(
trx, table, full_name[i], fts_table.suffix, heap);
if (common_table == NULL) {
if (!common_table) {
trx->error_state = DB_SUCCESS;
error = DB_ERROR;
goto func_exit;
} else {
@ -1925,8 +1932,6 @@ fts_create_common_tables(
error = row_create_index_for_mysql(index, trx, NULL);
trx->dict_operation = op;
func_exit:
if (error != DB_SUCCESS) {
for (it = common_tables.begin(); it != common_tables.end();
@ -1936,6 +1941,8 @@ func_exit:
}
}
trx->dict_operation = op;
common_tables.clear();
mem_heap_free(heap);
@ -2019,16 +2026,20 @@ fts_create_one_index_table(
error = row_create_index_for_mysql(index, trx, NULL);
trx->dict_operation = op;
} else {
err_exit:
new_table = NULL;
ib::warn() << "Failed to create FTS index table "
<< table_name;
trx->error_state = error;
return NULL;
}
if (error != DB_SUCCESS) {
dict_mem_table_free(new_table);
new_table = NULL;
ib::warn() << "Failed to create FTS index table "
<< table_name;
trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(table_name, trx, SQLCOM_DROP_DB);
trx->error_state = error;
goto err_exit;
}
return(new_table);

View file

@ -6369,7 +6369,9 @@ ha_innobase::open(const char* name, int, uint)
/* Index block size in InnoDB: used by MySQL in query optimization */
stats.block_size = srv_page_size;
if (m_prebuilt->table == NULL
const my_bool for_vc_purge = THDVAR(thd, background_thread);
if (for_vc_purge || !m_prebuilt->table
|| m_prebuilt->table->is_temporary()
|| m_prebuilt->table->persistent_autoinc
|| !m_prebuilt->table->is_readable()) {
@ -6396,7 +6398,7 @@ ha_innobase::open(const char* name, int, uint)
ut_ad(!m_prebuilt->table
|| table->versioned() == m_prebuilt->table->versioned());
if (!THDVAR(thd, background_thread)) {
if (!for_vc_purge) {
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST
| HA_STATUS_OPEN);
}
@ -12856,7 +12858,6 @@ create_table_info_t::create_table_update_dict()
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
srv_active_wake_master_thread();
m_trx->free();
DBUG_RETURN(-1);
}
@ -12983,19 +12984,12 @@ ha_innobase::create(
}
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
if (own_trx) {
trx->free();
}
DBUG_RETURN(error);
goto func_exit;
}
innobase_commit_low(trx);
row_mysql_unlock_data_dictionary(trx);
if (own_trx) {
trx->free();
}
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
with innodb_flush_log_at_trx_commit = 0 */
@ -13005,6 +12999,11 @@ ha_innobase::create(
error = info.create_table_update_dict();
func_exit:
if (own_trx) {
trx->free();
}
/* Tell the InnoDB server that there might be work for
utility threads: */

View file

@ -588,14 +588,13 @@ else()
set(GRN_WITH_MESSAGE_PACK FALSE)
endif()
option(GRN_WITH_MRUBY "use mruby" OFF)
if(GRN_WITH_MRUBY)
find_program(RUBY NAMES
"ruby2.3" "ruby23"
"ruby2.2" "ruby22"
"ruby2.1" "ruby21"
"ruby")
option(GRN_WITH_MRUBY "use mruby" OFF)
if(GRN_WITH_MRUBY)
set(MRUBY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/mruby-source/include")
set(MRUBY_LIBS mruby)