Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.2 tree (sergefp:1.2539)

From: Sergey Petrunia <sergefp(at)mysql.com>
Date: Sat Jun 30 2007 - 17:52:56 EDT


Below is the list of changes that have just been committed into a local 5.2 repository of psergey. When psergey does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository.
For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@1.2539, 2007-07-01 01:52:49+04:00, sergefp@mysql.com +4 -0   Added @@optimizer_switch server variable

  sql/mysqld.cc@1.649, 2007-07-01 01:52:28+04:00, sergefp@mysql.com +19 -0     Added @@optimizer_switch server variable

  sql/set_var.cc@1.243, 2007-07-01 01:52:28+04:00, sergefp@mysql.com +54 -1     Added @@optimizer_switch server variable

  sql/set_var.h@1.110, 2007-07-01 01:52:28+04:00, sergefp@mysql.com +21 -1     Added @@optimizer_switch server variable

  sql/sql_class.h@1.371, 2007-07-01 01:52:28+04:00, sergefp@mysql.com +2 -0     Added @@optimizer_switch server variable

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	sergefp
# Host:	pylon.mylan
# Root:	/home/psergey/mysql-5.2-merge-11-subq-in

--- 1.648/sql/mysqld.cc	2007-07-01 01:52:56 +04:00

+++ 1.649/sql/mysqld.cc 2007-07-01 01:52:56 +04:00
@@ -263,6 +263,24 @@
 TYPELIB sql_mode_typelib= { array_elements(sql_mode_names)-1,"",
 			    sql_mode_names,
                             (unsigned int *)sql_mode_names_len };

+
+
+static const char *optimizer_switch_names[]=
+{
+ "no_materialization", "no_semijoin",
+ NullS
+};
+
+static const unsigned int optimizer_switch_names_len[]=
+{
+ /*no_materialization*/ 19,
+ /*no_semijoin*/ 11
+};
+
+TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"",
+ optimizer_switch_names,
+ (unsigned int *)optimizer_switch_names_len };
+

 static const char *tc_heuristic_recover_names[]=  {
   "COMMIT", "ROLLBACK", NullS
@@ -2910,6 +2928,7 @@

   global_system_variables.collation_connection= default_charset_info;  

   global_system_variables.optimizer_use_mrr= 1;
+ global_system_variables.optimizer_switch= 0;
 

Do you need help?X

   if (!(character_set_filesystem=

         get_charset_by_csname(character_set_filesystem_name,

  • 1.370/sql/sql_class.h 2007-07-01 01:52:56 +04:00
    +++ 1.371/sql/sql_class.h 2007-07-01 01:52:56 +04:00
    @@ -269,6 +269,8 @@ 2 - disable MRR. */ ulong optimizer_use_mrr;
    + /* A bitmap for switching optimizations on/off */
    + ulong optimizer_switch;
    ulong preload_buff_size; ulong query_cache_type; ulong read_buff_size;
  • 1.242/sql/set_var.cc 2007-07-01 01:52:56 +04:00
    +++ 1.243/sql/set_var.cc 2007-07-01 01:52:56 +04:00
    @@ -418,6 +418,8 @@ &SV::sortbuff_size); static sys_var_thd_sql_mode sys_sql_mode(&vars, "sql_mode", &SV::sql_mode);
    +static sys_var_thd_optimizer_switch sys_optimizer_switch(&vars, "optimizer_switch",
    + &SV::optimizer_switch);
    #ifdef HAVE_OPENSSL extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, *opt_ssl_key; @@ -689,7 +691,6 @@ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL}, #endif {"open_files_limit", (char*) &open_files_limit, SHOW_LONG}, - {sys_optimizer_use_mrr.name, (char*) &sys_optimizer_use_mrr, SHOW_SYS}, {"pid_file", (char*) pidfile_name, SHOW_CHAR}, {"plugin_dir", (char*) opt_plugin_dir, SHOW_CHAR}, {"port", (char*) &mysqld_port, SHOW_INT}, @@ -3428,6 +3429,58 @@ MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | MODE_ERROR_FOR_DIVISION_BY_ZERO | MODE_NO_AUTO_CREATE_USER); return sql_mode;
    +}
    +
    +
    +//psergey-todo: think if we can join this with thd_sql_mode one
    +
    +bool
    +sys_var_thd_optimizer_switch::
    +symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
    +{
    + char buff[STRING_BUFFER_USUAL_SIZE*8];
    + String tmp(buff, sizeof(buff), &my_charset_latin1);
    +
    + tmp.length(0);
    +
    + for (uint i= 0; val; val>>= 1, i++)
    + {
    + if (val & 1)
    + {
    + tmp.append(optimizer_switch_typelib.type_names[i],
    + optimizer_switch_typelib.type_lengths[i]);
    + tmp.append(',');
    + }
    + }
    +
    + if (tmp.length())
    + tmp.length(tmp.length() - 1); /* trim the trailing comma */
    +
    + rep->str= thd->strmake(tmp.ptr(), tmp.length());
    +
    + rep->length= rep->str ? tmp.length() : 0;
    +
    + return rep->length != tmp.length();
    +}
    +
    +
    +uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
    + LEX_STRING *base)
    +{
    + LEX_STRING opts;
    + ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
    + thd->variables.*offset);
    + (void) symbolic_mode_representation(thd, val, &opts);
    + return (uchar *) opts.str;
    +}
    +
    +
    +void sys_var_thd_optimizer_switch::set_default(THD *thd, enum_var_type type)
    +{
    + if (type == OPT_GLOBAL)
    + global_system_variables.*offset= 0;
    + else
    + thd->variables.*offset= global_system_variables.*offset;
    }
  • 1.109/sql/set_var.h 2007-07-01 01:52:56 +04:00
    +++ 1.110/sql/set_var.h 2007-07-01 01:52:56 +04:00
    @@ -30,7 +30,8 @@ typedef struct system_variables SV; typedef struct my_locale_st MY_LOCALE;

-extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib;
+extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib,
+ optimizer_switch_typelib;
 

 typedef int (*sys_check_func)(THD *, set_var *);  typedef bool (*sys_update_func)(THD *, set_var *); @@ -448,6 +449,25 @@

   SHOW_TYPE show_type() { return SHOW_CHAR; }    uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);    bool check_update_type(Item_result type) { return 0; }
+};
+
+
+
+class sys_var_thd_optimizer_switch :public sys_var_thd_enum
+{
+public:
+ sys_var_thd_optimizer_switch(sys_var_chain *chain, const char *name_arg,
+ ulong SV::*offset_arg)
+ :sys_var_thd_enum(chain, name_arg, offset_arg, &optimizer_switch_typelib)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return check_set(thd, var, enum_names);
+ }
+ void set_default(THD *thd, enum_var_type type);
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode,
+ LEX_STRING *rep);
 };    

-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Sat Jun 30 17:52:44 2007

This archive was generated by hypermail 2.1.8 : Sat Jun 30 2007 - 18:00:03 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library