Commit 6e9642be authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into 10.3

parents 8149e4d0 dfa2d0bc
if(JAVA_AWT_LIBRARY) if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH)
set(JNI_FOUND TRUE) set(JNI_FOUND TRUE)
return() return()
endif() endif()
......
etc/mysql/conf.d/connect.cnf etc/mysql/mariadb.conf.d etc/mysql/conf.d/connect.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_connect.so usr/lib/mysql/plugin/ha_connect.so
usr/share/mysql/Mongo2.jar
usr/share/mysql/Mongo3.jar
usr/share/mysql/JavaWrappers.jar
usr/share/mysql/JdbcInterface.jar
...@@ -10651,6 +10651,45 @@ m ...@@ -10651,6 +10651,45 @@ m
7 7
drop view v1; drop view v1;
drop table t1; drop table t1;
#
# MDEV-25635: pushdown into grouping view using aggregate functions
# with constant arguments via a mergeable derived table
#
create table t1 (a int);
insert into t1 values (3), (7), (1), (3), (7), (7), (3);
create view v1 as select a, sum(1) as f, sum(1) as g from t1 group by a;
select * from v1;
a f g
1 1 1
3 3 3
7 3 3
select * from (select * from v1) as dt where a=f and a=g;
a f g
1 1 1
3 3 3
explain extended select * from (select * from v1) as dt where a=f and a=g;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `v1`.`a` AS `a`,`v1`.`f` AS `f`,`v1`.`g` AS `g` from `test`.`v1` where `v1`.`a` = `v1`.`f` and `v1`.`a` = `v1`.`g`
create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
select * from v2;
a f g
1 1 1
3 1 1
7 1 1
select * from (select * from v2) as dt where a=f and a=g;
a f g
1 1 1
explain extended select * from (select * from v2) as dt where a=f and a=g;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 7 100.00 Using where
3 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using temporary; Using filesort
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;
# End of 10.2 tests # End of 10.2 tests
# #
# MDEV-14579: pushdown conditions into materialized views/derived tables # MDEV-14579: pushdown conditions into materialized views/derived tables
......
...@@ -2213,6 +2213,31 @@ select * from v1 where m > 0; ...@@ -2213,6 +2213,31 @@ select * from v1 where m > 0;
drop view v1; drop view v1;
drop table t1; drop table t1;
--echo #
--echo # MDEV-25635: pushdown into grouping view using aggregate functions
--echo # with constant arguments via a mergeable derived table
--echo #
create table t1 (a int);
insert into t1 values (3), (7), (1), (3), (7), (7), (3);
create view v1 as select a, sum(1) as f, sum(1) as g from t1 group by a;
select * from v1;
let $q1=
select * from (select * from v1) as dt where a=f and a=g;
eval $q1;
eval explain extended $q1;
create view v2 as select a, min(1) as f, min(1) as g from t1 group by a;
select * from v2;
let $q2=
select * from (select * from v2) as dt where a=f and a=g;
eval $q2;
eval explain extended $q2;
drop view v1,v2;
drop table t1;
--echo # End of 10.2 tests --echo # End of 10.2 tests
--echo # --echo #
......
drop table if exists t1;
set @OLD_SQL_MODE=@@SESSION.SQL_MODE; set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1)); create table t1 (a int, b int generated always as (a+1));
show create table t1; show create table t1;
...@@ -88,3 +87,13 @@ create table t1 (x int, y int default test2.t1.x); ...@@ -88,3 +87,13 @@ create table t1 (x int, y int default test2.t1.x);
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT' ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT'
create table t1 (x int, check (test2.t1.x > 0)); create table t1 (x int, check (test2.t1.x > 0));
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK' ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'CHECK'
#
# MDEV-25672 table alias from previous statement interferes later commands
#
create table t1 (a int, v_a int generated always as (a));
update t1 as x set a = 1;
alter table t1 force;
drop table t1;
#
# End of 10.2 tests
#
# #
# test syntax # test syntax
# #
--disable_warnings
drop table if exists t1;
--enable_warnings
set @OLD_SQL_MODE=@@SESSION.SQL_MODE; set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1)); create table t1 (a int, b int generated always as (a+1));
show create table t1; show create table t1;
...@@ -72,3 +68,16 @@ create table t1 (x int, y int check (y > test2.t1.x)); ...@@ -72,3 +68,16 @@ create table t1 (x int, y int check (y > test2.t1.x));
create table t1 (x int, y int default test2.t1.x); create table t1 (x int, y int default test2.t1.x);
--error ER_BAD_FIELD_ERROR --error ER_BAD_FIELD_ERROR
create table t1 (x int, check (test2.t1.x > 0)); create table t1 (x int, check (test2.t1.x > 0));
--echo #
--echo # MDEV-25672 table alias from previous statement interferes later commands
--echo #
create table t1 (a int, v_a int generated always as (a));
update t1 as x set a = 1;
alter table t1 force;
drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #
...@@ -3198,7 +3198,7 @@ class Item_field :public Item_ident, ...@@ -3198,7 +3198,7 @@ class Item_field :public Item_ident,
bool check_table_name_processor(void *arg) bool check_table_name_processor(void *arg)
{ {
Check_table_name_prm &p= *(Check_table_name_prm *) arg; Check_table_name_prm &p= *(Check_table_name_prm *) arg;
if (p.table_name.length && table_name) if (!field && p.table_name.length && table_name)
{ {
DBUG_ASSERT(p.db.length); DBUG_ASSERT(p.db.length);
if ((db_name && if ((db_name &&
...@@ -5383,7 +5383,10 @@ class Item_direct_view_ref :public Item_direct_ref ...@@ -5383,7 +5383,10 @@ class Item_direct_view_ref :public Item_direct_ref
table_map used_tables() const; table_map used_tables() const;
void update_used_tables(); void update_used_tables();
table_map not_null_tables() const; table_map not_null_tables() const;
bool const_item() const { return used_tables() == 0; } bool const_item() const
{
return (*ref)->const_item() && (null_ref_table == NO_NULL_TABLE);
}
TABLE *get_null_ref_table() const { return null_ref_table; } TABLE *get_null_ref_table() const { return null_ref_table; }
bool walk(Item_processor processor, bool walk_subquery, void *arg) bool walk(Item_processor processor, bool walk_subquery, void *arg)
{ {
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
IF(WITHOUT_DYNAMIC_PLUGINS OR WITH_NONE OR ("${PLUGIN_CONNECT}" STREQUAL "NO"))
RETURN()
ENDIF()
SET(CONNECT_PLUGIN_STATIC "connect") SET(CONNECT_PLUGIN_STATIC "connect")
SET(CONNECT_PLUGIN_DYNAMIC "connect") SET(CONNECT_PLUGIN_DYNAMIC "connect")
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2020, MariaDB Corporation. Copyright (c) 2015, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -806,13 +806,18 @@ buf_read_ibuf_merge_pages( ...@@ -806,13 +806,18 @@ buf_read_ibuf_merge_pages(
continue; continue;
} }
if (UNIV_UNLIKELY(page_nos[i] >= space->size)) { ulint size = space->size;
if (!size) {
size = fil_space_get_size(space->id);
}
if (UNIV_UNLIKELY(page_nos[i] >= size)) {
do { do {
ibuf_delete_recs(page_id_t(space_ids[i], ibuf_delete_recs(page_id_t(space_ids[i],
page_nos[i])); page_nos[i]));
} while (++i < n_stored } while (++i < n_stored
&& space_ids[i - 1] == space_ids[i] && space_ids[i - 1] == space_ids[i]
&& page_nos[i] >= space->size); && page_nos[i] >= size);
i--; i--;
next: next:
space->release(); space->release();
......
SET(HEIDISQL_BASE_NAME "HeidiSQL_11.2_32_Portable") SET(HEIDISQL_BASE_NAME "HeidiSQL_11.3_32_Portable")
SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip") SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}") SET(HEIDISQL_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME}) SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})
......
...@@ -367,7 +367,10 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename) ...@@ -367,7 +367,10 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
ErrorExit("Stdout SetHandleInformation"); ErrorExit("Stdout SetHandleInformation");
string commandline("mysql_upgrade_service.exe --service="); string commandline("mysql_upgrade_service.exe --service=");
commandline += "\"";
commandline += servicename; commandline += servicename;
commandline += "\"";
si.cb = sizeof(si); si.cb = sizeof(si);
si.hStdInput= GetStdHandle(STD_INPUT_HANDLE); si.hStdInput= GetStdHandle(STD_INPUT_HANDLE);
si.hStdOutput= hPipeWrite; si.hStdOutput= hPipeWrite;
...@@ -397,7 +400,7 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename) ...@@ -397,7 +400,7 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
else else
{ {
/* /*
Creating a process with CREATE_BREAKAWAY_FROM_JOB, reset this flag Creating a process with CREATE_BREAKAWAY_FROM_JOB failed, reset this flag
and retry. and retry.
*/ */
if (!CreateProcess(NULL, (LPSTR)commandline.c_str(), NULL, NULL, TRUE, if (!CreateProcess(NULL, (LPSTR)commandline.c_str(), NULL, NULL, TRUE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment