Commit 5bb97877 authored by Sergey Petrunya's avatar Sergey Petrunya

Merge

parents cfc2eb9d 64649e33
......@@ -1972,3 +1972,45 @@ drop database mysqltest;
#
# End of 5.5 tests
#
#
# MDEV-5723: mysqldump -uroot unusable for multi-database operations, checks all databases
#
drop database if exists db1;
create database db1;
use db1;
create table t1 (a int);
create table t2 (a int);
create table t3 (a int);
create database mysqltest;
use mysqltest;
create table t1 (a int);
create table t2 (a int);
create table t3 (a int);
flush tables;
flush status;
SELECT
LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA
FROM
INFORMATION_SCHEMA.FILES
WHERE
FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND
LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME
FROM INFORMATION_SCHEMA.FILES
WHERE
FILE_TYPE = 'DATAFILE' AND
TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME
FROM INFORMATION_SCHEMA.PARTITIONS
WHERE TABLE_SCHEMA IN ('db1')
)
)
GROUP BY
LOGFILE_GROUP_NAME, FILE_NAME, ENGINE
ORDER BY
LOGFILE_GROUP_NAME;
LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE EXTRA
# This must have Opened_tables=3, not 6.
show status like 'Opened_tables';
Variable_name Value
Opened_tables 3
drop database mysqltest;
drop database db1;
......@@ -1816,5 +1816,61 @@ drop database mysqltest;
--echo # End of 5.5 tests
--echo #
--echo #
--echo # MDEV-5723: mysqldump -uroot unusable for multi-database operations, checks all databases
--echo #
--disable_warnings
drop database if exists db1;
--enable_warnings
connect (con1,localhost,root,,);
connection con1;
create database db1;
use db1;
create table t1 (a int);
create table t2 (a int);
create table t3 (a int);
create database mysqltest;
use mysqltest;
create table t1 (a int);
create table t2 (a int);
create table t3 (a int);
flush tables;
flush status;
SELECT
LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA
FROM
INFORMATION_SCHEMA.FILES
WHERE
FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND
LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME
FROM INFORMATION_SCHEMA.FILES
WHERE
FILE_TYPE = 'DATAFILE' AND
TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME
FROM INFORMATION_SCHEMA.PARTITIONS
WHERE TABLE_SCHEMA IN ('db1')
)
)
GROUP BY
LOGFILE_GROUP_NAME, FILE_NAME, ENGINE
ORDER BY
LOGFILE_GROUP_NAME;
--echo # This must have Opened_tables=3, not 6.
show status like 'Opened_tables';
drop database mysqltest;
drop database db1;
connection default;
disconnect con1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
......@@ -19492,7 +19492,7 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx,
for (; const_key_parts & 1 ; const_key_parts>>= 1)
key_part++;
if (key_part == key_part_end)
if (key_part >= key_part_end)
{
/*
We are at the end of the key. Check if the engine has the primary
......
......@@ -8021,9 +8021,21 @@ static bool do_fill_table(THD *thd,
Warning_info *wi_saved= thd->warning_info;
thd->warning_info= &wi;
bool res= table_list->schema_table->fill_table(
thd, table_list, join_table->select_cond);
Item *item= join_table->select_cond;
if (join_table->cache_select &&
join_table->cache_select->cond)
{
/*
If join buffering is used, we should use the condition that is attached
to the join cache. Cache condition has a part of WHERE that can be
checked when we're populating this table.
join_tab->select_cond is of no interest, because it only has conditions
that depend on both this table and previous tables in the join order.
*/
item= join_table->cache_select->cond;
}
bool res= table_list->schema_table->fill_table(thd, table_list, item);
thd->warning_info= wi_saved;
......
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