Skip to content

Commit

Permalink
Merge 10.3 into 10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 21, 2021
2 parents 031f117 + 75c01f3 commit a0588d5
Show file tree
Hide file tree
Showing 33 changed files with 675 additions and 127 deletions.
1 change: 1 addition & 0 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ IF(UNIX)
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
set(THREADS_PREFER_PTHREAD_FLAG ON)
FIND_PACKAGE(Threads)

SET(CMAKE_REQUIRED_LIBRARIES
Expand Down
2 changes: 1 addition & 1 deletion extra/my_print_defaults.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void usage()
{
version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
puts("Displays the options from option groups of option files, which is useful to see which options a particular tool will use");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
my_print_help(my_long_options);
my_print_default_files(config_file);
Expand Down
2 changes: 1 addition & 1 deletion libmariadb
21 changes: 19 additions & 2 deletions man/mysqlbinlog.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLBINLOG\FR" "1" "28 March 2019" "MariaDB 10\&.4" "MariaDB Database System"
.TH "\FBMYSQLBINLOG\FR" "1" "14 April 2021" "MariaDB 10\&.4" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -1091,6 +1091,23 @@ This option is useful for point\-in\-time recovery\&.
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlbinlog: table option
.\" table option: mysqlbinlog
\fB\-\-table\fR,
\fB\-T\fR
.sp
List entries for just this table (local log only)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

.\" mysqlbinlog: to-last-log option
.\" to-last-log option: mysqlbinlog
\fB\-\-to\-last\-log\fR,
Expand Down Expand Up @@ -2107,7 +2124,7 @@ option can be used to prevent this header from being written\&.
.SH "COPYRIGHT"
.br
.PP
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2015 MariaDB Foundation
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2021 MariaDB Foundation
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
Expand Down
17 changes: 17 additions & 0 deletions mysql-test/main/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -2529,6 +2529,23 @@ ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
ERROR HY000: Function or expression 'select ...' cannot be used in the DEFAULT clause of `k1`
DROP TABLE t1,t2;
#
# MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
#
create table t1(t int, d date not null);
insert into t1 values (1,'2001-1-1');
set sql_mode = "no_zero_date";
alter table t1 change d d date not null after t, add i int;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t` int(11) DEFAULT NULL,
`d` date NOT NULL,
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add x date not null;
ERROR 22007: Incorrect date value: '0000-00-00' for column `test`.`t1`.`x` at row 1
drop table t1;
#
# End of 10.2 tests
#
#
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/main/alter_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,18 @@ CREATE TABLE t2 (i1 int);
ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1);
DROP TABLE t1,t2;

--echo #
--echo # MDEV-25403 ALTER TABLE wrongly checks for field's default value if AFTER is used
--echo #
create table t1(t int, d date not null);
insert into t1 values (1,'2001-1-1');
set sql_mode = "no_zero_date";
alter table t1 change d d date not null after t, add i int;
show create table t1;
--error ER_TRUNCATED_WRONG_VALUE
alter table t1 add x date not null;
drop table t1;

--echo #
--echo # End of 10.2 tests
--echo #
Expand Down
103 changes: 72 additions & 31 deletions mysql-test/main/join_outer.result
Original file line number Diff line number Diff line change
Expand Up @@ -2687,6 +2687,77 @@ id timestamp modifiedBy id REV REVTYPE profile_id id REV person_id id REV
DROP TABLE t1,t2,t3,t4;
# end of 10.1 tests
#
# MDEV-25362: name resolution for subqueries in ON expressions
#
create table t1 (a int, b int);
create table t2 (c int, d int);
create table t3 (e int, f int);
create table t4 (g int, h int);
explain
select *
from
t1 left join
(t2
join
t3 on
(t3.f=t1.a)
) on (t2.c=t1.a );
ERROR 42S22: Unknown column 't1.a' in 'on clause'
explain
select *
from
t1 left join
(t2
join
t3 on
(t3.f=(select max(g) from t4 where t4.h=t1.a))
) on (t2.c=t1.a );
ERROR 42S22: Unknown column 't1.a' in 'where clause'
drop table t1,t2,t3,t4;
create table t1 (a int);
insert into t1 values (1),(2);
create table t2 (b int);
insert into t2 values (1),(2);
create table t3 (c int);
insert into t3 values (1),(2);
select * from ( select * from t1 left join t2
on b in (select x from t3 as sq1)
) as sq2;
ERROR 42S22: Unknown column 'x' in 'field list'
drop table t1,t2,t3;
# end of 10.2 tests
#
# MDEV-22866: Crash in join optimizer with constant outer join nest
#
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 TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t4 VALUES (5),(6);
CREATE TABLE t5 (e INT) ENGINE=MyISAM;
INSERT INTO t5 VALUES (7),(8);
CREATE TABLE t6 (f INT) ENGINE=MyISAM;
INSERT INTO t6 VALUES (9),(10);
SELECT *
FROM
t1
LEFT JOIN (
t2 LEFT JOIN (
t3 JOIN
t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
) ON t2.b >= t4.d
) ON t1.a <= t2.b
LEFT JOIN t5 ON t2.b = t5.e
LEFT JOIN t6 ON t3.c = t6.f;
a b c d e f
1 3 NULL NULL NULL NULL
1 4 NULL NULL NULL NULL
2 3 NULL NULL NULL NULL
2 4 NULL NULL NULL NULL
drop table t1,t2,t3,t4,t5,t6;
#
# MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
#
create table t1(a int);
Expand Down Expand Up @@ -2754,35 +2825,5 @@ WHERE t3.pk IN (2);
1
drop view v4;
drop table t1,t2,t3,t4;
# end of 10.3 tests
SET optimizer_switch=@org_optimizer_switch;
#
# MDEV-22866: Crash in join optimizer with constant outer join nest
#
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 TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;
CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t4 VALUES (5),(6);
CREATE TABLE t5 (e INT) ENGINE=MyISAM;
INSERT INTO t5 VALUES (7),(8);
CREATE TABLE t6 (f INT) ENGINE=MyISAM;
INSERT INTO t6 VALUES (9),(10);
SELECT *
FROM
t1
LEFT JOIN (
t2 LEFT JOIN (
t3 JOIN
t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
) ON t2.b >= t4.d
) ON t1.a <= t2.b
LEFT JOIN t5 ON t2.b = t5.e
LEFT JOIN t6 ON t3.c = t6.f;
a b c d e f
1 3 NULL NULL NULL NULL
2 3 NULL NULL NULL NULL
1 4 NULL NULL NULL NULL
2 4 NULL NULL NULL NULL
drop table t1,t2,t3,t4,t5,t6;
122 changes: 87 additions & 35 deletions mysql-test/main/join_outer.test
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,91 @@ DROP TABLE t1,t2,t3,t4;

--echo # end of 10.1 tests

--echo #
--echo # MDEV-25362: name resolution for subqueries in ON expressions
--echo #

create table t1 (a int, b int);
create table t2 (c int, d int);
create table t3 (e int, f int);
create table t4 (g int, h int);

--error ER_BAD_FIELD_ERROR
explain
select *
from
t1 left join
(t2
join
t3 on
(t3.f=t1.a)
) on (t2.c=t1.a );

# This must produce an error:
--error ER_BAD_FIELD_ERROR
explain
select *
from
t1 left join
(t2
join
t3 on
(t3.f=(select max(g) from t4 where t4.h=t1.a))
) on (t2.c=t1.a );

drop table t1,t2,t3,t4;

create table t1 (a int);
insert into t1 values (1),(2);
create table t2 (b int);
insert into t2 values (1),(2);
create table t3 (c int);
insert into t3 values (1),(2);

--error ER_BAD_FIELD_ERROR
select * from ( select * from t1 left join t2
on b in (select x from t3 as sq1)
) as sq2;

drop table t1,t2,t3;

--echo # end of 10.2 tests

--echo #
--echo # MDEV-22866: Crash in join optimizer with constant outer join nest
--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 TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;

CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t4 VALUES (5),(6);

CREATE TABLE t5 (e INT) ENGINE=MyISAM;
INSERT INTO t5 VALUES (7),(8);

CREATE TABLE t6 (f INT) ENGINE=MyISAM;
INSERT INTO t6 VALUES (9),(10);

SELECT *
FROM
t1
LEFT JOIN (
t2 LEFT JOIN (
t3 JOIN
t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
) ON t2.b >= t4.d
) ON t1.a <= t2.b
LEFT JOIN t5 ON t2.b = t5.e
LEFT JOIN t6 ON t3.c = t6.f;

drop table t1,t2,t3,t4,t5,t6;

--echo #
--echo # MDEV-17518: Range optimization doesn't use ON expressions from nested outer joins
--echo #
Expand Down Expand Up @@ -2251,39 +2336,6 @@ WHERE t3.pk IN (2);
drop view v4;
drop table t1,t2,t3,t4;

SET optimizer_switch=@org_optimizer_switch;

--echo #
--echo # MDEV-22866: Crash in join optimizer with constant outer join nest
--echo #

CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
--echo # end of 10.3 tests

CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3),(4);

CREATE TABLE t3 (c INT, KEY(c)) ENGINE=MyISAM;

CREATE TABLE t4 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t4 VALUES (5),(6);

CREATE TABLE t5 (e INT) ENGINE=MyISAM;
INSERT INTO t5 VALUES (7),(8);

CREATE TABLE t6 (f INT) ENGINE=MyISAM;
INSERT INTO t6 VALUES (9),(10);

SELECT *
FROM
t1
LEFT JOIN (
t2 LEFT JOIN (
t3 JOIN
t4 ON t3.c = t4.d and t3.c >2 and t3.c<0
) ON t2.b >= t4.d
) ON t1.a <= t2.b
LEFT JOIN t5 ON t2.b = t5.e
LEFT JOIN t6 ON t3.c = t6.f;

drop table t1,t2,t3,t4,t5,t6;
SET optimizer_switch=@org_optimizer_switch;
Loading

0 comments on commit a0588d5

Please sign in to comment.