summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-05-25 15:38:57 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-05-25 15:38:57 +0300
commit1dea7f79779d13695876b84ebecbf41c13d845cb (patch)
treefec8bf2607e69a9c6069001bb0de1f33fcae46ba
parent04de651725c3eeee8f216c55e2f8133e4547fadb (diff)
parent1864a8ea93aa1d1a540c83526a25df2ad0330763 (diff)
downloadmariadb-git-1dea7f79779d13695876b84ebecbf41c13d845cb.tar.gz
Merge 10.3 into 10.4
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/FindGit.cmake13
-rw-r--r--cmake/FindJNI.cmake5
-rw-r--r--cmake/FindJava.cmake5
-rw-r--r--cmake/build_configurations/mysql_release.cmake6
-rw-r--r--cmake/cpack_rpm.cmake2
-rw-r--r--cmake/cpu_info.cmake4
-rw-r--r--dbug/CMakeLists.txt2
-rw-r--r--debian/mariadb-plugin-connect.install4
-rw-r--r--mysql-test/main/ctype_filename.result33
-rw-r--r--mysql-test/main/ctype_filename.test28
-rw-r--r--mysql-test/main/mysqld--help.result2
-rw-r--r--mysql-test/main/mysqld--help.test2
-rw-r--r--mysql-test/main/subselect4.result21
-rw-r--r--mysql-test/main/subselect4.test27
-rw-r--r--mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result2
-rw-r--r--mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test5
-rw-r--r--mysql-test/suite/galera/disabled.def2
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result12
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_debug.result13
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt1
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test19
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_debug.test15
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result121
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test56
-rw-r--r--plugin/auth_ed25519/server_ed25519.c6
-rw-r--r--scripts/wsrep_sst_common.sh39
-rw-r--r--sql/item.cc1
-rw-r--r--sql/item_subselect.cc39
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/mysqld.h2
-rw-r--r--sql/sql_acl.cc5
-rw-r--r--sql/sql_class.h5
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_parse.cc6
-rw-r--r--sql/sql_view.cc7
-rw-r--r--storage/connect/CMakeLists.txt4
-rw-r--r--storage/connect/javaconn.cpp14
-rw-r--r--storage/innobase/fts/fts0fts.cc35
-rw-r--r--storage/innobase/handler/ha_innodb.cc21
-rw-r--r--storage/mroonga/vendor/groonga/CMakeLists.txt11
41 files changed, 509 insertions, 92 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35ef2f4b269..c4c43d27609 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/cmake/FindGit.cmake b/cmake/FindGit.cmake
new file mode 100644
index 00000000000..8178b614a3e
--- /dev/null
+++ b/cmake/FindGit.cmake
@@ -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})
diff --git a/cmake/FindJNI.cmake b/cmake/FindJNI.cmake
index fb2f4801a70..12305d7c86d 100644
--- a/cmake/FindJNI.cmake
+++ b/cmake/FindJNI.cmake
@@ -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()
diff --git a/cmake/FindJava.cmake b/cmake/FindJava.cmake
index 95bbf8682cd..714f56b1f72 100644
--- a/cmake/FindJava.cmake
+++ b/cmake/FindJava.cmake
@@ -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()
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 8fdce6c5951..7dadc20d060 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -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 "")
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index be0252e36a4..d78b3c98fe2 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -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"
)
diff --git a/cmake/cpu_info.cmake b/cmake/cpu_info.cmake
index 1acfad5897f..2abeb5e12c1 100644
--- a/cmake/cpu_info.cmake
+++ b/cmake/cpu_info.cmake
@@ -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()
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 8941ac5fc27..a6573b7444e 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -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)
diff --git a/debian/mariadb-plugin-connect.install b/debian/mariadb-plugin-connect.install
index 22d73c7df05..71849a200a8 100644
--- a/debian/mariadb-plugin-connect.install
+++ b/debian/mariadb-plugin-connect.install
@@ -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
diff --git a/mysql-test/main/ctype_filename.result b/mysql-test/main/ctype_filename.result
index 7536ea97fb1..955e1ff8a8f 100644
--- a/mysql-test/main/ctype_filename.result
+++ b/mysql-test/main/ctype_filename.result
@@ -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
diff --git a/mysql-test/main/ctype_filename.test b/mysql-test/main/ctype_filename.test
index 6f77a6c5a3a..0c38172a0ef 100644
--- a/mysql-test/main/ctype_filename.test
+++ b/mysql-test/main/ctype_filename.test
@@ -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
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index 45b1e4afe05..c008df32257 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -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)
diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test
index 6fff3f51006..b54af092a5e 100644
--- a/mysql-test/main/mysqld--help.test
+++ b/mysql-test/main/mysqld--help.test
@@ -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).
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 4452c456022..e4e9a5c8917 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -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
diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test
index a2dfc48ffe2..329a6726a6b 100644
--- a/mysql-test/main/subselect4.test
+++ b/mysql-test/main/subselect4.test
@@ -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 #
diff --git a/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result b/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
index a2eb7ee5c0a..d9bfead8dd1 100644
--- a/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
+++ b/mysql-test/suite/binlog/r/binlog_admin_cmd_kill.result
@@ -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
#
diff --git a/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test b/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
index 9b248097ae2..e2397f0eab8 100644
--- a/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
+++ b/mysql-test/suite/binlog/t/binlog_admin_cmd_kill.test
@@ -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;
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index bd7ebd5a95a..590a8623223 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -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
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
index b50bf047265..a64086c9802 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
@@ -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;
diff --git a/mysql-test/suite/innodb_fts/r/misc_debug.result b/mysql-test/suite/innodb_fts/r/misc_debug.result
index 10e3cf8874d..41f8d08ea7d 100644
--- a/mysql-test/suite/innodb_fts/r/misc_debug.result
+++ b/mysql-test/suite/innodb_fts/r/misc_debug.result
@@ -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
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
new file mode 100644
index 00000000000..e6ae8d0fe0a
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.opt
@@ -0,0 +1 @@
+--enable-plugin-innodb-sys-tables
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
index 7c56811a2d9..78494910b48 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
@@ -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);
diff --git a/mysql-test/suite/innodb_fts/t/misc_debug.test b/mysql-test/suite/innodb_fts/t/misc_debug.test
index 461e3f1d9d4..90cb84976ce 100644
--- a/mysql-test/suite/innodb_fts/t/misc_debug.test
+++ b/mysql-test/suite/innodb_fts/t/misc_debug.test
@@ -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
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result
new file mode 100644
index 00000000000..fdb2c53fcf3
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_ed25519.result
@@ -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;
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test
new file mode 100644
index 00000000000..4c68d3af51e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_auth_ed25519.test
@@ -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;
diff --git a/plugin/auth_ed25519/server_ed25519.c b/plugin/auth_ed25519/server_ed25519.c
index 6fec98c56fc..b789bd34ca4 100644
--- a/plugin/auth_ed25519/server_ed25519.c
+++ b/plugin/auth_ed25519/server_ed25519.c
@@ -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;
}
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index f4ac2e9936d..952a37f75d2 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -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
}
diff --git a/sql/item.cc b/sql/item.cc
index 6c52ade0d9f..94e21473a34 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -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
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 0fd64542e17..4734a1aaebc 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -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,11 +2285,12 @@ 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;
-
+
item= func->create(thd, expr, item);
if (!abort_on_null && orig_item->maybe_null)
{
@@ -2333,32 +2334,28 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
}
else
{
- if (select_lex->master_unit()->is_unit_op())
- {
- LEX_CSTRING field_name= {STRING_WITH_LEN("<result>") };
- Item *new_having=
- func->create(thd, expr,
- new (thd->mem_root) Item_ref_null_helper(thd,
+ DBUG_ASSERT(select_lex->master_unit()->is_unit_op());
+ LEX_CSTRING field_name= {STRING_WITH_LEN("<result>") };
+ Item *new_having=
+ func->create(thd, expr,
+ new (thd->mem_root) Item_ref_null_helper(thd,
&select_lex->context,
this,
&select_lex->ref_pointer_array[0],
(char *)"<no matter>",
&field_name));
- if (!abort_on_null && left_expr->maybe_null)
- {
- disable_cond_guard_for_const_null_left_expr(0);
- if (!(new_having= new (thd->mem_root) Item_func_trig_cond(thd, new_having,
+ if (!abort_on_null && left_expr->maybe_null)
+ {
+ disable_cond_guard_for_const_null_left_expr(0);
+ if (!(new_having= new (thd->mem_root) Item_func_trig_cond(thd, new_having,
get_cond_guard(0))))
- DBUG_RETURN(true);
- }
-
- new_having->name= in_having_cond;
- if (fix_having(new_having, select_lex))
DBUG_RETURN(true);
- *having_item= new_having;
}
- else
- DBUG_ASSERT(false);
+
+ new_having->name= in_having_cond;
+ if (fix_having(new_having, select_lex))
+ DBUG_RETURN(true);
+ *having_item= new_having;
}
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7e3ce878cdc..a5a3f650990 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -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))
diff --git a/sql/mysqld.h b/sql/mysqld.h
index f4d0d891a0f..6a462d25abb 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -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;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 70607a0cf8e..eed20b040c3 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -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);
diff --git a/sql/sql_class.h b/sql/sql_class.h
index cb34067298c..6d6d15fba5e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -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())
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c63a3b5273c..93a4fcbe277 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -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
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 82b81a2bf4e..e12817d231c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -8184,7 +8184,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->is_fqtn= TRUE;
ptr->db= table->db;
}
- else if (!lex->with_cte_resolution && lex->copy_db_to(&ptr->db))
+ else if (!lex->with_cte_resolution && lex->copy_db_to(&ptr->db))
DBUG_RETURN(0);
else
ptr->is_fqtn= FALSE;
@@ -8199,7 +8199,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
if (ptr->db.length && ptr->db.str != any_db)
ptr->db.length= my_casedn_str(files_charset_info, (char*) ptr->db.str);
}
-
+
ptr->table_name= table->table;
ptr->lock_type= lock_type;
ptr->mdl_type= mdl_type;
@@ -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);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 1e3c4ce2a94..c81b5db0d26 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -885,6 +885,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
the user) query. The idea is that generated query should eliminates all
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 2c8d0e07aa1..52d6c0aebb0 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -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()
diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp
index cdf925d63a7..af5986dad81 100644
--- a/storage/connect/javaconn.cpp
+++ b/storage/connect/javaconn.cpp
@@ -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
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index dbfd37544e6..35d3d0edd34 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -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);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 6107f2bb1f4..c2bd8cb8403 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -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: */
diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt
index d271d4c4eb9..2929338d7b1 100644
--- a/storage/mroonga/vendor/groonga/CMakeLists.txt
+++ b/storage/mroonga/vendor/groonga/CMakeLists.txt
@@ -588,14 +588,13 @@ else()
set(GRN_WITH_MESSAGE_PACK FALSE)
endif()
-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)
+ find_program(RUBY NAMES
+ "ruby2.3" "ruby23"
+ "ruby2.2" "ruby22"
+ "ruby2.1" "ruby21"
+ "ruby")
set(MRUBY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/mruby-source/include")
set(MRUBY_LIBS mruby)