Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Nov 29, 2021
2 parents 9962cda + f5441ef commit 289721d
Show file tree
Hide file tree
Showing 40 changed files with 897 additions and 99 deletions.
6 changes: 6 additions & 0 deletions cmake/Internal/CPack/CPackRPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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)

Expand Down
58 changes: 13 additions & 45 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,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")
Expand All @@ -80,51 +93,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}
Expand Down
3 changes: 1 addition & 2 deletions extra/mariabackup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@

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)
ADD_DEFINITIONS(-DHAVE_SYSTEM_REGEX)
ENDIF()
ENDIF()


INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/xbstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,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);

Expand Down
48 changes: 48 additions & 0 deletions mysql-test/main/cte_nonrecursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,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
Expand Down
46 changes: 46 additions & 0 deletions mysql-test/main/cte_nonrecursive.test
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,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 #
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/main/join.result
Original file line number Diff line number Diff line change
Expand Up @@ -3309,6 +3309,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
#
Expand Down Expand Up @@ -3395,3 +3398,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
6 changes: 6 additions & 0 deletions mysql-test/main/join.test
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,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 #
Expand Down Expand Up @@ -1813,3 +1818,4 @@ WHERE
drop table t1,t2,t3;
drop table t1000,t10,t03;

--echo # End of 10.3 tests
31 changes: 31 additions & 0 deletions mysql-test/main/parser.result
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,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);
Expand Down
46 changes: 46 additions & 0 deletions mysql-test/main/parser.test
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,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 #
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/main/type_date.result
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,18 @@ Warning 1292 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
#
#
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/main/type_date.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 289721d

Please sign in to comment.