[Commits] Rev 3952: Fixed bug mdev-5415. in file:///home/igor/maria/maria-10.0-base/

Igor Babaev igor at askmonty.org
Sun Dec 15 05:13:38 EET 2013


At file:///home/igor/maria/maria-10.0-base/

------------------------------------------------------------
revno: 3952
revision-id: igor at askmonty.org-20131215031337-bsq85q3cmn1t6g8r
parent: knielsen at knielsen-hq.org-20131129144609-00rjbrdr24zmcecm
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-10.0-base
timestamp: Sat 2013-12-14 19:13:37 -0800
message:
  Fixed bug mdev-5415.
  Do not calculate selectivity of conditions for the tables of the information schema.
-------------- next part --------------
=== modified file 'mysql-test/r/selectivity.result'
--- a/mysql-test/r/selectivity.result	2013-11-26 23:04:21 +0000
+++ b/mysql-test/r/selectivity.result	2013-12-15 03:13:37 +0000
@@ -1158,3 +1158,11 @@
 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
 DROP TABLE t1,t2,t3;
 set use_stat_tables=@save_use_stat_tables;
+#
+# Bug mdev-5415: query over an information schema table   
+#                when optimizer_use_condition_selectivity=3
+#
+set optimizer_use_condition_selectivity = 3;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != '';
+TRIGGER_CATALOG	TRIGGER_SCHEMA	TRIGGER_NAME	EVENT_MANIPULATION	EVENT_OBJECT_CATALOG	EVENT_OBJECT_SCHEMA	EVENT_OBJECT_TABLE	ACTION_ORDER	ACTION_CONDITION	ACTION_STATEMENT	ACTION_ORIENTATION	ACTION_TIMING	ACTION_REFERENCE_OLD_TABLE	ACTION_REFERENCE_NEW_TABLE	ACTION_REFERENCE_OLD_ROW	ACTION_REFERENCE_NEW_ROW	CREATED	SQL_MODE	DEFINER	CHARACTER_SET_CLIENT	COLLATION_CONNECTION	DATABASE_COLLATION
+set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;

=== modified file 'mysql-test/r/selectivity_innodb.result'
--- a/mysql-test/r/selectivity_innodb.result	2013-11-26 23:04:21 +0000
+++ b/mysql-test/r/selectivity_innodb.result	2013-12-15 03:13:37 +0000
@@ -1166,5 +1166,13 @@
 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
 DROP TABLE t1,t2,t3;
 set use_stat_tables=@save_use_stat_tables;
+#
+# Bug mdev-5415: query over an information schema table   
+#                when optimizer_use_condition_selectivity=3
+#
+set optimizer_use_condition_selectivity = 3;
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != '';
+TRIGGER_CATALOG	TRIGGER_SCHEMA	TRIGGER_NAME	EVENT_MANIPULATION	EVENT_OBJECT_CATALOG	EVENT_OBJECT_SCHEMA	EVENT_OBJECT_TABLE	ACTION_ORDER	ACTION_CONDITION	ACTION_STATEMENT	ACTION_ORIENTATION	ACTION_TIMING	ACTION_REFERENCE_OLD_TABLE	ACTION_REFERENCE_NEW_TABLE	ACTION_REFERENCE_OLD_ROW	ACTION_REFERENCE_NEW_ROW	CREATED	SQL_MODE	DEFINER	CHARACTER_SET_CLIENT	COLLATION_CONNECTION	DATABASE_COLLATION
+set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
 set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
 SET SESSION STORAGE_ENGINE=DEFAULT;

=== modified file 'mysql-test/t/selectivity.test'
--- a/mysql-test/t/selectivity.test	2013-11-26 23:04:21 +0000
+++ b/mysql-test/t/selectivity.test	2013-12-15 03:13:37 +0000
@@ -739,3 +739,14 @@
 
 set use_stat_tables=@save_use_stat_tables;
 
+--echo #
+--echo # Bug mdev-5415: query over an information schema table   
+--echo #                when optimizer_use_condition_selectivity=3
+--echo #
+
+set optimizer_use_condition_selectivity = 3;
+
+SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != '';
+
+set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2013-11-22 23:50:54 +0000
+++ b/sql/opt_range.cc	2013-12-15 03:13:37 +0000
@@ -3410,6 +3410,9 @@
 
   if (table_records == 0)
     DBUG_RETURN(FALSE);
+
+  if (table->pos_in_table_list->schema_table)
+    DBUG_RETURN(FALSE);
   
   if (thd->variables.optimizer_use_condition_selectivity > 2 &&
       !bitmap_is_clear_all(used_fields))



More information about the commits mailing list