List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:June 11 2008 11:17pm
Subject:bzr commit into mysql-6.0 branch (sergefp:2650) Bug#37120
View as plain text  
#At file:///home/psergey/dev/mysql-6.0-smallfixes/

 2650 Sergey Petrunia	2008-06-12
      BUG#37120: optimizer_switch allowable values not according to specification
      - Use the correct length of "no_materialization" string in optimizer_switch_names_len.
        It was 19 instead of 18 which caused \0 to be included which caused the string representation
        of @@optimizer_switch to be truncated.
modified:
  mysql-test/r/subselect_sj.result
  mysql-test/t/subselect_sj.test
  sql/mysqld.cc

per-file comments:
  mysql-test/r/subselect_sj.result
    BUG#37120: optimizer_switch allowable values not according to specification
    - Testcase
  mysql-test/t/subselect_sj.test
    BUG#37120: optimizer_switch allowable values not according to specification
    - Testcase
  sql/mysqld.cc
    BUG#37120: optimizer_switch allowable values not according to specification
    - Use the correct length of "no_materialization" string in optimizer_switch_names_len
=== modified file 'mysql-test/r/subselect_sj.result'
--- a/mysql-test/r/subselect_sj.result	2008-05-01 03:53:36 +0000
+++ b/mysql-test/r/subselect_sj.result	2008-06-11 23:16:53 +0000
@@ -197,5 +197,44 @@ id	select_type	table	type	possible_keys	
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	103	100.00	Using where; Using join buffer
 Warnings:
 Note	1003	select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t10`.`pk`) and (`test`.`t10`.`pk` < 3))
+
+BUG#37120 optimizer_switch allowable values not according to specification
+
+select @@optimizer_switch;
+@@optimizer_switch
+
+set optimizer_switch='no_materialization';
+select @@optimizer_switch;
+@@optimizer_switch
+no_materialization
+set optimizer_switch='no_semijoin';
+select @@optimizer_switch;
+@@optimizer_switch
+no_semijoin
+set optimizer_switch='no_loosescan';
+select @@optimizer_switch;
+@@optimizer_switch
+no_loosescan
+set optimizer_switch='no_semijoin,no_materialization';
+select @@optimizer_switch;
+@@optimizer_switch
+no_materialization,no_semijoin
+set optimizer_switch='no_materialization,no_semijoin';
+select @@optimizer_switch;
+@@optimizer_switch
+no_materialization,no_semijoin
+set optimizer_switch='no_semijoin,no_materialization,no_loosescan';
+select @@optimizer_switch;
+@@optimizer_switch
+no_materialization,no_semijoin,no_loosescan
+set optimizer_switch='no_semijoin,no_loosescan';
+select @@optimizer_switch;
+@@optimizer_switch
+no_semijoin,no_loosescan
+set optimizer_switch='no_materialization,no_loosescan';
+select @@optimizer_switch;
+@@optimizer_switch
+no_materialization,no_loosescan
+set optimizer_switch='';
 drop table t0, t1;
 drop table t10, t11, t12;

=== modified file 'mysql-test/t/subselect_sj.test'
--- a/mysql-test/t/subselect_sj.test	2008-05-01 03:53:36 +0000
+++ b/mysql-test/t/subselect_sj.test	2008-06-11 23:16:53 +0000
@@ -92,5 +92,36 @@ execute s1;
 insert into t1 select (A.a + 10 * B.a),1 from t0 A, t0 B;
 explain extended select * from t1 where a in (select pk from t10 where pk<3);
 
+--echo
+--echo BUG#37120 optimizer_switch allowable values not according to specification
+--echo
+
+select @@optimizer_switch; 
+
+set optimizer_switch='no_materialization';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_semijoin';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_loosescan';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_semijoin,no_materialization';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_materialization,no_semijoin';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_semijoin,no_materialization,no_loosescan';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_semijoin,no_loosescan';
+select @@optimizer_switch; 
+
+set optimizer_switch='no_materialization,no_loosescan';
+select @@optimizer_switch; 
+set optimizer_switch='';
+
 drop table t0, t1;
 drop table t10, t11, t12;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-05-31 07:14:57 +0000
+++ b/sql/mysqld.cc	2008-06-11 23:16:53 +0000
@@ -328,7 +328,7 @@ static const char *optimizer_switch_name
 /* Corresponding defines are named OPTIMIZER_SWITCH_XXX */
 static const unsigned int optimizer_switch_names_len[]=
 {
-  /*no_materialization*/          19,
+  /*no_materialization*/          18,
   /*no_semijoin*/                 11,
   /*no_loosescan*/                12,
 };

Thread
bzr commit into mysql-6.0 branch (sergefp:2650) Bug#37120Sergey Petrunia12 Jun