summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-11-29 11:39:34 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-11-29 11:39:34 +0200
commit51c89849d16f3f6cfadfa645c49815db3cbfece7 (patch)
tree8679103f7897480cc9b5ff3308687cce1f32dade
parentbf8735eb16068c0d2480948b365f7e39dc011be5 (diff)
parentd4cb1776030b643895da0532b75c051f55e84356 (diff)
downloadmariadb-git-51c89849d16f3f6cfadfa645c49815db3cbfece7.tar.gz
Merge 10.5 into 10.6
-rw-r--r--cmake/Internal/CPack/CPackRPM.cmake6
-rw-r--r--cmake/cpack_rpm.cmake58
-rw-r--r--extra/mariabackup/CMakeLists.txt3
-rw-r--r--extra/mariabackup/xbstream.cc2
-rw-r--r--mysql-test/main/cte_nonrecursive.result53
-rw-r--r--mysql-test/main/cte_nonrecursive.test51
-rw-r--r--mysql-test/main/join.result4
-rw-r--r--mysql-test/main/join.test6
-rw-r--r--mysql-test/main/parser.result31
-rw-r--r--mysql-test/main/parser.test46
-rw-r--r--mysql-test/main/type_date.result12
-rw-r--r--mysql-test/main/type_date.test9
-rw-r--r--mysql-test/main/type_time.result12
-rw-r--r--mysql-test/main/type_time.test10
-rw-r--r--mysql-test/main/upgrade_geometrycolumn_procedure_definer.result225
-rw-r--r--mysql-test/main/upgrade_geometrycolumn_procedure_definer.test66
-rwxr-xr-xmysql-test/mariadb-test-run.pl4
-rw-r--r--plugin/auth_gssapi/CMakeLists.txt6
-rw-r--r--plugin/cracklib_password_check/CMakeLists.txt4
-rw-r--r--scripts/mysql_install_db.sh6
-rw-r--r--scripts/mysql_system_tables_fix.sql5
-rw-r--r--sql/mysql_upgrade_service.cc18
-rw-r--r--sql/sql_class.cc28
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_lex.cc5
-rw-r--r--sql/sql_yacc.yy18
-rw-r--r--storage/connect/CMakeLists.txt5
-rw-r--r--storage/oqgraph/CMakeLists.txt7
-rw-r--r--storage/rocksdb/CMakeLists.txt4
29 files changed, 617 insertions, 88 deletions
diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake
index 174d28b9a14..1ca95670cfb 100644
--- a/cmake/Internal/CPack/CPackRPM.cmake
+++ b/cmake/Internal/CPack/CPackRPM.cmake
@@ -22,6 +22,12 @@ macro(restore WHAT)
set(CPACK_RPM_PACKAGE_${WHAT} ${orig_CPACK_RPM_PACKAGE_${WHAT}})
endmacro()
+foreach (WHAT SUMMARY DESCRIPTION)
+ if(NOT CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT})
+ message(FATAL_ERROR "CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${WHAT} is not defined")
+ endif()
+endforeach()
+
set_from_component(LICENSE)
set_from_component(VENDOR)
set_from_component(VERSION)
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index dbdb30afe30..172f65ab17c 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -64,13 +64,26 @@ conditions of the GNU General Public License Version 2 (http://www.gnu.org/licen
MariaDB documentation can be found at https://mariadb.com/kb
MariaDB bug reports should be submitted through https://jira.mariadb.org")
+# mariabackup
+SET(CPACK_RPM_backup_PACKAGE_SUMMARY "Backup tool for MariaDB server")
+SET(CPACK_RPM_backup_PACKAGE_DESCRIPTION "Mariabackup is an open source tool provided by MariaDB
+for performing physical online backups of InnoDB, Aria and MyISAM tables.
+For InnoDB, “hot online” backups are possible.
+It was originally forked from Percona XtraBackup 2.3.8.")
+
# Packages with default description
SET(CPACK_RPM_client_PACKAGE_SUMMARY "MariaDB database client binaries")
+SET(CPACK_RPM_client_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)")
+SET(CPACK_RPM_common_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_compat_PACKAGE_SUMMARY "MariaDB database client library MySQL compat package")
+SET(CPACK_RPM_compat_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_devel_PACKAGE_SUMMARY "MariaDB database development files")
+SET(CPACK_RPM_devel_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_server_PACKAGE_SUMMARY "MariaDB database server binaries")
+SET(CPACK_RPM_server_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_test_PACKAGE_SUMMARY "MariaDB database regression test suite")
+SET(CPACK_RPM_test_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
# libmariadb3
SET(CPACK_RPM_shared_PACKAGE_SUMMARY "LGPL MariaDB database client library")
@@ -83,51 +96,6 @@ and PHP's mysqlnd extension.
This product includes PHP software, freely available from
http://www.php.net/software/")
-# Summary and descriptions per package
-SET(CPACK_RPM_backup_PACKAGE_SUMMARY "Backup tool for MariaDB server")
-SET(CPACK_RPM_backup_PACKAGE_DESCRIPTION "Mariabackup is an open source tool provided by MariaDB
-for performing physical online backups of InnoDB, Aria and MyISAM tables.
-For InnoDB, “hot online” backups are possible.
-It was originally forked from Percona XtraBackup 2.3.8.")
-
-SET(CPACK_RPM_cassandra-engine_PACKAGE_SUMMARY "Cassandra storage engine for MariaDB")
-SET(CPACK_RPM_cassandra-engine_PACKAGE_DESCRIPTION "The Cassandra Storage Engine allows access to data in a Cassandra cluster from
-MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage
-engine) makes Cassandra's column family appear as a table in MariaDB that you
-can insert to, update, and select from. You can write joins against this table,
-it is possible to join data that's stored in MariaDB with data that's stored in
-Cassandra.")
-
-SET(CPACK_RPM_connect-engine_PACKAGE_SUMMARY "Connect storage engine for MariaDB")
-SET(CPACK_RPM_connect-engine_PACKAGE_DESCRIPTION "Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
-connections to ODBC tables and remote MySQL tables, as well as a number of
-other interesting features.")
-
-SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB")
-SET(CPACK_RPM_cracklib-password-check_PACKAGE_DESCRIPTION "This password validation plugin uses cracklib to allow only
-sufficiently secure (as defined by cracklib) user passwords in MariaDB.")
-
-SET(CPACK_RPM_gssapi-server_PACKAGE_SUMMARY "GSSAPI authentication plugin for MariaDB server")
-SET(CPACK_RPM_gssapi-server_PACKAGE_DESCRIPTION "The gssapi authentication plugin allows the user to authenticate with services
-that use the Generic Security Services Application Program Interface (GSSAPI).
-The gssapi authentication plugin is most often used for authenticating with Microsoft Active Directory.")
-
-SET(CPACK_RPM_oqgraph-engine_PACKAGE_SUMMARY "OQGraph storage engine for MariaDB")
-SET(CPACK_RPM_oqgraph-engine_PACKAGE_DESCRIPTION "The Open Query GRAPH computation engine, or OQGRAPH as the engine itself is called,
-allows you to handle hierarchies (tree structures) and complex graphs
-(nodes having many connections in several directions).
-It is intended to be used for retrieving hierarchical information, such as those used for graphs,
-routes or social relationships, in plain SQL.")
-
-SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB")
-SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed
-at maximising storage efficiency while maintaining InnoDB-like performance.")
-
-SET(CPACK_RPM_tokudb-engine_PACKAGE_SUMMARY "TokuDB storage engine for MariaDB")
-SET(CPACK_RPM_tokudb-engine_PACKAGE_DESCRIPTION "The TokuDB storage engine is for use in high-performance and write-intensive
-environments, offering increased compression and better performance based
-on fractal indexes.")
-
SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define mysql_vendor ${CPACK_PACKAGE_VENDOR}
%define mysqlversion ${MYSQL_NO_DASH_VERSION}
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt
index 5776a7ddab3..a7a35c58ac3 100644
--- a/extra/mariabackup/CMakeLists.txt
+++ b/extra/mariabackup/CMakeLists.txt
@@ -16,11 +16,11 @@
OPTION(WITH_MARIABACKUP "Include mariabackup" ON)
ADD_FEATURE_INFO(MARIABACKUP WITH_MARIABACKUP "MariaDB Backup Utility")
+
IF(NOT WITH_MARIABACKUP)
RETURN()
ENDIF()
-
IF(NOT WIN32)
CHECK_SYMBOL_EXISTS(regcomp regex.h HAVE_SYSTEM_REGEX)
IF(HAVE_SYSTEM_REGEX)
@@ -28,7 +28,6 @@ IF(NOT WIN32)
ENDIF()
ENDIF()
-
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
diff --git a/extra/mariabackup/xbstream.cc b/extra/mariabackup/xbstream.cc
index 3fe9d17d86e..6306806b867 100644
--- a/extra/mariabackup/xbstream.cc
+++ b/extra/mariabackup/xbstream.cc
@@ -440,8 +440,8 @@ extract_worker_thread_func(void *arg)
}
if (chunk.type == XB_CHUNK_TYPE_EOF) {
- pthread_mutex_lock(ctxt->mutex);
pthread_mutex_unlock(&entry->mutex);
+ pthread_mutex_lock(ctxt->mutex);
my_hash_delete(ctxt->filehash, (uchar *) entry);
pthread_mutex_unlock(ctxt->mutex);
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index 407e9b6077e..f87f0f128dd 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -1693,7 +1693,9 @@ disconnect con1;
#
# MDEV-22781: create view with CTE without default database
#
-drop database test;
+create database db;
+use db;
+drop database db;
create database db1;
create table db1.t1 (a int);
insert into db1.t1 values (3),(7),(1);
@@ -1723,7 +1725,6 @@ a
drop view db1.v1;
drop table db1.t1;
drop database db1;
-create database test;
use test;
#
# MDEV-24597: CTE with union used multiple times in query
@@ -2136,6 +2137,54 @@ drop procedure sp1;
drop function g;
drop function f;
drop table t1;
+#
+# MDEV-27086: union using CTEs in CREATE TABLE
+#
+create or replace temporary table tmp as
+with cte1 as (select 1 as a), cte2 as (select 2 as a)
+select * from cte1 union select * from cte2;
+select * from tmp;
+a
+1
+2
+create table t1 as
+with cte1 as (select 1 as a), cte2 as (select 2 as a)
+select * from cte1 union select * from cte2;
+select * from t1;
+a
+1
+2
+insert into t1 values (3);
+create table t2 as
+with cte1 as (select * from t1 where a <2), cte2 as (select * from t1 where a > 2)
+select * from cte1 union select * from cte2;
+select * from t2;
+a
+1
+3
+drop table t1,t2;
+#
+# MDEV-26470: CTE in WITH clause of subquery used in DELETE
+#
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (5);
+create table t2 (b int);
+insert into t2 values (4), (1), (3), (2);
+delete from t1
+where a in (with cte(a) as (select * from t2 where b <=2) select a from cte);
+select * from t1;
+a
+3
+7
+5
+insert into t1 values (1), (3);
+delete t1 from t1, t2
+where t1.a=t2.b or
+t1.a in (with cte(a) as (select b+1 from t2) select * from cte);
+select * from t1;
+a
+7
+drop table t1,t2;
# 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 78a901ba0f2..0e58c4aa3e1 100644
--- a/mysql-test/main/cte_nonrecursive.test
+++ b/mysql-test/main/cte_nonrecursive.test
@@ -1217,7 +1217,9 @@ DROP TABLE test.t;
--echo # MDEV-22781: create view with CTE without default database
--echo #
-drop database test;
+create database db;
+use db;
+drop database db;
create database db1;
create table db1.t1 (a int);
insert into db1.t1 values (3),(7),(1);
@@ -1239,7 +1241,6 @@ drop view db1.v1;
drop table db1.t1;
drop database db1;
-create database test;
use test;
--echo #
@@ -1590,6 +1591,52 @@ drop function g;
drop function f;
drop table t1;
+--echo #
+--echo # MDEV-27086: union using CTEs in CREATE TABLE
+--echo #
+
+create or replace temporary table tmp as
+with cte1 as (select 1 as a), cte2 as (select 2 as a)
+select * from cte1 union select * from cte2;
+select * from tmp;
+
+create table t1 as
+with cte1 as (select 1 as a), cte2 as (select 2 as a)
+select * from cte1 union select * from cte2;
+select * from t1;
+
+insert into t1 values (3);
+
+create table t2 as
+with cte1 as (select * from t1 where a <2), cte2 as (select * from t1 where a > 2)
+select * from cte1 union select * from cte2;
+select * from t2;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-26470: CTE in WITH clause of subquery used in DELETE
+--echo #
+
+create table t1 (a int);
+insert into t1 values (3), (7), (1), (5);
+
+create table t2 (b int);
+insert into t2 values (4), (1), (3), (2);
+
+delete from t1
+ where a in (with cte(a) as (select * from t2 where b <=2) select a from cte);
+select * from t1;
+
+insert into t1 values (1), (3);
+
+delete t1 from t1, t2
+ where t1.a=t2.b or
+ t1.a in (with cte(a) as (select b+1 from t2) select * from cte);
+select * from t1;
+
+drop table t1,t2;
+
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result
index c78cb8b45c7..11b7ecad3ee 100644
--- a/mysql-test/main/join.result
+++ b/mysql-test/main/join.result
@@ -3315,6 +3315,9 @@ SELECT STRAIGHT_JOIN * FROM t1, t2 AS t2_1, t2 AS t2_2
WHERE t2_2.c = t2_1.c AND t2_2.b = t2_1.b AND ( a IS NULL OR t2_1.c = a );
a b c b c
DROP TABLE t1,t2;
+select a.a from (select 1 as a) a, (select 2 as b) b cross join (select 3 as c) c left join (select 4 as d) d on 1;
+a
+1
#
# MDEV-19600: The optimizer should be able to produce rows=1 estimate for unique index with NULLable columns
#
@@ -3403,3 +3406,4 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ref a a 5 test.t2.key2 1
drop table t1,t2,t3;
drop table t1000,t10,t03;
+# End of 10.3 tests
diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test
index 08930b622e2..b99f05f7c88 100644
--- a/mysql-test/main/join.test
+++ b/mysql-test/main/join.test
@@ -1720,6 +1720,11 @@ SELECT STRAIGHT_JOIN * FROM t1, t2 AS t2_1, t2 AS t2_2
DROP TABLE t1,t2;
+#
+# MDEV-20330 Combination of "," (comma), cross join and left join fails to parse
+#
+select a.a from (select 1 as a) a, (select 2 as b) b cross join (select 3 as c) c left join (select 4 as d) d on 1;
+
--echo #
--echo # MDEV-19600: The optimizer should be able to produce rows=1 estimate for unique index with NULLable columns
--echo #
@@ -1814,3 +1819,4 @@ WHERE
drop table t1,t2,t3;
drop table t1000,t10,t03;
+--echo # End of 10.3 tests
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index 6899f8df153..6a24e435878 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1336,6 +1336,37 @@ view_definition
select 1 not between 2 like 3 and 4 AS `1 not between (2 like 3) and 4`
drop view v1;
#
+# Start of 10.2 tests
+#
+#
+# MDEV-27066 Fixed scientific notation parser
+#
+SELECT 1 1.e*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 '1.e*1' at line 1
+SELECT 1 1.e/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 '1.e/1' at line 1
+SELECT 1 1.e^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 '1.e^1' at line 1
+SELECT 1 1.e%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 '1.e%1' at line 1
+SELECT 1 1.e&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 '1.e&1' at line 1
+SELECT 1 1.e|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 '1.e|1' at line 1
+SELECT 1.e(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 '1.e(1)' at line 1
+SELECT (1 1.e);
+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 '1.e)' at line 1
+SELECT 1 1.e, 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 '1.e, 1' at line 1
+CREATE TABLE scientific_notation (test int);
+SELECT tmp 1.e.test FROM scientific_notation AS tmp;
+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 '1.e.test FROM scientific_notation AS tmp' at line 1
+DROP TABLE scientific_notation;
+#
+# End of 10.2 tests
+#
+#
# MDEV-10343 Providing compatibility for basic SQL data types
#
CREATE TABLE clob (clob int);
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 61cea2e7fa4..cbd3274113a 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1363,6 +1363,52 @@ Select view_definition from information_schema.views where table_schema='test' a
drop view v1;
--echo #
+--echo # Start of 10.2 tests
+--echo #
+--echo #
+
+--echo # MDEV-27066 Fixed scientific notation parser
+--echo #
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e*1;
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e/1;
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e^1;
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e%1;
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e&1;
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e|1;
+
+--error ER_PARSE_ERROR
+SELECT 1.e(1);
+
+--error ER_PARSE_ERROR
+SELECT (1 1.e);
+
+--error ER_PARSE_ERROR
+SELECT 1 1.e, 1;
+
+CREATE TABLE scientific_notation (test int);
+
+--error ER_PARSE_ERROR
+SELECT tmp 1.e.test FROM scientific_notation AS tmp;
+
+DROP TABLE scientific_notation;
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
+
+--echo #
--echo # MDEV-10343 Providing compatibility for basic SQL data types
--echo #
CREATE TABLE clob (clob int);
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index 926ed1a8393..ae3a51c96da 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -939,6 +939,18 @@ Warning 1292 Truncated incorrect datetime value: '1995.0000000'
Note 1003 select `test`.`t1`.`f` AS `f` from `test`.`t1` where '0000-00-00' between `test`.`t1`.`f` and <cache>('2012-12-12')
DROP TABLE t1;
#
+# MDEV-27072 Subquery using the ALL keyword on date columns produces a wrong result
+#
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('2021-11-17'), ('2021-10-17'),('2022-11-17'), ('2020-10-17');
+SELECT * FROM t1 WHERE d >= ALL (SELECT * FROM t1);
+d
+2022-11-17
+SELECT * FROM t1 WHERE d <= ALL (SELECT * FROM t1);
+d
+2020-10-17
+DROP TABLE t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/type_date.test b/mysql-test/main/type_date.test
index a29f78a679b..1136062bb88 100644
--- a/mysql-test/main/type_date.test
+++ b/mysql-test/main/type_date.test
@@ -647,6 +647,15 @@ INSERT INTO t1 VALUES ('2020-01-01'),('2020-01-02');
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1995.0000000 BETWEEN f AND '2012-12-12';
DROP TABLE t1;
+--echo #
+--echo # MDEV-27072 Subquery using the ALL keyword on date columns produces a wrong result
+--echo #
+
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('2021-11-17'), ('2021-10-17'),('2022-11-17'), ('2020-10-17');
+SELECT * FROM t1 WHERE d >= ALL (SELECT * FROM t1);
+SELECT * FROM t1 WHERE d <= ALL (SELECT * FROM t1);
+DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
diff --git a/mysql-test/main/type_time.result b/mysql-test/main/type_time.result
index ead494e3ace..40746345bdf 100644
--- a/mysql-test/main/type_time.result
+++ b/mysql-test/main/type_time.result
@@ -1380,6 +1380,18 @@ Warning 1292 Truncated incorrect time value: '1995.0000000'
Note 1003 select `test`.`t1`.`f` AS `f` from `test`.`t1` where '00:00:00.000000' between `test`.`t1`.`f` and <cache>('23:59:59')
DROP TABLE t1;
#
+# MDEV-27098 Subquery using the ALL keyword on TIME columns produces a wrong result
+#
+CREATE TABLE t1 (d TIME);
+INSERT INTO t1 VALUES ('120:00:00'), ('20:00:00'), ('-120:00:00'), ('-220:00:00');
+SELECT * FROM t1 WHERE d >= ALL (SELECT * FROM t1);
+d
+120:00:00
+SELECT * FROM t1 WHERE d <= ALL (SELECT * FROM t1);
+d
+-220:00:00
+DROP TABLE t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/type_time.test b/mysql-test/main/type_time.test
index 1d4d157b976..0739348fcf0 100644
--- a/mysql-test/main/type_time.test
+++ b/mysql-test/main/type_time.test
@@ -829,6 +829,16 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1995.0000000 BETWEEN f AND '23:59:59';
DROP TABLE t1;
--echo #
+--echo # MDEV-27098 Subquery using the ALL keyword on TIME columns produces a wrong result
+--echo #
+
+CREATE TABLE t1 (d TIME);
+INSERT INTO t1 VALUES ('120:00:00'), ('20:00:00'), ('-120:00:00'), ('-220:00:00');
+SELECT * FROM t1 WHERE d >= ALL (SELECT * FROM t1);
+SELECT * FROM t1 WHERE d <= ALL (SELECT * FROM t1);
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result
new file mode 100644
index 00000000000..8965b8a16f4
--- /dev/null
+++ b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result
@@ -0,0 +1,225 @@
+#
+# The definer of Add/DropGeometryColumn procedures should be updated to mariadb.sys during upgrade
+#
+use mysql;
+create table save_proc like proc;
+insert into save_proc select * from proc;
+set @save_sql_mode= @@sql_mode;
+#
+# If the definer is root before the upgrade:
+# Drop the procedures if exists and recreate with root definer
+#
+DROP PROCEDURE IF EXISTS AddGeometryColumn;
+DROP PROCEDURE IF EXISTS DropGeometryColumn;
+CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
+t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
+begin
+set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
+t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
+begin
+set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'root@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'root@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+0
+#
+# Run mysql_upgrade
+#
+Phase 1/7: Checking and upgrading mysql database
+Processing databases
+mysql
+mysql.column_stats OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.global_priv OK
+mysql.gtid_slave_pos OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.index_stats OK
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.plugin OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.proxies_priv OK
+mysql.roles_mapping OK
+mysql.save_proc OK
+mysql.servers OK
+mysql.table_stats OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+
+Repairing tables
+mysql.innodb_index_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.innodb_table_stats
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+mysql.transaction_registry
+Error : Unknown storage engine 'InnoDB'
+error : Corrupt
+Phase 2/7: Installing used storage engines... Skipped
+Phase 3/7: Fixing views
+mysql.user OK
+sys.host_summary OK
+sys.host_summary_by_file_io OK
+sys.host_summary_by_file_io_type OK
+sys.host_summary_by_stages OK
+sys.host_summary_by_statement_latency OK
+sys.host_summary_by_statement_type OK
+sys.innodb_buffer_stats_by_schema OK
+sys.innodb_buffer_stats_by_table OK
+sys.innodb_lock_waits OK
+sys.io_by_thread_by_latency OK
+sys.io_global_by_file_by_bytes OK
+sys.io_global_by_file_by_latency OK
+sys.io_global_by_wait_by_bytes OK
+sys.io_global_by_wait_by_latency OK
+sys.latest_file_io OK
+sys.memory_by_host_by_current_bytes OK
+sys.memory_by_thread_by_current_bytes OK
+sys.memory_by_user_by_current_bytes OK
+sys.memory_global_by_current_bytes OK
+sys.memory_global_total OK
+sys.metrics OK
+sys.processlist OK
+sys.ps_check_lost_instrumentation OK
+sys.schema_auto_increment_columns OK
+sys.schema_index_statistics OK
+sys.schema_object_overview OK
+sys.schema_redundant_indexes OK
+sys.schema_table_lock_waits OK
+sys.schema_table_statistics OK
+sys.schema_table_statistics_with_buffer OK
+sys.schema_tables_with_full_table_scans OK
+sys.schema_unused_indexes OK
+sys.session OK
+sys.session_ssl_status OK
+sys.statement_analysis OK
+sys.statements_with_errors_or_warnings OK
+sys.statements_with_full_table_scans OK
+sys.statements_with_runtimes_in_95th_percentile OK
+sys.statements_with_sorting OK
+sys.statements_with_temp_tables OK
+sys.user_summary OK
+sys.user_summary_by_file_io OK
+sys.user_summary_by_file_io_type OK
+sys.user_summary_by_stages OK
+sys.user_summary_by_statement_latency OK
+sys.user_summary_by_statement_type OK
+sys.version OK
+sys.wait_classes_global_by_avg_latency OK
+sys.wait_classes_global_by_latency OK
+sys.waits_by_host_by_latency OK
+sys.waits_by_user_by_latency OK
+sys.waits_global_by_latency OK
+sys.x$host_summary OK
+sys.x$host_summary_by_file_io OK
+sys.x$host_summary_by_file_io_type OK
+sys.x$host_summary_by_stages OK
+sys.x$host_summary_by_statement_latency OK
+sys.x$host_summary_by_statement_type OK
+sys.x$innodb_buffer_stats_by_schema OK
+sys.x$innodb_buffer_stats_by_table OK
+sys.x$innodb_lock_waits OK
+sys.x$io_by_thread_by_latency OK
+sys.x$io_global_by_file_by_bytes OK
+sys.x$io_global_by_file_by_latency OK
+sys.x$io_global_by_wait_by_bytes OK
+sys.x$io_global_by_wait_by_latency OK
+sys.x$latest_file_io OK
+sys.x$memory_by_host_by_current_bytes OK
+sys.x$memory_by_thread_by_current_bytes OK
+sys.x$memory_by_user_by_current_bytes OK
+sys.x$memory_global_by_current_bytes OK
+sys.x$memory_global_total OK
+sys.x$processlist OK
+sys.x$ps_digest_95th_percentile_by_avg_us OK
+sys.x$ps_digest_avg_latency_distribution OK
+sys.x$ps_schema_table_statistics_io OK
+sys.x$schema_flattened_keys OK
+sys.x$schema_index_statistics OK
+sys.x$schema_table_lock_waits OK
+sys.x$schema_table_statistics OK
+sys.x$schema_table_statistics_with_buffer OK
+sys.x$schema_tables_with_full_table_scans OK
+sys.x$session OK
+sys.x$statement_analysis OK
+sys.x$statements_with_errors_or_warnings OK
+sys.x$statements_with_full_table_scans OK
+sys.x$statements_with_runtimes_in_95th_percentile OK
+sys.x$statements_with_sorting OK
+sys.x$statements_with_temp_tables OK
+sys.x$user_summary OK
+sys.x$user_summary_by_file_io OK
+sys.x$user_summary_by_file_io_type OK
+sys.x$user_summary_by_stages OK
+sys.x$user_summary_by_statement_latency OK
+sys.x$user_summary_by_statement_type OK
+sys.x$wait_classes_global_by_avg_latency OK
+sys.x$wait_classes_global_by_latency OK
+sys.x$waits_by_host_by_latency OK
+sys.x$waits_by_user_by_latency OK
+sys.x$waits_global_by_latency OK
+Phase 4/7: Running 'mysql_fix_privilege_tables'
+Phase 5/7: Fixing table and database names
+Phase 6/7: Checking and upgrading tables
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+sys
+sys.sys_config OK
+test
+Phase 7/7: Running 'FLUSH PRIVILEGES'
+OK
+#
+# check new definers of Add/DropGeometryColumn
+#
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'root@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'root@localhost';
+count(*)
+0
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+1
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+count(*)
+1
+#
+# restore environment
+#
+delete from proc;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
diff --git a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test
new file mode 100644
index 00000000000..5111fcdf4ea
--- /dev/null
+++ b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test
@@ -0,0 +1,66 @@
+--echo #
+--echo # The definer of Add/DropGeometryColumn procedures should be updated to mariadb.sys during upgrade
+--echo #
+
+--source include/mysql_upgrade_preparation.inc
+
+use mysql;
+
+create table save_proc like proc;
+insert into save_proc select * from proc;
+set @save_sql_mode= @@sql_mode;
+
+--echo #
+--echo # If the definer is root before the upgrade:
+--echo # Drop the procedures if exists and recreate with root definer
+--echo #
+DROP PROCEDURE IF EXISTS AddGeometryColumn;
+DROP PROCEDURE IF EXISTS DropGeometryColumn;
+
+DELIMITER |;
+
+CREATE DEFINER=`root`@`localhost` PROCEDURE AddGeometryColumn(catalog varchar(64), t_schema varchar(64),
+ t_name varchar(64), geometry_column varchar(64), t_srid int) SQL SECURITY INVOKER
+begin
+ set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' ADD ', geometry_column,' GEOMETRY REF_SYSTEM_ID=', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+
+CREATE DEFINER=`root`@`localhost` PROCEDURE DropGeometryColumn(catalog varchar(64), t_schema varchar(64),
+ t_name varchar(64), geometry_column varchar(64)) SQL SECURITY INVOKER
+begin
+ set @qwe= concat('ALTER TABLE ', t_schema, '.', t_name, ' DROP ', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end |
+
+DELIMITER ;|
+
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'root@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'root@localhost';
+
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+--echo #
+--echo # Run mysql_upgrade
+--echo #
+--exec $MYSQL_UPGRADE 2>&1
+--file_exists $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+
+--echo #
+--echo # check new definers of Add/DropGeometryColumn
+--echo #
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'root@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'root@localhost';
+
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='AddGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+SELECT count(*) FROM information_schema.ROUTINES WHERE ROUTINE_CATALOG = 'def' and ROUTINE_SCHEMA = 'mysql' and ROUTINE_NAME='DropGeometryColumn' and DEFINER = 'mariadb.sys@localhost';
+
+--echo #
+--echo # restore environment
+--echo #
+delete from proc;
+rename table proc to bad_proc;
+rename table save_proc to proc;
+drop table bad_proc;
+flush privileges;
+
diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
index 439b51d30ff..1a2c1cb1094 100755
--- a/mysql-test/mariadb-test-run.pl
+++ b/mysql-test/mariadb-test-run.pl
@@ -5028,6 +5028,7 @@ sub mysqld_start ($$) {
# Differs from "generic" MYSQLD_CMD by including all command line
# options from *.opt and *.combination files.
$ENV{'MYSQLD_LAST_CMD'}= "$exe @$args";
+ my $oldexe= $exe;
My::Debugger::setup_args(\$args, \$exe, $mysqld->name());
$ENV{'VALGRIND_TEST'}= $opt_valgrind = int(($exe || '') eq 'valgrind');
@@ -5083,7 +5084,8 @@ sub mysqld_start ($$) {
$mysqld->{'started_opts'}= $extra_opts;
my $expect_file= "$opt_vardir/tmp/".$mysqld->name().".expect";
- my $rc= sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
+ my $rc= $oldexe eq $exe ||
+ sleep_until_file_created($mysqld->value('pid-file'), $expect_file,
$opt_start_timeout, $mysqld->{'proc'}, $warn_seconds);
if (!$rc)
{
diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt
index 7fc0819a3b3..1bf727ddf2e 100644
--- a/plugin/auth_gssapi/CMakeLists.txt
+++ b/plugin/auth_gssapi/CMakeLists.txt
@@ -1,3 +1,9 @@
+
+SET(CPACK_RPM_gssapi-server_PACKAGE_SUMMARY "GSSAPI authentication plugin for MariaDB server" PARENT_SCOPE)
+SET(CPACK_RPM_gssapi-server_PACKAGE_DESCRIPTION "The gssapi authentication plugin allows the user to authenticate with services
+that use the Generic Security Services Application Program Interface (GSSAPI).
+The gssapi authentication plugin is most often used for authenticating with Microsoft Active Directory." PARENT_SCOPE)
+
IF (WIN32)
SET(USE_SSPI 1)
ENDIF()
diff --git a/plugin/cracklib_password_check/CMakeLists.txt b/plugin/cracklib_password_check/CMakeLists.txt
index 81db865eae0..620234ccd3f 100644
--- a/plugin/cracklib_password_check/CMakeLists.txt
+++ b/plugin/cracklib_password_check/CMakeLists.txt
@@ -1,6 +1,10 @@
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
+SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB" PARENT_SCOPE)
+SET(CPACK_RPM_cracklib-password-check_PACKAGE_DESCRIPTION "This password validation plugin uses cracklib to allow only
+sufficiently secure (as defined by cracklib) user passwords in MariaDB." PARENT_SCOPE)
+
CHECK_LIBRARY_EXISTS(crack FascistCheckUser "" HAVE_LIBCRACK)
SET(CMAKE_REQUIRED_DEFINITIONS -Dsize_t=int) # debian hack, debian bug.
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 79ac37695a2..f32002f996e 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -632,8 +632,7 @@ then
fi
echo
- echo "See the MariaDB Knowledgebase at https://mariadb.com/kb or the"
- echo "MySQL manual for more instructions."
+ echo "See the MariaDB Knowledgebase at https://mariadb.com/kb"
if test "$in_rpm" -eq 0
then
@@ -649,8 +648,7 @@ then
echo "Please report any problems at https://mariadb.org/jira"
echo
echo "The latest information about MariaDB is available at https://mariadb.org/."
- echo "You can find additional information about the MySQL part at:"
- echo "https://dev.mysql.com"
+ echo
echo "Consider joining MariaDB's strong and vibrant community:"
echo "https://mariadb.org/get-involved/"
echo
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index e4f0262e368..038d5384dda 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -541,6 +541,11 @@ ALTER TABLE proc MODIFY comment
ALTER TABLE proc ADD aggregate enum('NONE', 'GROUP') DEFAULT 'NONE' NOT NULL
AFTER body_utf8;
+# Update definer of Add/DropGeometryColumn procedures to 'mariadb.sys'
+# To consider the scenarios in MDEV-23102, only update the definer when it's 'root'
+UPDATE proc SET Definer = 'mariadb.sys@localhost' WHERE Definer = 'root@localhost' AND Name = 'AddGeometryColumn';
+UPDATE proc SET Definer = 'mariadb.sys@localhost' WHERE Definer = 'root@localhost' AND Name = 'DropGeometryColumn';
+
#
# EVENT privilege
#
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index 61f9f2542e9..19dbf93c7ce 100644
--- a/sql/mysql_upgrade_service.cc
+++ b/sql/mysql_upgrade_service.cc
@@ -366,8 +366,6 @@ static void get_service_config()
*/
static void change_service_config()
{
- char defaults_file[MAX_PATH];
- char default_character_set[64];
char buf[MAX_PATH];
char commandline[3 * MAX_PATH + 19];
int i;
@@ -390,22 +388,6 @@ static void change_service_config()
*/
WritePrivateProfileString("mysqld", "basedir",NULL, service_properties.inifile);
- /*
- Replace default-character-set with character-set-server, to avoid
- "default-character-set is deprecated and will be replaced ..."
- message.
- */
- default_character_set[0]= 0;
- GetPrivateProfileString("mysqld", "default-character-set", NULL,
- default_character_set, sizeof(default_character_set), defaults_file);
- if (default_character_set[0])
- {
- WritePrivateProfileString("mysqld", "default-character-set", NULL,
- defaults_file);
- WritePrivateProfileString("mysqld", "character-set-server",
- default_character_set, defaults_file);
- }
-
sprintf(defaults_file_param,"--defaults-file=%s", service_properties.inifile);
sprintf_s(commandline, "\"%s\" \"%s\" \"%s\"", mysqld_path,
defaults_file_param, opt_service);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 7c0879af8c9..6b7c4442204 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3654,7 +3654,7 @@ int select_max_min_finder_subselect::send_data(List<Item> &items)
if (!cache)
{
cache= val_item->get_cache(thd);
- switch (val_item->result_type()) {
+ switch (val_item->cmp_type()) {
case REAL_RESULT:
op= &select_max_min_finder_subselect::cmp_real;
break;
@@ -3667,8 +3667,13 @@ int select_max_min_finder_subselect::send_data(List<Item> &items)
case DECIMAL_RESULT:
op= &select_max_min_finder_subselect::cmp_decimal;
break;
- case ROW_RESULT:
case TIME_RESULT:
+ if (val_item->field_type() == MYSQL_TYPE_TIME)
+ op= &select_max_min_finder_subselect::cmp_time;
+ else
+ op= &select_max_min_finder_subselect::cmp_str;
+ break;
+ case ROW_RESULT:
// This case should never be chosen
DBUG_ASSERT(0);
op= 0;
@@ -3713,6 +3718,23 @@ bool select_max_min_finder_subselect::cmp_int()
return (val1 < val2);
}
+bool select_max_min_finder_subselect::cmp_time()
+{
+ Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
+ THD *thd= current_thd;
+ auto val1= cache->val_time_packed(thd), val2= maxmin->val_time_packed(thd);
+
+ /* Ignore NULLs for ANY and keep them for ALL subqueries */
+ if (cache->null_value)
+ return (is_all && !maxmin->null_value) || (!is_all && maxmin->null_value);
+ if (maxmin->null_value)
+ return !is_all;
+
+ if (fmax)
+ return(val1 > val2);
+ return (val1 < val2);
+}
+
bool select_max_min_finder_subselect::cmp_decimal()
{
Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
@@ -3736,7 +3758,7 @@ bool select_max_min_finder_subselect::cmp_str()
but added for safety
*/
val1= cache->val_str(&buf1);
- val2= maxmin->val_str(&buf1);
+ val2= maxmin->val_str(&buf2);
/* Ignore NULLs for ANY and keep them for ALL subqueries */
if (cache->null_value)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 0f1dfdeb6f6..f5a0d6abc9e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -6682,6 +6682,7 @@ public:
bool cmp_int();
bool cmp_decimal();
bool cmp_str();
+ bool cmp_time();
};
/* EXISTS subselect interface class */
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index f0b9503df1c..3ef45de2e8e 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2258,10 +2258,7 @@ int Lex_input_stream::lex_one_token(YYSTYPE *yylval, THD *thd)
if (c == '-' || c == '+')
c= yyGet(); // Skip sign
if (!my_isdigit(cs, c))
- { // No digit after sign
- state= MY_LEX_CHAR;
- break;
- }
+ return ABORT_SYM; // No digit after sign
while (my_isdigit(cs, yyGet())) ;
yylval->lex_str= get_token(0, yyLength());
return(FLOAT_NUM);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a6c626aef92..f4c4f044be2 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2020, MariaDB
+ Copyright (c) 2010, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -4678,10 +4678,13 @@ create_like:
opt_create_select:
/* empty */ {}
- | opt_duplicate opt_as create_select_query_expression opt_versioning_option
- {
- Lex->create_info.add(DDL_options_st::OPT_CREATE_SELECT);
- }
+ | opt_duplicate opt_as create_select_query_expression
+ opt_versioning_option
+ {
+ Lex->create_info.add(DDL_options_st::OPT_CREATE_SELECT);
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
create_select_query_expression:
@@ -13569,7 +13572,10 @@ delete:
lex->first_select_lex()->order_list.empty();
}
delete_part2
- { }
+ {
+ if (Lex->check_cte_dependencies_and_resolve_references())
+ MYSQL_YYABORT;
+ }
;
opt_delete_system_time:
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index a6b30e1bbcd..f36cdcb3b00 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -17,6 +17,11 @@ IF(WITHOUT_DYNAMIC_PLUGINS OR WITH_NONE OR ("${PLUGIN_CONNECT}" STREQUAL "NO"))
RETURN()
ENDIF()
+SET(CPACK_RPM_connect-engine_PACKAGE_SUMMARY "Connect storage engine for MariaDB" PARENT_SCOPE)
+SET(CPACK_RPM_connect-engine_PACKAGE_DESCRIPTION "Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
+connections to ODBC tables and remote MySQL tables, as well as a number of
+other interesting features." PARENT_SCOPE)
+
SET(CONNECT_PLUGIN_STATIC "connect")
SET(CONNECT_PLUGIN_DYNAMIC "connect")
diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt
index a41b864d15b..e725f9712ea 100644
--- a/storage/oqgraph/CMakeLists.txt
+++ b/storage/oqgraph/CMakeLists.txt
@@ -1,5 +1,12 @@
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+SET(CPACK_RPM_oqgraph-engine_PACKAGE_SUMMARY "OQGraph storage engine for MariaDB" PARENT_SCOPE)
+SET(CPACK_RPM_oqgraph-engine_PACKAGE_DESCRIPTION "The Open Query GRAPH computation engine, or OQGRAPH as the engine itself is called,
+allows you to handle hierarchies (tree structures) and complex graphs
+(nodes having many connections in several directions).
+It is intended to be used for retrieving hierarchical information, such as those used for graphs,
+routes or social relationships, in plain SQL." PARENT_SCOPE)
+
MACRO(CHECK_OQGRAPH)
MESSAGE(STATUS "Configuring OQGraph")
FIND_PACKAGE(Boost 1.40.0)
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 9fd9a5d7808..5ce500d8c65 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -1,5 +1,9 @@
# TODO: Copyrights
+SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB" PARENT_SCOPE)
+SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed
+at maximising storage efficiency while maintaining InnoDB-like performance." PARENT_SCOPE)
+
MACRO(SKIP_ROCKSDB_PLUGIN msg)
MESSAGE_ONCE(SKIP_ROCKSDB_PLUGIN "Can't build rocksdb engine - ${msg}")
ADD_FEATURE_INFO(ROCKSDB "OFF" "Storage Engine")