Commit d66e1119 authored by Sergei Petrunia's avatar Sergei Petrunia

Merge branch '10.2' of github.com:MariaDB/server into 10.2

parents dace5f9a b1620684
......@@ -74,7 +74,8 @@ Architecture: any
Section: libdevel
Provides: libmysqld-dev
Pre-Depends: ${misc:Pre-Depends}
Depends: libmariadbclient-dev (= ${binary:Version}),
Depends: libmariadbd19,
libmariadbclient-dev (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Breaks: libmysqld-dev
......@@ -87,6 +88,21 @@ Description: MariaDB embedded database, development files
.
This package includes the embedded server library development and header files.
Package: libmariadbd19
Architecture: any
Section: libs
Depends: ${misc:Depends}, ${shlibs:Depends}
Multi-Arch: same
Breaks: libmariadbd-dev (<< ${source:Version}), libmysqld-dev
Replaces: libmariadbd-dev (<< ${source:Version}), libmysqld-dev
Description: MariaDB embedded database, shared library
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MariaDB are speed, robustness and
ease of use.
.
This package includes a shared library for embedded MariaDB applications
Package: libmariadbclient-dev
Architecture: any
Section: libdevel
......
usr/bin/mysql_config
usr/include/mariadb
usr/include/mysql/*
usr/include/mysql/*.h
usr/include/mysql/psi/*.h
usr/lib/*/libmariadb.so
usr/lib/*/libmariadbclient.a
usr/lib/*/libmysqlservices.a
......
usr/lib/*/libmysqld.a
usr/lib/*/libmysqld.so
usr/bin/mariadb_config
usr/lib/*/libmysqld.so*
Subproject commit c8dd0899d484ad698ec2da5bc8e3d19ff8b623b9
Subproject commit 3837442cbc62c867198091b43dff40198fb6b762
......@@ -7167,3 +7167,98 @@ EXPLAIN
}
DROP VIEW v2,v3;
DROP TABLE t1,t2,t3;
#
# MDEV-11102: condition pushdown into materialized inner table
# of outer join is not applied as not being valid
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (1),(2);
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
SELECT * FROM t1 LEFT JOIN t2 ON a = b WHERE b IS NULL;
a b
0 NULL
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
a b
0 NULL
EXPLAIN FORMAT=JSON
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100
},
"table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
"key": "key0",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
"rows": 2,
"filtered": 100,
"attached_condition": "(trigcond(isnull(v2.b)) and trigcond(trigcond((t1.a is not null))))",
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 2,
"filtered": 100
}
}
}
}
}
}
DROP VIEW v2;
DROP TABLE t1,t2;
#
# MDEV-11103: pushdown condition with ANY subquery
#
CREATE TABLE t1 (i INT);
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1),(2);
EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 );
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "<nop>((v1.i <= 3))",
"materialized": {
"query_block": {
"select_id": 3,
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 2,
"filtered": 100,
"attached_condition": "<nop>((t1.i <= 3))"
}
}
}
}
}
}
Warnings:
Note 1249 Select 2 was reduced during optimization
SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 );
i
1
2
DROP VIEW v1;
DROP TABLE t1;
......@@ -988,3 +988,42 @@ SELECT * FROM t1 WHERE a IN (
DROP VIEW v2,v3;
DROP TABLE t1,t2,t3;
--echo #
--echo # MDEV-11102: condition pushdown into materialized inner table
--echo # of outer join is not applied as not being valid
--echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (1),(2);
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
SELECT * FROM t1 LEFT JOIN t2 ON a = b WHERE b IS NULL;
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
EXPLAIN FORMAT=JSON
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
DROP VIEW v2;
DROP TABLE t1,t2;
--echo #
--echo # MDEV-11103: pushdown condition with ANY subquery
--echo #
CREATE TABLE t1 (i INT);
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1),(2);
EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 );
SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 );
DROP VIEW v1;
DROP TABLE t1;
......@@ -649,6 +649,8 @@ class Item_func_nop_all :public Item_func_not_all
longlong val_int();
const char *func_name() const { return "<nop>"; }
Item *neg_transformer(THD *thd);
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_nop_all>(thd, mem_root, this); }
};
......
......@@ -3063,7 +3063,11 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround
ulong stmt_id= uint4korr(packet);
ulong flags= (ulong) packet[4];
#ifndef EMBEDDED_LIBRARY
ulong iterations= uint4korr(packet + 5);
#else
ulong iterations= 0; // no support
#endif
/* Query text for binary, general or slow log, if any of them is open */
String expanded_query;
uchar *packet_end= packet + packet_length;
......
......@@ -1277,10 +1277,21 @@ JOIN::optimize_inner()
List_iterator_fast<TABLE_LIST> li(select_lex->leaf_tables);
while ((tbl= li++))
{
/*
Do not push conditions from where into materialized inner tables
of outer joins: this is not valid.
*/
if (tbl->is_materialized_derived())
{
if (pushdown_cond_for_derived(thd, conds, tbl))
DBUG_RETURN(1);
/*
Do not push conditions from where into materialized inner tables
of outer joins: this is not valid.
*/
if (!tbl->is_inner_table_of_outer_join())
{
if (pushdown_cond_for_derived(thd, conds, tbl))
DBUG_RETURN(1);
}
if (mysql_handle_single_derived(thd->lex, tbl, DT_OPTIMIZE))
DBUG_RETURN(1);
}
......
......@@ -4,6 +4,7 @@ package My::Suite::Spider;
return "No Spider engine" unless $ENV{HA_SPIDER_SO};
return "Not run for embedded server" if $::opt_embedded_server;
return "Test needs --big-test" unless $::opt_big_test;
bless { };
......@@ -4,6 +4,7 @@ package My::Suite::Spider;
return "No Spider engine" unless $ENV{HA_SPIDER_SO};
return "Not run for embedded server" if $::opt_embedded_server;
return "Test needs --big-test" unless $::opt_big_test;
sub is_default { 1 }
......
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