2860 Sergey Glukhov 2008-10-09 [merge]
5.1->6.0 bugteam tree merge
modified:
mysql-test/r/information_schema.result
mysql-test/t/information_schema.test
sql/sql_show.cc
2859 Georgi Kodinov 2008-10-08 [merge]
merged bug 32124 to 6.0-bugteam
modified:
mysql-test/extra/rpl_tests/rpl_insert_id.test
mysql-test/r/innodb_data_home_dir_basic.result
mysql-test/r/innodb_flush_method_basic.result
mysql-test/r/partition_not_windows.result
mysql-test/r/partition_symlink.result
mysql-test/r/partition_windows.result
mysql-test/r/ps_11bugs.result
mysql-test/r/ssl_capath_basic.result
mysql-test/r/ssl_cipher_basic.result
mysql-test/r/symlink.result
mysql-test/r/variables.result
mysql-test/r/windows.result
mysql-test/suite/rpl/r/rpl_insert_id.result
mysql-test/t/ps_11bugs.test
sql/item.cc
sql/item.h
sql/item_func.cc
sql/item_func.h
sql/mysqld.cc
sql/partition_info.cc
sql/set_var.cc
sql/set_var.h
sql/share/errmsg.txt
sql/sql_error.cc
sql/sql_parse.cc
sql/sql_plugin.cc
sql/sql_table.cc
tests/mysql_client_test.c
=== modified file 'mysql-test/r/information_schema.result'
--- a/mysql-test/r/information_schema.result 2008-09-29 06:50:26 +0000
+++ b/mysql-test/r/information_schema.result 2008-10-09 08:06:31 +0000
@@ -1583,6 +1583,15 @@ drop table t1;
drop function f1;
select * from information_schema.tables where 1=sleep(100000);
select * from information_schema.columns where 1=sleep(100000);
+explain select count(*) from information_schema.tables;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
+explain select count(*) from information_schema.columns;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE columns ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
+explain select count(*) from information_schema.views;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE views ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
End of 5.1 tests.
create function f1 (p1 int, p2 datetime, p3 decimal(10,2))
returns char(10) return null;
=== modified file 'mysql-test/t/information_schema.test'
--- a/mysql-test/t/information_schema.test 2008-06-30 08:43:39 +0000
+++ b/mysql-test/t/information_schema.test 2008-10-09 08:06:31 +0000
@@ -1310,6 +1310,14 @@ where state='User sleep' and
info='select * from information_schema.columns where 1=sleep(100000)';
--source include/wait_condition.inc
+
+#
+# Bug#38918 selecting from information_schema.columns is disproportionately slow
+#
+explain select count(*) from information_schema.tables;
+explain select count(*) from information_schema.columns;
+explain select count(*) from information_schema.views;
+
--echo End of 5.1 tests.
#
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2008-10-02 11:16:48 +0000
+++ b/sql/sql_show.cc 2008-10-09 08:06:31 +0000
@@ -2962,7 +2962,7 @@ static int fill_schema_table_names(THD *
@retval SKIP_OPEN_TABLE | OPEN_FRM_ONLY | OPEN_FULL_TABLE
*/
-static uint get_table_open_method(TABLE_LIST *tables,
+uint get_table_open_method(TABLE_LIST *tables,
ST_SCHEMA_TABLE *schema_table,
enum enum_schema_tables schema_table_idx)
{
@@ -2973,12 +2973,22 @@ static uint get_table_open_method(TABLE_
{
Field **ptr, *field;
int table_open_method= 0, field_indx= 0;
+ uint star_table_open_method= OPEN_FULL_TABLE;
+ bool used_star= true; // true if '*' is used in select
for (ptr=tables->table->field; (field= *ptr) ; ptr++)
{
+ star_table_open_method=
+ min(star_table_open_method,
+ schema_table->fields_info[field_indx].open_method);
if (bitmap_is_set(tables->table->read_set, field->field_index))
+ {
+ used_star= false;
table_open_method|= schema_table->fields_info[field_indx].open_method;
+ }
field_indx++;
}
+ if (used_star)
+ return star_table_open_method;
return table_open_method;
}
/* I_S tables which use get_all_tables but can not be optimized */
| Thread |
|---|
| • bzr push into mysql-6.0 branch (Sergey.Glukhov:2859 to 2860) | Sergey Glukhov | 9 Oct |