summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-07-02 17:00:05 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-07-02 17:00:05 +0300
commit0ad8a825a8901d4b5e704fed3fc65e93cea18f18 (patch)
tree69238e9b52a7166b603e3ebbb2c7ea1b616765ed
parent315380a4d16ddb16461d906a23be341e354c30ed (diff)
parent779262842edf86c989c099c6930ae4683cbde609 (diff)
downloadmariadb-git-0ad8a825a8901d4b5e704fed3fc65e93cea18f18.tar.gz
Merge 10.5 into 10.6
-rw-r--r--.gitignore3
-rw-r--r--cmake/cpack_rpm.cmake6
-rw-r--r--cmake/submodules.cmake2
-rw-r--r--mysql-test/include/not_aix.inc4
-rw-r--r--mysql-test/main/cte_nonrecursive.result55
-rw-r--r--mysql-test/main/cte_nonrecursive.test29
-rw-r--r--mysql-test/main/derived_cond_pushdown.result202
-rw-r--r--mysql-test/main/derived_cond_pushdown.test87
-rw-r--r--mysql-test/main/gis-json.result10
-rw-r--r--mysql-test/main/gis-json.test7
-rw-r--r--mysql-test/main/information_schema-big.result4
-rw-r--r--mysql-test/main/information_schema.result2
-rw-r--r--mysql-test/main/information_schema_all_engines.result12
-rw-r--r--mysql-test/main/mdev-21101.test1
-rw-r--r--mysql-test/suite.pm1
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result100
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result100
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result174
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result175
-rw-r--r--mysql-test/suite/galera/r/lp1376747-4.result2
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf12
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test9
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf15
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test9
-rw-r--r--mysql-test/suite/galera/t/lp1376747-4.test2
-rw-r--r--mysql-test/suite/innodb/r/alter_partitioned.result43
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result17
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result24
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff6
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result21
-rw-r--r--mysql-test/suite/innodb/t/alter_partitioned.test53
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test7
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test26
-rw-r--r--mysql-test/suite/plugins/r/multiauth,aix.rdiff14
-rw-r--r--mysql-test/suite/plugins/t/multiauth.test1
-rw-r--r--scripts/wsrep_sst_common.sh8
-rw-r--r--scripts/wsrep_sst_mariabackup.sh2
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item_create.cc3
-rw-r--r--sql/lex.h7
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/spatial.cc6
-rw-r--r--sql/sql_derived.cc63
-rw-r--r--sql/sql_derived.h5
-rw-r--r--sql/sql_lex.cc13
-rw-r--r--sql/sql_show.cc82
-rw-r--r--sql/sql_table.cc10
-rw-r--r--sql/wsrep_sst.cc5
-rw-r--r--storage/innobase/os/os0file.cc38
-rw-r--r--storage/innobase/rem/rem0rec.cc45
52 files changed, 1429 insertions, 104 deletions
diff --git a/.gitignore b/.gitignore
index 79f64810812..29fa2ddb2fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -542,6 +542,9 @@ compile_commands.json
# Clion && other JetBrains ides
.idea
+.cache/clangd
+
+
client/mariadb
client/mariadb-admin
client/mariadb-binlog
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 412e5cbf4ef..19a4b484538 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -128,7 +128,11 @@ SET(ignored
"%ignore ${CMAKE_INSTALL_PREFIX}/share/pkgconfig"
)
-SET(CPACK_RPM_server_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
+SET(CPACK_RPM_server_USER_FILELIST
+ ${ignored}
+ "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*"
+ "%config(noreplace) ${INSTALL_SYSCONFDIR}/logrotate.d/mysql"
+ )
SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONFDIR}/my.cnf")
SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*")
diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake
index 0eae3e1176b..91f9f9e487a 100644
--- a/cmake/submodules.cmake
+++ b/cmake/submodules.cmake
@@ -28,7 +28,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
RESULT_VARIABLE update_result)
ELSE()
MESSAGE(STATUS "Updating submodules")
- EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive
+ EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ENDIF()
diff --git a/mysql-test/include/not_aix.inc b/mysql-test/include/not_aix.inc
new file mode 100644
index 00000000000..ecdb3b97a6e
--- /dev/null
+++ b/mysql-test/include/not_aix.inc
@@ -0,0 +1,4 @@
+#
+# suite.pm will make sure that all tests including this file
+# will be skipped if run under AIX
+#
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index 763e51f61cb..36e7baada00 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -1964,6 +1964,61 @@ call p1();
ERROR 42S22: Unknown column 'a' in 'field list'
drop procedure p1;
drop table t1,t2;
+#
+# MDEV-20411: SP containing only one SELECT with WITH clause
+#
+create procedure sp1 ()
+with cte as (select 1 as a) select * from cte;
+call sp1();
+a
+1
+call sp1();
+a
+1
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+create procedure sp2 ()
+with cte as (select * from t1) select * from cte;
+call sp2();
+a
+3
+7
+1
+7
+1
+1
+3
+1
+5
+call sp2();
+a
+3
+7
+1
+7
+1
+1
+3
+1
+5
+create procedure sp3 ()
+with cte as (select * from t1 group by a) select * from cte;
+call sp3();
+a
+1
+3
+5
+7
+call sp3();
+a
+1
+3
+5
+7
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+drop table t1;
# End of 10.2 tests
#
# MDEV-21673: several references to CTE that uses
diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test
index 59dae44cb66..ad03b25ceb6 100644
--- a/mysql-test/main/cte_nonrecursive.test
+++ b/mysql-test/main/cte_nonrecursive.test
@@ -1475,6 +1475,35 @@ drop procedure p1;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-20411: SP containing only one SELECT with WITH clause
+--echo #
+
+create procedure sp1 ()
+with cte as (select 1 as a) select * from cte;
+call sp1();
+call sp1();
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (7), (1), (1), (3), (1), (5);
+
+create procedure sp2 ()
+with cte as (select * from t1) select * from cte;
+call sp2();
+call sp2();
+
+create procedure sp3 ()
+with cte as (select * from t1 group by a) select * from cte;
+call sp3();
+call sp3();
+
+drop procedure sp1;
+drop procedure sp2;
+drop procedure sp3;
+
+drop table t1;
+
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 90ef1e6bbd6..b3a4dc4c253 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -10646,6 +10646,208 @@ Warnings:
Note 1003 /* select#1 */ select `v2`.`a` AS `a`,`v2`.`f` AS `f`,`v2`.`g` AS `g` from `test`.`v2` where `v2`.`a` = `v2`.`f` and `v2`.`a` = `v2`.`g`
drop view v1,v2;
drop table t1;
+#
+# MDEV-25969: Condition pushdown into derived table doesn't work if select list uses SP
+#
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+create table t1 (
+pk int primary key,
+a int,
+b int,
+key(a)
+);
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+insert into t1 select a,a,a from t3;
+create view v1 as
+select
+t1.a as col1,
+f1(t1.b) as col2
+from
+t1;
+create view v2 as
+select
+t1.a as col1,
+f1(t1.b) as col2
+from
+t1;
+create view v3 as
+select col2, col1 from v1
+union all
+select col2, col1 from v2;
+explain select * from v3 where col1=123;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where
+2 DERIVED t1 ref a a 5 const 1
+3 UNION t1 ref a a 5 const 1
+# This must use ref accesses for reading table t1, not full scans:
+explain format=json
+select * from v3 where col1=123 and col2=321;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "v3.col1 = 123 and v3.col2 = 321",
+ "materialized": {
+ "query_block": {
+ "union_result": {
+ "table_name": "<union2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "UNION",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+}
+drop function f1;
+drop view v1,v2,v3;
+drop table t1, t2,t3;
+#
+# Another testcase, with pushdown through GROUP BY
+#
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+create view v2(a, a2, s) as
+select a, f1(a), sum(b) from t1 group by a, f1(a);
+# Here,
+# "(s+1) > 10" will be pushed into HAVING
+# "a > 1" will be pushed all the way to the table scan on t1
+# "a2>123" will be pushed into HAVING (as it refers to an SP call which
+# prevents pushing it to the WHERE)
+explain format=json
+select * from v2 where (s+1) > 10 AND a > 1 and a2>123;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "v2.s + 1 > 10 and v2.a > 1 and v2.a2 > 123",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "having_condition": "s + 1 > 10 and a2 > 123",
+ "filesort": {
+ "sort_key": "t1.a, f1(t1.a)",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "t1.a > 1"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+# Extra test for 10.4+: Check that this works for pushdown into IN
+# subqueries:
+create table t4 (a int, b int, c decimal);
+insert into t4 select a,a,a from t1;
+# The subquery must be materialized and must have
+# "attached_condition": "t1.a + 1 > 10",
+# "having_condition": "`f1(a)` > 1 and `sum(b)` > 123",
+explain format=json
+select *
+from t4
+where
+(a,b,c) in (select a, f1(a), sum(b) from t1 group by a, f1(a))
+and
+(a+1) > 10 AND b > 1 and c>123;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t4",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "t4.a + 1 > 10 and t4.b > 1 and t4.c > 123 and t4.a is not null and t4.b is not null and t4.c is not null"
+ },
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "23",
+ "used_key_parts": ["a", "f1(a)", "sum(b)"],
+ "ref": ["test.t4.a", "test.t4.b", "test.t4.c"],
+ "rows": 1,
+ "filtered": 100,
+ "attached_condition": "t4.c = `<subquery2>`.`sum(b)`",
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "having_condition": "`f1(a)` > 1 and `sum(b)` > 123",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100,
+ "attached_condition": "t1.a + 1 > 10"
+ }
+ }
+ }
+ }
+ }
+ }
+}
+drop view v2;
+drop function f1;
+drop table t1, t4;
# End of 10.2 tests
#
# MDEV-14579: pushdown conditions into materialized views/derived tables
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index e6ee05dd644..d738ed33128 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2239,6 +2239,93 @@ eval explain extended $q2;
drop view v1,v2;
drop table t1;
+--echo #
+--echo # MDEV-25969: Condition pushdown into derived table doesn't work if select list uses SP
+--echo #
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+
+create table t1 (
+ pk int primary key,
+ a int,
+ b int,
+ key(a)
+);
+
+create table t2(a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t3(a int);
+insert into t3 select A.a + B.a* 10 + C.a * 100 from t2 A, t2 B, t2 C;
+
+insert into t1 select a,a,a from t3;
+
+create view v1 as
+select
+ t1.a as col1,
+ f1(t1.b) as col2
+from
+ t1;
+
+create view v2 as
+select
+ t1.a as col1,
+ f1(t1.b) as col2
+from
+ t1;
+create view v3 as
+select col2, col1 from v1
+union all
+select col2, col1 from v2;
+
+explain select * from v3 where col1=123;
+
+--echo # This must use ref accesses for reading table t1, not full scans:
+explain format=json
+select * from v3 where col1=123 and col2=321;
+
+drop function f1;
+drop view v1,v2,v3;
+drop table t1, t2,t3;
+
+--echo #
+--echo # Another testcase, with pushdown through GROUP BY
+--echo #
+create table t1 (a int, b int);
+insert into t1 values (1,1),(2,2),(3,3);
+
+create function f1(a int) returns int DETERMINISTIC return (a+1);
+
+create view v2(a, a2, s) as
+select a, f1(a), sum(b) from t1 group by a, f1(a);
+
+--echo # Here,
+--echo # "(s+1) > 10" will be pushed into HAVING
+--echo # "a > 1" will be pushed all the way to the table scan on t1
+--echo # "a2>123" will be pushed into HAVING (as it refers to an SP call which
+--echo # prevents pushing it to the WHERE)
+explain format=json
+select * from v2 where (s+1) > 10 AND a > 1 and a2>123;
+
+--echo # Extra test for 10.4+: Check that this works for pushdown into IN
+--echo # subqueries:
+
+create table t4 (a int, b int, c decimal);
+insert into t4 select a,a,a from t1;
+
+--echo # The subquery must be materialized and must have
+--echo # "attached_condition": "t1.a + 1 > 10",
+--echo # "having_condition": "`f1(a)` > 1 and `sum(b)` > 123",
+explain format=json
+select *
+from t4
+where
+ (a,b,c) in (select a, f1(a), sum(b) from t1 group by a, f1(a))
+ and
+ (a+1) > 10 AND b > 1 and c>123;
+
+drop view v2;
+drop function f1;
+drop table t1, t4;
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/gis-json.result b/mysql-test/main/gis-json.result
index e52a7c809c6..ace9e9e9ae2 100644
--- a/mysql-test/main/gis-json.result
+++ b/mysql-test/main/gis-json.result
@@ -107,6 +107,16 @@ Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }");
ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }")
NULL
+SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'));
+ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'))
+NULL
+Warnings:
+Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
+SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'));
+ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'))
+NULL
+Warnings:
+Warning 4048 Incorrect GeoJSON format specified for st_geomfromgeojson function.
#
# End of 10.2 tests
#
diff --git a/mysql-test/main/gis-json.test b/mysql-test/main/gis-json.test
index a97e9411e5c..ff6298c50a6 100644
--- a/mysql-test/main/gis-json.test
+++ b/mysql-test/main/gis-json.test
@@ -46,6 +46,13 @@ SELECT st_astext(st_geomfromgeojson('{"type": "MultiPolygon","coordinates": []}'
SELECT ST_GEOMFROMGEOJSON("{ \"type\": \"Feature\", \"geometry\": [10, 20] }");
+#
+# MDEV-25461 Assertion `je->state == JST_KEY' failed in Geometry::create_from_json.
+#
+
+SELECT ST_ASTEXT (ST_GEOMFROMGEOJSON ('{ "type": "GEOMETRYCOLLECTION", "coordinates": [102.0, 0.0]}'));
+
+SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type": ["POINT"], "coINates": [0,0] }'));
--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/information_schema-big.result b/mysql-test/main/information_schema-big.result
index 0ed74d113ea..5c519014800 100644
--- a/mysql-test/main/information_schema-big.result
+++ b/mysql-test/main/information_schema-big.result
@@ -34,6 +34,7 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -48,6 +49,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -92,6 +94,7 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
PARAMETERS SPECIFIC_SCHEMA
@@ -106,6 +109,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 2a57f38bd32..9808c10a4e7 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -68,6 +68,7 @@ GEOMETRY_COLUMNS
GLOBAL_STATUS
GLOBAL_VARIABLES
INDEX_STATISTICS
+KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
OPTIMIZER_TRACE
@@ -83,6 +84,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
SPATIAL_REF_SYS
+SQL_FUNCTIONS
STATISTICS
SYSTEM_VARIABLES
TABLES
diff --git a/mysql-test/main/information_schema_all_engines.result b/mysql-test/main/information_schema_all_engines.result
index 5da51a1a8c0..23a853e363c 100644
--- a/mysql-test/main/information_schema_all_engines.result
+++ b/mysql-test/main/information_schema_all_engines.result
@@ -39,6 +39,7 @@ INNODB_SYS_TABLESTATS
INNODB_SYS_VIRTUAL
INNODB_TABLESPACES_ENCRYPTION
INNODB_TRX
+KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
OPTIMIZER_TRACE
@@ -54,6 +55,7 @@ SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
SPATIAL_REF_SYS
+SQL_FUNCTIONS
STATISTICS
SYSTEM_VARIABLES
TABLES
@@ -118,6 +120,7 @@ INNODB_SYS_TABLESTATS TABLE_ID
INNODB_SYS_VIRTUAL TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TRX trx_id
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
OPTIMIZER_TRACE QUERY
@@ -133,6 +136,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -197,6 +201,7 @@ INNODB_SYS_TABLESTATS TABLE_ID
INNODB_SYS_VIRTUAL TABLE_ID
INNODB_TABLESPACES_ENCRYPTION SPACE
INNODB_TRX trx_id
+KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
OPTIMIZER_TRACE QUERY
@@ -212,6 +217,7 @@ SCHEMA_PRIVILEGES TABLE_SCHEMA
SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
SPATIAL_REF_SYS SRID
+SQL_FUNCTIONS FUNCTION
STATISTICS TABLE_SCHEMA
SYSTEM_VARIABLES VARIABLE_NAME
TABLES TABLE_SCHEMA
@@ -350,6 +356,7 @@ Database: information_schema
| INNODB_SYS_VIRTUAL |
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TRX |
+| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| OPTIMIZER_TRACE |
@@ -365,6 +372,7 @@ Database: information_schema
| SESSION_STATUS |
| SESSION_VARIABLES |
| SPATIAL_REF_SYS |
+| SQL_FUNCTIONS |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
@@ -419,6 +427,7 @@ Database: INFORMATION_SCHEMA
| INNODB_SYS_VIRTUAL |
| INNODB_TABLESPACES_ENCRYPTION |
| INNODB_TRX |
+| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
| OPTIMIZER_TRACE |
@@ -434,6 +443,7 @@ Database: INFORMATION_SCHEMA
| SESSION_STATUS |
| SESSION_VARIABLES |
| SPATIAL_REF_SYS |
+| SQL_FUNCTIONS |
| STATISTICS |
| SYSTEM_VARIABLES |
| TABLES |
@@ -453,5 +463,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 64
+information_schema 66
mysql 31
diff --git a/mysql-test/main/mdev-21101.test b/mysql-test/main/mdev-21101.test
index 627e86462a1..543b587c5e6 100644
--- a/mysql-test/main/mdev-21101.test
+++ b/mysql-test/main/mdev-21101.test
@@ -1,4 +1,5 @@
--source include/not_embedded.inc
+--source include/not_aix.inc
# Test that wait_timeout does not cause connection to be closed, when connection is delayed due to
# threadpool internal problems, e.g misconfiguration - too few threads and queueing.
# So if client did not cause wait_timeout, do not report it either.
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index 86f2d6c0c18..5100b4137a2 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -49,6 +49,7 @@ sub skip_combinations {
unless $ENV{HA_EXAMPLE_SO};
$skip{'include/not_windows.inc'} = 'Requires not Windows' if IS_WINDOWS;
+ $skip{'include/not_aix.inc'} = 'Requires not AIX' if IS_AIX;
$skip{'main/plugin_loaderr.test'} = 'needs compiled-in innodb'
unless $::mysqld_variables{'innodb'} eq "ON";
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 8c884aea41d..5d239dd8393 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -182,6 +182,7 @@ def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
@@ -343,6 +344,7 @@ def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL N
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL
def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL
def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL
def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
@@ -728,6 +730,7 @@ NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL small
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
NULL information_schema INDEX_STATISTICS ROWS_READ bigint NULL NULL NULL NULL bigint(21)
+3.0000 information_schema KEYWORDS WORD varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
NULL information_schema KEY_CACHES SEGMENTS int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES SEGMENT_NUMBER int NULL NULL NULL NULL int(3) unsigned
@@ -889,6 +892,7 @@ NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smalli
3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8mb3 utf8mb3_general_ci varchar(2048)
+3.0000 information_schema SQL_FUNCTIONS FUNCTION varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 41fb6f921d9..d021272b8c2 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -182,6 +182,7 @@ def information_schema INDEX_STATISTICS INDEX_NAME 3 '' NO varchar 192 576 NULL
def information_schema INDEX_STATISTICS ROWS_READ 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema INDEX_STATISTICS TABLE_NAME 2 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 '' NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
def information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
def information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
@@ -343,6 +344,7 @@ def information_schema SPATIAL_REF_SYS AUTH_NAME 2 '' NO varchar 512 1536 NULL N
def information_schema SPATIAL_REF_SYS AUTH_SRID 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL
def information_schema SPATIAL_REF_SYS SRID 1 0 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL
def information_schema SPATIAL_REF_SYS SRTEXT 4 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL
def information_schema STATISTICS COLUMN_NAME 8 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
@@ -728,6 +730,7 @@ NULL information_schema GEOMETRY_COLUMNS SRID smallint NULL NULL NULL NULL small
3.0000 information_schema INDEX_STATISTICS TABLE_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
3.0000 information_schema INDEX_STATISTICS INDEX_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
NULL information_schema INDEX_STATISTICS ROWS_READ bigint NULL NULL NULL NULL bigint(21)
+3.0000 information_schema KEYWORDS WORD varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
NULL information_schema KEY_CACHES SEGMENTS int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES SEGMENT_NUMBER int NULL NULL NULL NULL int(3) unsigned
@@ -889,6 +892,7 @@ NULL information_schema SPATIAL_REF_SYS SRID smallint NULL NULL NULL NULL smalli
3.0000 information_schema SPATIAL_REF_SYS AUTH_NAME varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
NULL information_schema SPATIAL_REF_SYS AUTH_SRID int NULL NULL NULL NULL int(5)
3.0000 information_schema SPATIAL_REF_SYS SRTEXT varchar 2048 6144 utf8mb3 utf8mb3_general_ci varchar(2048)
+3.0000 information_schema SQL_FUNCTIONS FUNCTION varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index fffcfe7cba7..c18f733c86f 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -439,6 +439,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -789,6 +814,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1505,6 +1555,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1855,6 +1930,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
index fffcfe7cba7..c18f733c86f 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
@@ -439,6 +439,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -789,6 +814,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1505,6 +1555,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEYWORDS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME KEY_CACHES
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -1855,6 +1930,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME SQL_FUNCTIONS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME STATISTICS
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result b/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result
new file mode 100644
index 00000000000..9b56a09d369
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_binlogname.result
@@ -0,0 +1,174 @@
+connection node_2;
+connection node_1;
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,'node1_committed_before');
+INSERT INTO t1 VALUES (2,'node1_committed_before');
+INSERT INTO t1 VALUES (3,'node1_committed_before');
+INSERT INTO t1 VALUES (4,'node1_committed_before');
+INSERT INTO t1 VALUES (5,'node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (6,'node2_committed_before');
+INSERT INTO t1 VALUES (7,'node2_committed_before');
+INSERT INTO t1 VALUES (8,'node2_committed_before');
+INSERT INTO t1 VALUES (9,'node2_committed_before');
+INSERT INTO t1 VALUES (10,'node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,'node1_committed_during');
+INSERT INTO t1 VALUES (12,'node1_committed_during');
+INSERT INTO t1 VALUES (13,'node1_committed_during');
+INSERT INTO t1 VALUES (14,'node1_committed_during');
+INSERT INTO t1 VALUES (15,'node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (26,'node2_committed_after');
+INSERT INTO t1 VALUES (27,'node2_committed_after');
+INSERT INTO t1 VALUES (28,'node2_committed_after');
+INSERT INTO t1 VALUES (29,'node2_committed_after');
+INSERT INTO t1 VALUES (30,'node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (36,'node1_committed_after');
+INSERT INTO t1 VALUES (37,'node1_committed_after');
+INSERT INTO t1 VALUES (38,'node1_committed_after');
+INSERT INTO t1 VALUES (39,'node1_committed_after');
+INSERT INTO t1 VALUES (40,'node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
+ROLLBACK;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait=15;
+SELECT COUNT(*) AS EXPECT_15 FROM t1;
+EXPECT_15
+35
+SELECT * from t1;
+id f1
+1 node1_committed_before
+2 node1_committed_before
+3 node1_committed_before
+4 node1_committed_before
+5 node1_committed_before
+6 node2_committed_before
+7 node2_committed_before
+8 node2_committed_before
+9 node2_committed_before
+10 node2_committed_before
+11 node1_committed_during
+12 node1_committed_during
+13 node1_committed_during
+14 node1_committed_during
+15 node1_committed_during
+16 node1_to_be_committed_after
+17 node1_to_be_committed_after
+18 node1_to_be_committed_after
+19 node1_to_be_committed_after
+20 node1_to_be_committed_after
+26 node2_committed_after
+27 node2_committed_after
+28 node2_committed_after
+29 node2_committed_after
+30 node2_committed_after
+31 node1_to_be_committed_after
+32 node1_to_be_committed_after
+33 node1_to_be_committed_after
+34 node1_to_be_committed_after
+35 node1_to_be_committed_after
+36 node1_committed_after
+37 node1_committed_after
+38 node1_committed_after
+39 node1_committed_after
+40 node1_committed_after
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+connection node_1;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait=15;
+SELECT COUNT(*) AS EXPECT_15 FROM t1;
+EXPECT_15
+35
+SELECT * from t1;
+id f1
+1 node1_committed_before
+2 node1_committed_before
+3 node1_committed_before
+4 node1_committed_before
+5 node1_committed_before
+6 node2_committed_before
+7 node2_committed_before
+8 node2_committed_before
+9 node2_committed_before
+10 node2_committed_before
+11 node1_committed_during
+12 node1_committed_during
+13 node1_committed_during
+14 node1_committed_during
+15 node1_committed_during
+16 node1_to_be_committed_after
+17 node1_to_be_committed_after
+18 node1_to_be_committed_after
+19 node1_to_be_committed_after
+20 node1_to_be_committed_after
+26 node2_committed_after
+27 node2_committed_after
+28 node2_committed_after
+29 node2_committed_after
+30 node2_committed_after
+31 node1_to_be_committed_after
+32 node1_to_be_committed_after
+33 node1_to_be_committed_after
+34 node1_to_be_committed_after
+35 node1_to_be_committed_after
+36 node1_committed_after
+37 node1_committed_after
+38 node1_committed_after
+39 node1_committed_after
+40 node1_committed_after
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result b/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result
new file mode 100644
index 00000000000..dabbaeaab4f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_logbasename.result
@@ -0,0 +1,175 @@
+connection node_2;
+connection node_1;
+connection node_1;
+connection node_2;
+Performing State Transfer on a server that has been shut down cleanly and restarted
+connection node_1;
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (1,'node1_committed_before');
+INSERT INTO t1 VALUES (2,'node1_committed_before');
+INSERT INTO t1 VALUES (3,'node1_committed_before');
+INSERT INTO t1 VALUES (4,'node1_committed_before');
+INSERT INTO t1 VALUES (5,'node1_committed_before');
+COMMIT;
+connection node_2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (6,'node2_committed_before');
+INSERT INTO t1 VALUES (7,'node2_committed_before');
+INSERT INTO t1 VALUES (8,'node2_committed_before');
+INSERT INTO t1 VALUES (9,'node2_committed_before');
+INSERT INTO t1 VALUES (10,'node2_committed_before');
+COMMIT;
+Shutting down server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,'node1_committed_during');
+INSERT INTO t1 VALUES (12,'node1_committed_during');
+INSERT INTO t1 VALUES (13,'node1_committed_during');
+INSERT INTO t1 VALUES (14,'node1_committed_during');
+INSERT INTO t1 VALUES (15,'node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 VALUES (16,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (17,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (18,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (19,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (20,'node1_to_be_committed_after');
+connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after');
+connection node_2;
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (26,'node2_committed_after');
+INSERT INTO t1 VALUES (27,'node2_committed_after');
+INSERT INTO t1 VALUES (28,'node2_committed_after');
+INSERT INTO t1 VALUES (29,'node2_committed_after');
+INSERT INTO t1 VALUES (30,'node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 VALUES (31,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (32,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (33,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (34,'node1_to_be_committed_after');
+INSERT INTO t1 VALUES (35,'node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES (36,'node1_committed_after');
+INSERT INTO t1 VALUES (37,'node1_committed_after');
+INSERT INTO t1 VALUES (38,'node1_committed_after');
+INSERT INTO t1 VALUES (39,'node1_committed_after');
+INSERT INTO t1 VALUES (40,'node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_shutdown_slave;
+INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after');
+INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after');
+ROLLBACK;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait=15;
+SELECT COUNT(*) AS EXPECT_15 FROM t1;
+EXPECT_15
+35
+SELECT * from t1;
+id f1
+1 node1_committed_before
+2 node1_committed_before
+3 node1_committed_before
+4 node1_committed_before
+5 node1_committed_before
+6 node2_committed_before
+7 node2_committed_before
+8 node2_committed_before
+9 node2_committed_before
+10 node2_committed_before
+11 node1_committed_during
+12 node1_committed_during
+13 node1_committed_during
+14 node1_committed_during
+15 node1_committed_during
+16 node1_to_be_committed_after
+17 node1_to_be_committed_after
+18 node1_to_be_committed_after
+19 node1_to_be_committed_after
+20 node1_to_be_committed_after
+26 node2_committed_after
+27 node2_committed_after
+28 node2_committed_after
+29 node2_committed_after
+30 node2_committed_after
+31 node1_to_be_committed_after
+32 node1_to_be_committed_after
+33 node1_to_be_committed_after
+34 node1_to_be_committed_after
+35 node1_to_be_committed_after
+36 node1_committed_after
+37 node1_committed_after
+38 node1_committed_after
+39 node1_committed_after
+40 node1_committed_after
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+connection node_1;
+SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait=15;
+SELECT COUNT(*) AS EXPECT_15 FROM t1;
+EXPECT_15
+35
+SELECT * from t1;
+id f1
+1 node1_committed_before
+2 node1_committed_before
+3 node1_committed_before
+4 node1_committed_before
+5 node1_committed_before
+6 node2_committed_before
+7 node2_committed_before
+8 node2_committed_before
+9 node2_committed_before
+10 node2_committed_before
+11 node1_committed_during
+12 node1_committed_during
+13 node1_committed_during
+14 node1_committed_during
+15 node1_committed_during
+16 node1_to_be_committed_after
+17 node1_to_be_committed_after
+18 node1_to_be_committed_after
+19 node1_to_be_committed_after
+20 node1_to_be_committed_after
+26 node2_committed_after
+27 node2_committed_after
+28 node2_committed_after
+29 node2_committed_after
+30 node2_committed_after
+31 node1_to_be_committed_after
+32 node1_to_be_committed_after
+33 node1_to_be_committed_after
+34 node1_to_be_committed_after
+35 node1_to_be_committed_after
+36 node1_committed_after
+37 node1_committed_after
+38 node1_committed_after
+39 node1_committed_after
+40 node1_committed_after
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/lp1376747-4.result b/mysql-test/suite/galera/r/lp1376747-4.result
index 888961b592d..9c021c3eac3 100644
--- a/mysql-test/suite/galera/r/lp1376747-4.result
+++ b/mysql-test/suite/galera/r/lp1376747-4.result
@@ -29,8 +29,8 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-set debug_sync= 'RESET';
connection node_2a;
+set debug_sync= 'RESET';
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf
new file mode 100644
index 00000000000..b1e4278dceb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.cnf
@@ -0,0 +1,12 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_bin=server1_binlog
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_bin=server2_binlog
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test
new file mode 100644
index 00000000000..b4ad6c43a0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_binlogname.test
@@ -0,0 +1,9 @@
+--source include/galera_cluster.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
new file mode 100644
index 00000000000..4f25af7cd8b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
@@ -0,0 +1,15 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=rsync
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_basename=server1
+log_bin
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
+log_basename=server2
+log_bin
+
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test
new file mode 100644
index 00000000000..b4ad6c43a0b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.test
@@ -0,0 +1,9 @@
+--source include/galera_cluster.inc
+
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--source suite/galera/include/galera_st_shutdown_slave.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/lp1376747-4.test b/mysql-test/suite/galera/t/lp1376747-4.test
index d19ff422ab0..724901da068 100644
--- a/mysql-test/suite/galera/t/lp1376747-4.test
+++ b/mysql-test/suite/galera/t/lp1376747-4.test
@@ -46,10 +46,10 @@ SET debug_sync='now SIGNAL go2';
# the cluster as there is new FTRL that is still pausing it.
UNLOCK TABLES;
SHOW CREATE TABLE t1;
-set debug_sync= 'RESET';
--connection node_2a
--reap
+set debug_sync= 'RESET';
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = DEFAULT;
diff --git a/mysql-test/suite/innodb/r/alter_partitioned.result b/mysql-test/suite/innodb/r/alter_partitioned.result
index ad6dd8b3e8c..6c32142db9a 100644
--- a/mysql-test/suite/innodb/r/alter_partitioned.result
+++ b/mysql-test/suite/innodb/r/alter_partitioned.result
@@ -1,24 +1,7 @@
-CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
-PARTITION BY RANGE(a)
-(PARTITION pa VALUES LESS THAN (3),
-PARTITION pb VALUES LESS THAN (5));
-CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
-PARTITION BY RANGE(a)
-(PARTITION pa VALUES LESS THAN (2),
-PARTITION pb VALUES LESS THAN (4));
-ERROR HY000: Partitioned tables do not support FOREIGN KEY
-DROP TABLE t1;
#
-# MDEV-24754 Server crash in
-# ha_partition_inplace_ctx::~ha_partition_inplace_ctx
+# MDEV-26077 Assertion failure err != DB_DUPLICATE_KEY
+# or unexpected ER_TABLE_EXISTS_ERROR
#
-CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
-ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
-ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
-DROP TABLE t1;
-#
-# MDEV-25902 Unexpected ER_LOCK_WAIT_TIMEOUT and result,
-# assertion failure err != DB_DUPLICATE_KEY
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
connect con1,localhost,root,,test;
@@ -45,4 +28,24 @@ ALTER TABLE t2 PARTITION BY HASH(pk);
disconnect con1;
connection default;
DROP TABLE t1, t2;
-# End of 10.6 tests
+# End of 10.2 tests
+CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (3),
+PARTITION pb VALUES LESS THAN (5));
+CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (2),
+PARTITION pb VALUES LESS THAN (4));
+ERROR HY000: Partitioned tables do not support FOREIGN KEY
+DROP TABLE t1;
+# End of 10.3 tests
+#
+# MDEV-24754 Server crash in
+# ha_partition_inplace_ctx::~ha_partition_inplace_ctx
+#
+CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
+ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
+ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
+DROP TABLE t1;
+# End of 10.5 tests
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index e191c8048fb..5eee3ce50ce 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -1052,13 +1052,12 @@ a
10
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
-SET @save_allowed = @@GLOBAL.innodb_instant_alter_column_allowed;
-SET GLOBAL innodb_instant_alter_column_allowed=never;
-iNSERT INTO t1 VALUES (10);
-ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
-SET GLOBAL innodb_instant_alter_column_allowed=@save_allowed;
+INSERT INTO t1 VALUES (10);
+ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0), algorithm=copy;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'b' at row 1
SELECT * FROM t1;
a b
10 2001-01-01
@@ -1067,7 +1066,9 @@ CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
iNSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'b' at row 1
SELECT * FROM t1;
a b
10 10:20:30
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index c27ce0aeff1..df3be4b18be 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -312,10 +312,14 @@ id c2 c3 c4 c5 c6
affected rows: 3
ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c8' at row 1
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -1242,10 +1246,14 @@ id c2 c3 c4 c5 c6
affected rows: 3
ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c8' at row 1
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
@@ -2172,10 +2180,14 @@ id c2 c3 c4 c5 c6
affected rows: 3
ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c7' at row 1
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Note 1265 Data truncated for column 'c8' at row 1
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
id c2 c3 c4 c5 c6 c7 c8
1 1 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff b/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff
new file mode 100644
index 00000000000..eafa8e5725d
--- /dev/null
+++ b/mysql-test/suite/innodb/r/instant_alter_debug,redundant.rdiff
@@ -0,0 +1,6 @@
+@@ -509,4 +509,4 @@
+ FROM information_schema.global_status
+ WHERE variable_name = 'innodb_instant_alter_column';
+ instants
+-35
++36
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 72b47bc6e20..fa7ebabd0af 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -443,6 +443,27 @@ SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SELECT * FROM t1;
c2 c
DROP TABLE t1;
+#
+# MDEV-25236 Online log apply fails for ROW_FORMAT=REDUNDANT tables
+#
+CREATE TABLE t1
+(a INT NOT NULL, b INT, c INT, d INT, e INT, f INT, g INT, h INT, i TEXT)
+ENGINE=InnoDB;
+ALTER TABLE t1 MODIFY a INT NULL;
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL alter WAIT_FOR go';
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+connect con1,localhost,root,,;
+set DEBUG_SYNC='now WAIT_FOR alter';
+BEGIN;
+INSERT INTO t1 SET a=0, i=REPEAT('1', 10000);
+ROLLBACK;
+set DEBUG_SYNC='now SIGNAL go';
+connection default;
+disconnect con1;
+SELECT * FROM t1;
+a b c d e f g h i
+DROP TABLE t1;
+SET DEBUG_SYNC=RESET;
# End of 10.4 tests
#
# MDEV-22867 Assertion instant.n_core_fields == n_core_fields
diff --git a/mysql-test/suite/innodb/t/alter_partitioned.test b/mysql-test/suite/innodb/t/alter_partitioned.test
index 056791c6a0c..4990c265b5e 100644
--- a/mysql-test/suite/innodb/t/alter_partitioned.test
+++ b/mysql-test/suite/innodb/t/alter_partitioned.test
@@ -1,31 +1,10 @@
--source include/have_innodb.inc
--source include/have_partition.inc
-CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
-PARTITION BY RANGE(a)
-(PARTITION pa VALUES LESS THAN (3),
-PARTITION pb VALUES LESS THAN (5));
-
---error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
-CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
-PARTITION BY RANGE(a)
-(PARTITION pa VALUES LESS THAN (2),
-PARTITION pb VALUES LESS THAN (4));
-
-DROP TABLE t1;
-
--echo #
---echo # MDEV-24754 Server crash in
---echo # ha_partition_inplace_ctx::~ha_partition_inplace_ctx
+--echo # MDEV-26077 Assertion failure err != DB_DUPLICATE_KEY
+--echo # or unexpected ER_TABLE_EXISTS_ERROR
--echo #
-CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
-ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
-ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
-DROP TABLE t1;
-
---echo #
---echo # MDEV-25902 Unexpected ER_LOCK_WAIT_TIMEOUT and result,
---echo # assertion failure err != DB_DUPLICATE_KEY
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB;
@@ -54,4 +33,30 @@ ALTER TABLE t2 PARTITION BY HASH(pk);
--connection default
DROP TABLE t1, t2;
---echo # End of 10.6 tests
+--echo # End of 10.2 tests
+
+CREATE TABLE t1(a INT, b VARCHAR(10), INDEX(a))ENGINE=InnoDB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (3),
+PARTITION pb VALUES LESS THAN (5));
+
+--error ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING
+CREATE TABLE t2(a INT, FOREIGN KEY(a) REFERENCES t1(a))ENGINE=INNODB
+PARTITION BY RANGE(a)
+(PARTITION pa VALUES LESS THAN (2),
+PARTITION pb VALUES LESS THAN (4));
+
+DROP TABLE t1;
+
+--echo # End of 10.3 tests
+
+--echo #
+--echo # MDEV-24754 Server crash in
+--echo # ha_partition_inplace_ctx::~ha_partition_inplace_ctx
+--echo #
+CREATE TABLE t1 (id INT PRIMARY KEY, a INT, va INT AS (a) VIRTUAL)
+ENGINE=InnoDB PARTITION BY HASH(id) PARTITIONS 2;
+ALTER TABLE t1 ADD b INT, ALGORITHM=INSTANT;
+DROP TABLE t1;
+
+--echo # End of 10.5 tests
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 00903e2d401..60af7c9df80 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -663,13 +663,10 @@ DROP TABLE t1;
# DATETIME-to-DATE truncation is OK
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
-SET @save_allowed = @@GLOBAL.innodb_instant_alter_column_allowed;
-SET GLOBAL innodb_instant_alter_column_allowed=never;
-iNSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (10);
--enable_info
-ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
+ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0), algorithm=copy;
--disable_info
-SET GLOBAL innodb_instant_alter_column_allowed=@save_allowed;
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index dcce4b29119..b553dc3ad74 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -512,6 +512,32 @@ SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-25236 Online log apply fails for ROW_FORMAT=REDUNDANT tables
+--echo #
+
+CREATE TABLE t1
+(a INT NOT NULL, b INT, c INT, d INT, e INT, f INT, g INT, h INT, i TEXT)
+ENGINE=InnoDB;
+
+ALTER TABLE t1 MODIFY a INT NULL;
+
+SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL alter WAIT_FOR go';
+send ALTER TABLE t1 ADD PRIMARY KEY (a);
+connect(con1,localhost,root,,);
+set DEBUG_SYNC='now WAIT_FOR alter';
+BEGIN;
+INSERT INTO t1 SET a=0, i=REPEAT('1', 10000);
+ROLLBACK;
+set DEBUG_SYNC='now SIGNAL go';
+connection default;
+reap;
+
+disconnect con1;
+SELECT * FROM t1;
+DROP TABLE t1;
+SET DEBUG_SYNC=RESET;
+
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/suite/plugins/r/multiauth,aix.rdiff b/mysql-test/suite/plugins/r/multiauth,aix.rdiff
new file mode 100644
index 00000000000..0a2570cbd89
--- /dev/null
+++ b/mysql-test/suite/plugins/r/multiauth,aix.rdiff
@@ -0,0 +1,14 @@
+diff --git a/mysql-test/suite/plugins/r/multiauth.result b/mysql-test/suite/plugins/r/multiauth.result
+index aed46ac8964..24bb0a24f03 100644
+--- a/mysql-test/suite/plugins/r/multiauth.result
++++ b/mysql-test/suite/plugins/r/multiauth.result
+@@ -181,7 +181,8 @@ show create user mysqltest1;
+ CREATE USER for mysqltest1@%
+ CREATE USER `mysqltest1`@`%` IDENTIFIED VIA ed25519 USING 'F4aF8bw7130VaRbdLCl4f/P/wkjDmgJXwWvpJ5gmsZc'
+ # no plugin = failure
+-mysqltest: Could not open connection 'default': 1045 Plugin client_ed25519 could not be loaded: <PLUGINDIR>/no/client_ed25519.so: cannot open shared object file: No such file or directory
++mysqltest: Could not open connection 'default': 1045 Plugin client_ed25519 could not be loaded: Could not load module <PLUGINDIR>/no/client_ed25519.so.
++System error: No such file or directory
+ alter user mysqltest1 identified via ed25519 as password("good") OR mysql_native_password as password("works");
+ show create user mysqltest1;
+ CREATE USER for mysqltest1@%
diff --git a/mysql-test/suite/plugins/t/multiauth.test b/mysql-test/suite/plugins/t/multiauth.test
index 7161fa705c7..f0eea21ee76 100644
--- a/mysql-test/suite/plugins/t/multiauth.test
+++ b/mysql-test/suite/plugins/t/multiauth.test
@@ -1,4 +1,5 @@
--source include/not_ubsan.inc
+--source include/platform.inc
let $REGEX_VERSION_ID=/$mysql_get_server_version/VERSION_ID/;
let $REGEX_PASSWORD_LAST_CHANGED=/password_last_changed": [0-9]*/password_last_changed": #/;
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 606781548fb..c30ee229b5f 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -456,7 +456,7 @@ if [ -n "${MYSQLD_OPT_LOG_BASENAME:-}" -a \
fi
# If the --log-bin option is present without a value, then
-# setting WSREP_SST_OPT_BINLOG by using other arguments:
+# set WSREP_SST_OPT_BINLOG value using other arguments:
if [ -z "$WSREP_SST_OPT_BINLOG" -a -n "${MYSQLD_OPT_LOG_BIN+x}" ]; then
if [ -n "$WSREP_SST_OPT_LOG_BASENAME" ]; then
# If the WSREP_SST_OPT_BINLOG variable is not set, but
@@ -549,9 +549,9 @@ get_binlog()
# the "-bin" suffix:
readonly WSREP_SST_OPT_BINLOG_INDEX="$WSREP_SST_OPT_LOG_BASENAME-bin.index"
else
- # If the base name not specified, then we take
- # the default name:
- readonly WSREP_SST_OPT_BINLOG_INDEX='mysql-bin.index'
+ # the default name (note that base of this name
+ # is already defined above):
+ readonly WSREP_SST_OPT_BINLOG_INDEX="$WSREP_SST_OPT_BINLOG.index"
fi
fi
fi
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 339a8fcf4a5..46804c9dce4 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -386,7 +386,7 @@ get_transfer()
elif is_local_ip "$WSREP_SST_OPT_HOST_UNESCAPED"; then
CN_option=',commonname=localhost'
else
- CN_option=",commonname='$WSREP_SST_OPT_HOST_UNSECAPED'"
+ CN_option=",commonname='$WSREP_SST_OPT_HOST_UNESCAPED'"
fi
tcmd="$tcmd,cert='$tpem',key='$tkey',cafile='$tcert'$CN_option$sockopt"
wsrep_log_info "$action with cert=$tpem, key=$tkey, cafile=$tcert"
diff --git a/sql/handler.h b/sql/handler.h
index 7ad00ee546b..75a15ed4c6a 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1079,6 +1079,7 @@ enum enum_schema_tables
SCH_FILES,
SCH_GLOBAL_STATUS,
SCH_GLOBAL_VARIABLES,
+ SCH_KEYWORDS,
SCH_KEY_CACHES,
SCH_KEY_COLUMN_USAGE,
SCH_OPEN_TABLES,
@@ -1095,6 +1096,7 @@ enum enum_schema_tables
SCH_SESSION_STATUS,
SCH_SESSION_VARIABLES,
SCH_STATISTICS,
+ SCH_SQL_FUNCTIONS,
SCH_SYSTEM_VARIABLES,
SCH_TABLES,
SCH_TABLESPACES,
diff --git a/sql/item_create.cc b/sql/item_create.cc
index cdfb70102ec..c80cf7b03d7 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -5464,7 +5464,6 @@ Create_func_year_week::create_native(THD *thd, LEX_CSTRING *name,
return func;
}
-
#define BUILDER(F) & F::s_singleton
/*
@@ -5478,7 +5477,7 @@ Create_func_year_week::create_native(THD *thd, LEX_CSTRING *name,
- keep 1 line per entry, it makes grep | sort easier
*/
-static Native_func_registry func_array[] =
+Native_func_registry func_array[] =
{
{ { STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)},
{ { STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)},
diff --git a/sql/lex.h b/sql/lex.h
index 20e5e405374..cbf9d9d51b2 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -48,7 +48,7 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
the perfschema.start_server_low_digest_sql_length test!
*/
-static SYMBOL symbols[] = {
+SYMBOL symbols[] = {
{ "&&", SYM(AND_AND_SYM)},
{ "<=", SYM(LE)},
{ "<>", SYM(NE)},
@@ -746,7 +746,7 @@ static SYMBOL symbols[] = {
};
-static SYMBOL sql_functions[] = {
+SYMBOL sql_functions[] = {
{ "ADDDATE", SYM(ADDDATE_SYM)},
{ "ADD_MONTHS", SYM(ADD_MONTHS_SYM)},
{ "BIT_AND", SYM(BIT_AND)},
@@ -799,4 +799,7 @@ static SYMBOL sql_functions[] = {
{ "VAR_SAMP", SYM(VAR_SAMP_SYM)},
};
+size_t symbols_length= sizeof(symbols) / sizeof(SYMBOL);
+size_t sql_functions_length= sizeof(sql_functions) / sizeof(SYMBOL);
+
#endif /* LEX_INCLUDED */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 698bcfff0f7..f99b05a0086 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1855,6 +1855,7 @@ static void mysqld_exit(int exit_code)
wait_for_signal_thread_to_end();
#ifdef WITH_WSREP
wsrep_deinit_server();
+ wsrep_sst_auth_free();
#endif /* WITH_WSREP */
mysql_audit_finalize();
clean_up_mutexes();
diff --git a/sql/spatial.cc b/sql/spatial.cc
index df5a46ac8cc..527a1df9d1f 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -563,7 +563,11 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
goto handle_geometry_key;
feature_type_found= 1;
}
+ else /* can't understand the type. */
+ break;
}
+ else /* The "type" value can only be string. */
+ break;
}
else if (key_len == coord_keyname_len &&
memcmp(key_buf, coord_keyname, coord_keyname_len) == 0)
@@ -580,6 +584,8 @@ Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
coord_start= je->value_begin;
if (ci && ci != &geometrycollection_class)
goto create_geom;
+ if (json_skip_level(je))
+ goto err_return;
}
}
else if (key_len == geometries_keyname_len &&
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 02633434031..579ea34b8e4 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -25,13 +25,13 @@
#include "mariadb.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
#include "unireg.h"
-#include "sql_derived.h"
#include "sql_select.h"
#include "derived_handler.h"
#include "sql_base.h"
#include "sql_view.h" // check_duplicate_names
#include "sql_acl.h" // SELECT_ACL
#include "sql_class.h"
+#include "sql_derived.h"
#include "sql_cte.h"
#include "my_json_writer.h"
#include "opt_trace.h"
@@ -1374,6 +1374,67 @@ bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived)
}
+/*
+ @brief
+ Given condition cond and transformer+argument, try transforming as many
+ conjuncts as possible.
+
+ @detail
+ The motivation of this function is to convert the condition that's being
+ pushed into a WHERE clause with derived_field_transformer_for_where or
+ with derived_grouping_field_transformer_for_where.
+ The transformer may fail for some sub-condition, in this case we want to
+ convert the most restrictive part of the condition that can be pushed.
+
+ This function only does it for top-level AND: conjuncts that could not be
+ converted are dropped.
+
+ @return
+ Converted condition, or NULL if nothing could be converted
+*/
+
+Item *transform_condition_or_part(THD *thd,
+ Item *cond,
+ Item_transformer transformer,
+ uchar *arg)
+{
+ if (cond->type() != Item::COND_ITEM ||
+ ((Item_cond*) cond)->functype() != Item_func::COND_AND_FUNC)
+ {
+ Item *new_item= cond->transform(thd, transformer, arg);
+ // Indicate that the condition is not pushable
+ if (!new_item)
+ cond->clear_extraction_flag();
+ return new_item;
+ }
+
+ List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
+ Item *item;
+ while ((item=li++))
+ {
+ Item *new_item= item->transform(thd, transformer, arg);
+ if (!new_item)
+ {
+ // Indicate that the condition is not pushable
+ item->clear_extraction_flag();
+ li.remove();
+ }
+ else
+ li.replace(new_item);
+ }
+
+ switch (((Item_cond*) cond)->argument_list()->elements)
+ {
+ case 0:
+ return NULL;
+ case 1:
+ return ((Item_cond*) cond)->argument_list()->head();
+ default:
+ return cond;
+ }
+}
+
+
/**
@brief
Extract condition that can be pushed into a derived table/view
diff --git a/sql/sql_derived.h b/sql/sql_derived.h
index 403277d65c9..6100b4b4d7e 100644
--- a/sql/sql_derived.h
+++ b/sql/sql_derived.h
@@ -23,6 +23,11 @@ struct LEX;
bool mysql_handle_derived(LEX *lex, uint phases);
bool mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases);
+Item *transform_condition_or_part(THD *thd,
+ Item *cond,
+ Item_transformer transformer,
+ uchar *arg);
+
bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived);
#endif /* SQL_DERIVED_INCLUDED */
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 0bc7c3f5819..c3f97fb34f8 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -31,6 +31,7 @@
#include "sql_select.h"
#include "sql_cte.h"
#include "sql_signal.h"
+#include "sql_derived.h"
#include "sql_truncate.h" // Sql_cmd_truncate_table
#include "sql_admin.h" // Sql_cmd_analyze/Check..._table
#include "sql_partition.h"
@@ -10547,8 +10548,7 @@ void st_select_lex::pushdown_cond_into_where_clause(THD *thd, Item *cond,
if (!join->group_list && !with_sum_func)
{
- cond=
- cond->transform(thd, transformer, arg);
+ cond= transform_condition_or_part(thd, cond, transformer, arg);
if (cond)
{
cond->walk(
@@ -10573,9 +10573,12 @@ void st_select_lex::pushdown_cond_into_where_clause(THD *thd, Item *cond,
into WHERE so it can be pushed.
*/
if (cond_over_grouping_fields)
- cond_over_grouping_fields= cond_over_grouping_fields->transform(thd,
- &Item::grouping_field_transformer_for_where,
- (uchar*) this);
+ {
+ cond_over_grouping_fields=
+ transform_condition_or_part(thd, cond_over_grouping_fields,
+ &Item::grouping_field_transformer_for_where,
+ (uchar*) this);
+ }
if (cond_over_grouping_fields)
{
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e2ffc3c5da9..326f04dad29 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 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
@@ -66,6 +66,18 @@
#include "opt_trace.h"
#include "my_cpu.h"
+
+#include "lex_symbol.h"
+#define KEYWORD_SIZE 64
+
+extern SYMBOL symbols[];
+extern size_t symbols_length;
+
+extern SYMBOL sql_functions[];
+extern size_t sql_functions_length;
+
+extern Native_func_registry_array native_func_registry_array;
+
enum enum_i_s_events_fields
{
ISE_EVENT_CATALOG= 0,
@@ -7860,6 +7872,58 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
DBUG_RETURN(res);
}
+int add_symbol_to_table(const char* name, TABLE* table){
+ DBUG_ENTER("add_symbol_to_table");
+
+ size_t length= strlen(name);
+
+ // If you've added a new SQL keyword longer than KEYWORD_SIZE,
+ // please increase the defined max length
+ DBUG_ASSERT(length < KEYWORD_SIZE);
+
+ restore_record(table, s->default_values);
+ table->field[0]->set_notnull();
+ table->field[0]->store(name, length,
+ system_charset_info);
+ if (schema_table_store_record(table->in_use, table))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
+int fill_i_s_keywords(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_i_s_keywords");
+
+ TABLE *table= tables->table;
+
+ for (uint i= 0; i < symbols_length; i++){
+ const char *name= symbols[i].name;
+ if (add_symbol_to_table(name, table))
+ DBUG_RETURN(1);
+ }
+
+ DBUG_RETURN(0);
+}
+
+int fill_i_s_sql_functions(THD *thd, TABLE_LIST *tables, COND *cond)
+{
+ DBUG_ENTER("fill_i_s_sql_functions");
+
+ TABLE *table= tables->table;
+
+ for (uint i= 0; i < sql_functions_length; i++)
+ if (add_symbol_to_table(sql_functions[i].name, table))
+ DBUG_RETURN(1);
+
+ for (uint i= 0; i < native_func_registry_array.count(); i++)
+ if (add_symbol_to_table(native_func_registry_array.element(i).name.str,
+ table))
+ DBUG_RETURN(1);
+
+ DBUG_RETURN(0);
+}
+
int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
{
@@ -9011,6 +9075,18 @@ ST_FIELD_INFO enabled_roles_fields_info[]=
CEnd()
};
+ST_FIELD_INFO keywords_field_info[]=
+{
+ Column("WORD", Varchar(KEYWORD_SIZE), NULLABLE),
+ CEnd()
+};
+
+ST_FIELD_INFO sql_functions_field_info[]=
+{
+ Column("FUNCTION", Varchar(KEYWORD_SIZE), NULLABLE),
+ CEnd()
+};
+
ST_FIELD_INFO engines_fields_info[]=
{
@@ -9590,6 +9666,8 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_status, make_old_format, 0, 0, -1, 0, 0},
{"GLOBAL_VARIABLES", Show::variables_fields_info, 0,
fill_variables, make_old_format, 0, 0, -1, 0, 0},
+ {"KEYWORDS", Show::keywords_field_info, 0,
+ fill_i_s_keywords, 0, 0, -1, -1, 0, 0},
{"KEY_CACHES", Show::keycache_fields_info, 0,
fill_key_cache_tables, 0, 0, -1,-1, 0, 0},
{"KEY_COLUMN_USAGE", Show::key_column_usage_fields_info, 0,
@@ -9627,6 +9705,8 @@ ST_SCHEMA_TABLE schema_tables[]=
{"STATISTICS", Show::stat_fields_info, 0,
get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0,
OPEN_TABLE_ONLY|OPTIMIZE_I_S_TABLE},
+ {"SQL_FUNCTIONS", Show::sql_functions_field_info, 0,
+ fill_i_s_sql_functions, 0, 0, -1, -1, 0, 0},
{"SYSTEM_VARIABLES", Show::sysvars_fields_info, 0,
fill_sysvars, make_old_format, 0, 0, -1, 0, 0},
{"TABLES", Show::tables_fields_info, 0,
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 24ad0bd4676..9610e795f7a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -10155,9 +10155,13 @@ do_continue:;
if (alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_NONE)
ha_alter_info.online= true;
// Ask storage engine whether to use copy or in-place
- ha_alter_info.inplace_supported=
- table->file->check_if_supported_inplace_alter(&altered_table,
- &ha_alter_info);
+ {
+ Check_level_instant_set check_level_save(thd, CHECK_FIELD_WARN);
+ ha_alter_info.inplace_supported=
+ table->file->check_if_supported_inplace_alter(&altered_table,
+ &ha_alter_info);
+ }
+
if (ha_alter_info.inplace_supported != HA_ALTER_INPLACE_NOT_SUPPORTED)
{
List_iterator<Key> it(alter_info->key_list);
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 57c1885b777..2adc893c131 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -1055,6 +1055,8 @@ static ssize_t sst_prepare_other (const char* method,
{
WSREP_ERROR("sst_prepare_other(): generate_binlog_index_opt_val() failed %d",
ret);
+ if (binlog_opt_val) my_free(binlog_opt_val);
+ return ret;
}
make_wsrep_defaults_file();
@@ -1072,6 +1074,7 @@ static ssize_t sst_prepare_other (const char* method,
wsrep_defaults_file,
(int)getpid(),
binlog_opt_val, binlog_index_opt_val);
+
my_free(binlog_opt_val);
my_free(binlog_index_opt_val);
@@ -1800,6 +1803,8 @@ static int sst_donate_other (const char* method,
{
WSREP_ERROR("sst_prepare_other(): generate_binlog_index_opt_val() failed %d",
ret);
+ if (binlog_opt_val) my_free(binlog_opt_val);
+ return ret;
}
make_wsrep_defaults_file();
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index efc92a384c5..e888c4aed1a 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -3292,6 +3292,8 @@ os_file_set_size(
fallback:
#else
+ struct stat statbuf;
+
if (is_sparse) {
bool success = !ftruncate(file, size);
if (!success) {
@@ -3305,10 +3307,17 @@ fallback:
# ifdef HAVE_POSIX_FALLOCATE
int err;
do {
- os_offset_t current_size = os_file_get_size(file);
- err = current_size >= size
- ? 0 : posix_fallocate(file, current_size,
+ if (fstat(file, &statbuf)) {
+ err = errno;
+ } else {
+ os_offset_t current_size = statbuf.st_size;
+ if (current_size >= size) {
+ return true;
+ }
+ current_size &= ~os_offset_t(statbuf.st_blksize - 1);
+ err = posix_fallocate(file, current_size,
size - current_size);
+ }
} while (err == EINTR
&& srv_shutdown_state <= SRV_SHUTDOWN_INITIATED);
@@ -3331,6 +3340,27 @@ fallback:
# endif /* HAVE_POSIX_ALLOCATE */
#endif /* _WIN32*/
+#ifdef _WIN32
+ os_offset_t current_size = os_file_get_size(file);
+ FILE_STORAGE_INFO info;
+ if (GetFileInformationByHandleEx(file, FileStorageInfo, &info,
+ sizeof info)) {
+ if (info.LogicalBytesPerSector) {
+ current_size &= ~os_offset_t(info.LogicalBytesPerSector
+ - 1);
+ }
+ }
+#else
+ if (fstat(file, &statbuf)) {
+ return false;
+ }
+ os_offset_t current_size = statbuf.st_size
+ & ~os_offset_t(statbuf.st_blksize - 1);
+#endif
+ if (current_size >= size) {
+ return true;
+ }
+
/* Write up to 1 megabyte at a time. */
ulint buf_size = ut_min(ulint(64),
ulint(size >> srv_page_size_shift))
@@ -3342,8 +3372,6 @@ fallback:
/* Write buffer full of zeros */
memset(buf, 0, buf_size);
- os_offset_t current_size = os_file_get_size(file);
-
while (current_size < size
&& srv_shutdown_state <= SRV_SHUTDOWN_INITIATED) {
ulint n_bytes;
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index c4886101499..902f3f2d5ca 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -248,6 +248,8 @@ enum rec_leaf_format {
in ROW_FORMAT=COMPACT,DYNAMIC,COMPRESSED.
This is a special case of rec_init_offsets() and rec_get_offsets_func().
@tparam mblob whether the record includes a metadata BLOB
+@tparam redundant_temp whether the record belongs to a temporary file
+ of a ROW_FORMAT=REDUNDANT table
@param[in] rec leaf-page record
@param[in] index the index that the record belongs in
@param[in] n_core number of core fields (index->n_core_fields)
@@ -255,7 +257,7 @@ This is a special case of rec_init_offsets() and rec_get_offsets_func().
NULL to refer to index->fields[].col->def_val
@param[in,out] offsets offsets, with valid rec_offs_n_fields(offsets)
@param[in] format record format */
-template<bool mblob = false>
+template<bool mblob = false, bool redundant_temp = false>
static inline
void
rec_init_offsets_comp_ordinary(
@@ -286,7 +288,9 @@ rec_init_offsets_comp_ordinary(
const unsigned n_core_null_bytes = UNIV_UNLIKELY(index->n_core_fields
!= n_core)
? UT_BITS_IN_BYTES(unsigned(index->get_n_nullable(n_core)))
- : index->n_core_null_bytes;
+ : (redundant_temp
+ ? UT_BITS_IN_BYTES(index->n_nullable)
+ : index->n_core_null_bytes);
if (mblob) {
ut_ad(index->table->instant);
@@ -1121,8 +1125,8 @@ rec_get_nth_field_offs_old(
}
/** Determine the size of a data tuple prefix in ROW_FORMAT=COMPACT.
-@tparam mblob whether the record includes a metadata BLOB
-@tparam redundant_temp whether to use the ROW_FORMAT=REDUNDANT format
+@tparam mblob whether the record includes a metadata BLOB
+@tparam redundant_temp whether to use the ROW_FORMAT=REDUNDANT format
@param[in] index record descriptor; dict_table_is_comp()
is assumed to hold, even if it doesn't
@param[in] dfield array of data fields
@@ -1169,7 +1173,9 @@ rec_get_converted_size_comp_prefix_low(
- n_core_fields);
} else {
ut_ad(n_fields <= n_core_fields);
- extra_size += index->n_core_null_bytes;
+ extra_size += redundant_temp
+ ? UT_BITS_IN_BYTES(index->n_nullable)
+ : index->n_core_null_bytes;
}
ulint data_size = 0;
@@ -1811,10 +1817,19 @@ rec_init_offsets_temp(
if it was emptied during an ALTER TABLE operation. */
ut_ad(index->n_core_fields == n_core || !index->is_instant());
ut_ad(index->n_core_fields >= n_core);
- rec_init_offsets_comp_ordinary(rec, index, offsets, n_core, def_val,
- status == REC_STATUS_INSTANT
- ? REC_LEAF_TEMP_INSTANT
- : REC_LEAF_TEMP);
+ if (index->table->not_redundant()) {
+ rec_init_offsets_comp_ordinary(
+ rec, index, offsets, n_core, def_val,
+ status == REC_STATUS_INSTANT
+ ? REC_LEAF_TEMP_INSTANT
+ : REC_LEAF_TEMP);
+ } else {
+ rec_init_offsets_comp_ordinary<false, true>(
+ rec, index, offsets, n_core, def_val,
+ status == REC_STATUS_INSTANT
+ ? REC_LEAF_TEMP_INSTANT
+ : REC_LEAF_TEMP);
+ }
}
/** Determine the offset to each field in temporary file.
@@ -1829,9 +1844,15 @@ rec_init_offsets_temp(
rec_offs* offsets)
{
ut_ad(!index->is_instant());
- rec_init_offsets_comp_ordinary(rec, index, offsets,
- index->n_core_fields, NULL,
- REC_LEAF_TEMP);
+ if (index->table->not_redundant()) {
+ rec_init_offsets_comp_ordinary(
+ rec, index, offsets,
+ index->n_core_fields, NULL, REC_LEAF_TEMP);
+ } else {
+ rec_init_offsets_comp_ordinary<false, true>(
+ rec, index, offsets,
+ index->n_core_fields, NULL, REC_LEAF_TEMP);
+ }
}
/** Convert a data tuple prefix to the temporary file format.