summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 14:33:07 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-08 14:33:07 +0300
commit6e9642beb2cafecbcb96e591e1b4466b877d4885 (patch)
tree39aa60527982a3a91946c9c6e0608992a309f178
parent8149e4d0a139b901c8902b5b9fae371cef47275f (diff)
parentdfa2d0bc13362b949b1b1699955583f74e7db90a (diff)
downloadmariadb-git-6e9642beb2cafecbcb96e591e1b4466b877d4885.tar.gz
Merge 10.2 into 10.3
-rw-r--r--cmake/FindJNI.cmake2
-rw-r--r--debian/mariadb-plugin-connect.install4
-rw-r--r--mysql-test/main/derived_cond_pushdown.result39
-rw-r--r--mysql-test/main/derived_cond_pushdown.test25
-rw-r--r--mysql-test/suite/vcol/r/vcol_syntax.result11
-rw-r--r--mysql-test/suite/vcol/t/vcol_syntax.test17
-rw-r--r--sql/item.h7
-rw-r--r--storage/connect/CMakeLists.txt4
-rw-r--r--storage/innobase/buf/buf0rea.cc11
-rw-r--r--win/packaging/heidisql.cmake2
-rw-r--r--win/upgrade_wizard/upgradeDlg.cpp5
11 files changed, 110 insertions, 17 deletions
diff --git a/cmake/FindJNI.cmake b/cmake/FindJNI.cmake
index 12305d7c86d..b2c6f849c87 100644
--- a/cmake/FindJNI.cmake
+++ b/cmake/FindJNI.cmake
@@ -1,4 +1,4 @@
-if(JAVA_AWT_LIBRARY)
+if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH)
set(JNI_FOUND TRUE)
return()
endif()
diff --git a/debian/mariadb-plugin-connect.install b/debian/mariadb-plugin-connect.install
index 71849a200a8..22d73c7df05 100644
--- a/debian/mariadb-plugin-connect.install
+++ b/debian/mariadb-plugin-connect.install
@@ -1,6 +1,2 @@
etc/mysql/conf.d/connect.cnf etc/mysql/mariadb.conf.d
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
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 5fc01112642..6e84a83fd24 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -10651,6 +10651,45 @@ m
7
drop view v1;
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
#
# MDEV-14579: pushdown conditions into materialized views/derived tables
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 5936447fc88..244ec1453a8 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2213,6 +2213,31 @@ select * from v1 where m > 0;
drop view v1;
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 #
diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result
index c8983f34c93..0063f38ea36 100644
--- a/mysql-test/suite/vcol/r/vcol_syntax.result
+++ b/mysql-test/suite/vcol/r/vcol_syntax.result
@@ -1,4 +1,3 @@
-drop table if exists t1;
set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1));
show create table t1;
@@ -88,3 +87,13 @@ create table t1 (x int, y int default test2.t1.x);
ERROR 42S22: Unknown column '`test2`.`t1`.`x`' in 'DEFAULT'
create table t1 (x int, check (test2.t1.x > 0));
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
+#
diff --git a/mysql-test/suite/vcol/t/vcol_syntax.test b/mysql-test/suite/vcol/t/vcol_syntax.test
index f425b52ab79..3c8a50a7f36 100644
--- a/mysql-test/suite/vcol/t/vcol_syntax.test
+++ b/mysql-test/suite/vcol/t/vcol_syntax.test
@@ -1,10 +1,6 @@
#
# test syntax
#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
create table t1 (a int, b int generated always as (a+1));
show create table t1;
@@ -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);
--error ER_BAD_FIELD_ERROR
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 #
diff --git a/sql/item.h b/sql/item.h
index a9598ca29c6..a0c7fe4ee55 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -3198,7 +3198,7 @@ public:
bool check_table_name_processor(void *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);
if ((db_name &&
@@ -5383,7 +5383,10 @@ public:
table_map used_tables() const;
void update_used_tables();
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; }
bool walk(Item_processor processor, bool walk_subquery, void *arg)
{
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index 52d6c0aebb0..f83bb1b57ce 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -13,6 +13,10 @@
# along with this program; if not, write to the Free Software
# 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_DYNAMIC "connect")
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 9e3daa5e40e..b0eb56972fc 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
@@ -806,13 +806,18 @@ tablespace_deleted:
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 {
ibuf_delete_recs(page_id_t(space_ids[i],
page_nos[i]));
} while (++i < n_stored
&& space_ids[i - 1] == space_ids[i]
- && page_nos[i] >= space->size);
+ && page_nos[i] >= size);
i--;
next:
space->release();
diff --git a/win/packaging/heidisql.cmake b/win/packaging/heidisql.cmake
index fab86048adb..b406e918b8f 100644
--- a/win/packaging/heidisql.cmake
+++ b/win/packaging/heidisql.cmake
@@ -1,4 +1,4 @@
-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_URL "http://www.heidisql.com/downloads/releases/${HEIDISQL_ZIP}")
SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})
diff --git a/win/upgrade_wizard/upgradeDlg.cpp b/win/upgrade_wizard/upgradeDlg.cpp
index 793e89886d6..a1b6c279fa6 100644
--- a/win/upgrade_wizard/upgradeDlg.cpp
+++ b/win/upgrade_wizard/upgradeDlg.cpp
@@ -367,7 +367,10 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
ErrorExit("Stdout SetHandleInformation");
string commandline("mysql_upgrade_service.exe --service=");
+ commandline += "\"";
commandline += servicename;
+ commandline += "\"";
+
si.cb = sizeof(si);
si.hStdInput= GetStdHandle(STD_INPUT_HANDLE);
si.hStdOutput= hPipeWrite;
@@ -397,7 +400,7 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename)
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.
*/
if (!CreateProcess(NULL, (LPSTR)commandline.c_str(), NULL, NULL, TRUE,