Skip to content

Commit

Permalink
Merge branch '10.9' into 10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed May 3, 2023
2 parents e02a2f4 + cf56f2d commit 13a294a
Show file tree
Hide file tree
Showing 370 changed files with 2,089 additions and 825 deletions.
4 changes: 2 additions & 2 deletions debian/autobake-deb.sh
Expand Up @@ -68,8 +68,8 @@ add_lsb_base_depends()
replace_uring_with_aio()
{
sed 's/liburing-dev/libaio-dev/g' -i debian/control
sed -e '/-DIGNORE_AIO_CHECK=YES/d' \
-e '/-DWITH_URING=YES/d' -i debian/rules
sed -e '/-DIGNORE_AIO_CHECK=ON/d' \
-e '/-DWITH_URING=ON/d' -i debian/rules
}

disable_pmem()
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2022, Oracle and/or its affiliates
/* Copyright (c) 2011, 2023, Oracle and/or its affiliates
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_mdl.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_memory.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2012, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_ps.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_socket.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_sp.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_statement.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_table.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
Copyright (c) 2020, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/mysql_transaction.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi_abi_v0.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2011, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi_abi_v1.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi_abi_v2.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi_base.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion include/mysql/psi/psi_memory.h
@@ -1,4 +1,4 @@
/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
/* Copyright (c) 2013, 2023, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
68 changes: 68 additions & 0 deletions mysql-test/main/derived_view.result
Expand Up @@ -4247,3 +4247,71 @@ deallocate prepare stmt;
drop view v;
drop table t1,t2,t3;
# End of 10.4 tests
#
# MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
#
create table t1 (id int primary key);
insert into t1 values (3), (7), (1);
create table t2 (a int);
insert into t2 values (2), (4);
create view v as select a from t2 order by a;
set big_tables= 1;
Warnings:
Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
select t1.id from v, t1 where rownum() = 1 group by t1.id;
id
1
set big_tables=default;
Warnings:
Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
drop view v;
drop table t1, t2;
#
# MDEV-31162: multi-table mergeable view with ORDER BY used
# in query with rownum() in WHERE
#
create table t1 (a INT) engine=MyISAM;
insert into t1 values (1),(2);
create table t2 (b INT) engine=MyISAM;
insert into t2 values (3),(4);
create view v1 AS select * from t1 join t2 order by b;
explain select * from v1 where rownum() <= 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
select * from v1 where rownum() <= 2;
a b
1 3
2 3
prepare stmt from "select * from v1 where rownum() <= 2";
execute stmt;
a b
1 3
2 3
execute stmt;
a b
1 3
2 3
deallocate prepare stmt;
create view v2 AS select * from t1 join t2 order by b/a;
explain select * from v2 where rownum() <= 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
select * from v2 where rownum() <= 2;
a b
2 3
1 3
prepare stmt from "select * from v2 where rownum() <= 2";
execute stmt;
a b
2 3
1 3
execute stmt;
a b
2 3
1 3
deallocate prepare stmt;
drop view v1,v2;
drop table t1,t2;
# End of 10.6 tests
62 changes: 62 additions & 0 deletions mysql-test/main/derived_view.test
Expand Up @@ -2752,3 +2752,65 @@ drop view v;
drop table t1,t2,t3;

--echo # End of 10.4 tests

--echo #
--echo # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE
--echo #

create table t1 (id int primary key);
insert into t1 values (3), (7), (1);

create table t2 (a int);
insert into t2 values (2), (4);

create view v as select a from t2 order by a;

set big_tables= 1;
select t1.id from v, t1 where rownum() = 1 group by t1.id;

set big_tables=default;

drop view v;
drop table t1, t2;

--echo #
--echo # MDEV-31162: multi-table mergeable view with ORDER BY used
--echo # in query with rownum() in WHERE
--echo #

create table t1 (a INT) engine=MyISAM;
insert into t1 values (1),(2);

create table t2 (b INT) engine=MyISAM;
insert into t2 values (3),(4);

create view v1 AS select * from t1 join t2 order by b;
let $q1=
select * from v1 where rownum() <= 2;

eval explain $q1;
--sorted_result
eval $q1;

eval prepare stmt from "$q1";
--sorted_result
execute stmt;
--sorted_result
execute stmt;
deallocate prepare stmt;

create view v2 AS select * from t1 join t2 order by b/a;
let $q2=
select * from v2 where rownum() <= 2;

eval explain $q2;
eval $q2;
eval prepare stmt from "$q2";
execute stmt;
execute stmt;
deallocate prepare stmt;

drop view v1,v2;
drop table t1,t2;

--echo # End of 10.6 tests
14 changes: 14 additions & 0 deletions mysql-test/main/distinct.result
Expand Up @@ -1093,6 +1093,7 @@ sum(distinct 1) sum(t1.d) > 5 c
1 1 0
1 0 5
1 1 6
SET @sort_buffer_size_save= @@sort_buffer_size;
set @@sort_buffer_size=1024;
insert into t1 select -seq,-seq from seq_1_to_100;
select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ;
Expand All @@ -1106,6 +1107,19 @@ sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 c
1 1 0 5
1 1 0 6
drop table t1;
set @@sort_buffer_size=@sort_buffer_size_save;
#
# MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key
# with DISTINCT and group function
#
CREATE TABLE t (f INT);
INSERT INTO t VALUES (1),(2);
SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP;
f1 f2
0.0000 #
0.0000 #
0.5000 #
DROP TABLE t;
# End of 10.4 tests
#
# MDEV-27382: OFFSET is ignored when it is combined with the DISTINCT, IN() and JOIN
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/main/distinct.test
Expand Up @@ -834,11 +834,24 @@ select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c
select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c;

# Force usage of remove_dup_with_compare() algorithm
SET @sort_buffer_size_save= @@sort_buffer_size;
set @@sort_buffer_size=1024;
insert into t1 select -seq,-seq from seq_1_to_100;
select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ;
select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2;
drop table t1;
set @@sort_buffer_size=@sort_buffer_size_save;

--echo #
--echo # MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key
--echo # with DISTINCT and group function
--echo #

CREATE TABLE t (f INT);
INSERT INTO t VALUES (1),(2);
--replace_column 2 #
SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP;
DROP TABLE t;

--echo # End of 10.4 tests

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/insert_innodb.result
Expand Up @@ -51,7 +51,7 @@ CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNI
ERROR HY000: Field 'v1' doesn't have a default value
CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb
REPLACE SELECT NULL AS a;
ERROR HY000: Field 'DB_ROW_HASH_1' doesn't have a default value
ERROR 23000: CONSTRAINT `t1.i` failed for `test`.`t1`
#
# End of 10.5 tests
#
2 changes: 1 addition & 1 deletion mysql-test/main/insert_innodb.test
Expand Up @@ -71,7 +71,7 @@ DROP TABLE t2, t1;
--error ER_NO_DEFAULT_FOR_FIELD
CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNIQUE CHECK ( v1 ) ) REPLACE SELECT NULL AS v3 , 74 AS v2 ;

--error ER_NO_DEFAULT_FOR_FIELD
--error ER_CONSTRAINT_FAILED
CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb
REPLACE SELECT NULL AS a;

Expand Down

0 comments on commit 13a294a

Please sign in to comment.