Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d66e1119
Commit
d66e1119
authored
Nov 18, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.2' of github.com:MariaDB/server into 10.2
parents
dace5f9a
b1620684
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
177 additions
and
7 deletions
+177
-7
debian/control
debian/control
+17
-1
debian/libmariadbclient-dev.install
debian/libmariadbclient-dev.install
+2
-1
debian/libmariadbd-dev.install
debian/libmariadbd-dev.install
+1
-1
debian/libmariadbd18.install
debian/libmariadbd18.install
+0
-1
debian/libmariadbd19.install
debian/libmariadbd19.install
+1
-0
libmariadb
libmariadb
+1
-1
mysql-test/r/derived_cond_pushdown.result
mysql-test/r/derived_cond_pushdown.result
+95
-0
mysql-test/t/derived_cond_pushdown.test
mysql-test/t/derived_cond_pushdown.test
+39
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+2
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-0
sql/sql_select.cc
sql/sql_select.cc
+13
-2
storage/spider/mysql-test/spider/bg/suite.pm
storage/spider/mysql-test/spider/bg/suite.pm
+1
-0
storage/spider/mysql-test/spider/suite.pm
storage/spider/mysql-test/spider/suite.pm
+1
-0
No files found.
debian/control
View file @
d66e1119
...
...
@@ -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
...
...
debian/libmariadbclient-dev.install
View file @
d66e1119
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
...
...
debian/libmariadbd-dev.install
View file @
d66e1119
usr
/
lib
/*/
libmysqld
.
a
usr/
lib/*/
libmysqld
.
so
usr
/
bin
/
mariadb_config
debian/libmariadbd18.install
deleted
100644 → 0
View file @
dace5f9a
usr
/
lib
/*/
libmysqld
.
so
.
18
debian/libmariadbd19.install
0 → 100644
View file @
d66e1119
usr
/
lib
/*/
libmysqld
.
so
*
libmariadb
@
3837442c
Subproject commit
c8dd0899d484ad698ec2da5bc8e3d19ff8b623b9
Subproject commit
3837442cbc62c867198091b43dff40198fb6b762
mysql-test/r/derived_cond_pushdown.result
View file @
d66e1119
...
...
@@ -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;
mysql-test/t/derived_cond_pushdown.test
View file @
d66e1119
...
...
@@ -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
;
sql/item_cmpfunc.h
View file @
d66e1119
...
...
@@ -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
);
}
};
...
...
sql/sql_prepare.cc
View file @
d66e1119
...
...
@@ -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
;
...
...
sql/sql_select.cc
View file @
d66e1119
...
...
@@ -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
);
}
...
...
storage/spider/mysql-test/spider/bg/suite.pm
View file @
d66e1119
...
...
@@ -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
{
};
storage/spider/mysql-test/spider/suite.pm
View file @
d66e1119
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment