[Commits] Rev 3981: Merge in file:///home/psergey/dev2/10.0-base-cp2/

Sergey Petrunya psergey at askmonty.org
Tue Mar 4 23:57:58 EET 2014


At file:///home/psergey/dev2/10.0-base-cp2/

------------------------------------------------------------
revno: 3981 [merge]
revision-id: psergey at askmonty.org-20140304215757-9bmdz6pmvb33w8le
parent: knielsen at knielsen-hq.org-20140304133709-r7npbuz96l4qjx18
parent: psergey at askmonty.org-20140304111440-b491uoz3jy60nr26
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 10.0-base-cp2
timestamp: Wed 2014-03-05 01:57:57 +0400
message:
  Merge
modified:
  mysql-test/r/information_schema.result sp1f-information_schema.r-20041113105544-waoxa2fjjsicturpothmjmi6jc3yrovn
  mysql-test/t/information_schema.test sp1f-information_schema.t-20041113105545-lgutyhqnhpfgiswiwj2ykmjnolmsfq5h
  sql/sql_select.cc              sp1f-sql_select.cc-19700101030959-egb7whpkh76zzvikycs5nsnuviu4fdlb
  sql/sql_show.cc                sp1f-sql_show.cc-19700101030959-umlljfnpplg452h7reeyqr4xnbmlkvfj
=== modified file 'mysql-test/r/information_schema.result'
--- a/mysql-test/r/information_schema.result	2013-11-03 15:31:52 +0000
+++ b/mysql-test/r/information_schema.result	2014-03-04 11:14:40 +0000
@@ -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;

=== modified file 'mysql-test/t/information_schema.test'
--- a/mysql-test/t/information_schema.test	2013-08-30 09:25:49 +0000
+++ b/mysql-test/t/information_schema.test	2014-03-04 11:14:40 +0000
@@ -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
+

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2014-02-25 15:04:35 +0000
+++ b/sql/sql_select.cc	2014-03-03 20:41:50 +0000
@@ -19492,7 +19492,7 @@ static int test_if_order_by_key(ORDER *o
     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

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2014-02-25 15:04:35 +0000
+++ b/sql/sql_show.cc	2014-03-04 11:14:40 +0000
@@ -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;
 



More information about the commits mailing list