diff --git a/CMakeLists.txt b/CMakeLists.txt index c6a6715f6fe..6a4b8d18651 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,11 +123,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 ed3b702b817..fc90529a8b5 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -85,6 +85,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 f64d16918d2..0f1aafe388d 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -125,8 +125,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 d45401be290..d938788aded 100644 --- a/dbug/CMakeLists.txt +++ b/dbug/CMakeLists.txt @@ -30,7 +30,7 @@ IF(NOT CMAKE_CROSSCOMPILING OR DEFINED CMAKE_CROSSCOMPILING_EMULATOR) 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 e2500269438..6cf529163cd 100644 --- a/debian/mariadb-plugin-connect.install +++ b/debian/mariadb-plugin-connect.install @@ -1,2 +1,6 @@ etc/mysql/mariadb.conf.d/connect.cnf 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 2eee5d2888e..aaccea91793 100644 --- a/mysql-test/main/ctype_filename.result +++ b/mysql-test/main/ctype_filename.result @@ -22,21 +22,50 @@ 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; -# -# Start of 10.5 tests -# +# End of 10.3 tests # # MDEV-22043 Special character leads to assertion in my_wc_to_printable_generic on 10.5.2 (debug) # SET NAMES filename; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'filename' EXECUTE IMMEDIATE _latin1 0x01; -ERROR 42000: You@0020have@0020an@0020error@0020in@0020your@0020SQL@0020syntax@003b@0020check@0020the@0020manual@0020that@0020corresponds@0020to@0020your@0020MariaDB@0020server@0020version@0020for@0020the@0020right@0020syntax@0020to@0020use@0020near@0020@0027@005c0001@0027@0020at@0020line@00201 +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 '\0001' at line 1 SET NAMES utf8; # # MDEV-23435 Functions do not convert numbers to character_set_results @@ -103,6 +132,4 @@ a c @002d1 @002d1 DROP TABLE t1; SET NAMES utf8; -# # End of 10.5 tests -# diff --git a/mysql-test/main/ctype_filename.test b/mysql-test/main/ctype_filename.test index 17ab71e3985..ba42d1a2807 100644 --- a/mysql-test/main/ctype_filename.test +++ b/mysql-test/main/ctype_filename.test @@ -28,25 +28,49 @@ 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 # ---echo # Start of 10.5 tests ---echo # +--echo # End of 10.3 tests --echo # --echo # MDEV-22043 Special character leads to assertion in my_wc_to_printable_generic on 10.5.2 (debug) --echo # +--error ER_WRONG_VALUE_FOR_VAR SET NAMES filename; --error ER_PARSE_ERROR EXECUTE IMMEDIATE _latin1 0x01; @@ -114,7 +138,4 @@ SET NAMES utf8; --enable_ps_protocol - ---echo # --echo # End of 10.5 tests ---echo # diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 141ef94ad59..7b0ce27ead3 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -1566,7 +1566,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 4405b198951..f918670d319 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 3bfb755120b..7b97f499768 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 # @@ -2848,6 +2856,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 a1a4108de37..2f65db875f8 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 @@ -2355,6 +2365,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 38ce0bd0e1d..e5573bd4409 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -42,11 +42,11 @@ 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 + +MDEV-25562: MDEV-25562 FIXME: lock wait timeout exceeded diff --git a/mysql-test/suite/galera/r/MDEV-25562.result b/mysql-test/suite/galera/r/MDEV-25562.result new file mode 100644 index 00000000000..b0d77af374b --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-25562.result @@ -0,0 +1,16 @@ +connection node_2; +connection node_1; +SET SESSION WSREP_ON=0; +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +SET SESSION WSREP_ON=1; +UNLOCK TABLES; +SET GLOBAL wsrep_ignore_apply_errors=1; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +ERROR 42S01: Table 't1' already exists +SHOW PROCEDURE STATUS WHERE db = 'test'; +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +SET GLOBAL read_only=1; +SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +SET GLOBAL read_only=DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-25562.test b/mysql-test/suite/galera/t/MDEV-25562.test new file mode 100644 index 00000000000..01729936b08 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-25562.test @@ -0,0 +1,23 @@ +# +# MDEV-25562 Assertion `pause_seqno_.is_undefined() == false' failed in void wsrep::server_state::resume() +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +SET SESSION WSREP_ON=0; +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +SET SESSION WSREP_ON=1; +UNLOCK TABLES; + +SET GLOBAL wsrep_ignore_apply_errors=1; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +--error ER_TABLE_EXISTS_ERROR +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +SHOW PROCEDURE STATUS WHERE db = 'test'; +SET GLOBAL read_only=1; + +SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +SET GLOBAL read_only=DEFAULT; +DROP TABLE t1; + 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..6e3d928509c --- /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]
/