[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (monty:2850)

Michael Widenius monty at askmonty.org
Thu Sep 23 19:30:47 EEST 2010


#At lp:maria/5.2 based on revid:monty at askmonty.org-20100826132027-p1m3gvi5f6yfcgdv

 2850 Michael Widenius	2010-09-23
      Fix usage of mysqld option --new, --old, --safe and --skip_new to not disable things that are proven stable or enable things that are not usefull.
      modified:
        sql/field.cc
        sql/item_cmpfunc.cc
        sql/mysqld.cc
        sql/records.cc
        sql/sql_delete.cc
        sql/sql_parse.cc
        sql/sql_select.cc
        sql/sql_yacc.yy

per-file messages:
  sql/field.cc
    Remove feature of 'new_mode' that was never implemtented in a newer MySQL version.
  sql/item_cmpfunc.cc
    Boyer more is stable; Don't have to be protected by --skip-new anymore
  sql/mysqld.cc
    Don't disable some proven stable functions with --skip-new
  sql/records.cc
    Don't disable record caching with --safe-mode anymore
  sql/sql_delete.cc
    Do fast truncate even if --skip-new or --safe is used
  sql/sql_parse.cc
    Use always mysql_optimizer() for optimizer (instead of mysql_recreate_table() in case of --safe or --skip-new)
  sql/sql_select.cc
    Don't disable 'only_eq_ref_tables' if --safe is used.
  sql/sql_yacc.yy
    Removed not meaningfull test of --old
=== modified file 'sql/field.cc'
--- a/sql/field.cc	2010-08-05 19:56:11 +0000
+++ b/sql/field.cc	2010-09-23 16:30:44 +0000
@@ -6703,8 +6703,7 @@ void Field_string::sql_type(String &res)
 
   length= cs->cset->snprintf(cs,(char*) res.ptr(),
                              res.alloced_length(), "%s(%d)",
-                             ((type() == MYSQL_TYPE_VAR_STRING &&
-                               !thd->variables.new_mode) ?
+                             (type() == MYSQL_TYPE_VAR_STRING ?
                               (has_charset() ? "varchar" : "varbinary") :
 			      (has_charset() ? "char" : "binary")),
                              (int) field_length / charset()->mbmaxlen);

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2010-08-05 19:56:11 +0000
+++ b/sql/item_cmpfunc.cc	2010-09-23 16:30:44 +0000
@@ -4683,8 +4683,7 @@ bool Item_func_like::fix_fields(THD *thd
       We could also do boyer-more for non-const items, but as we would have to
       recompute the tables for each row it's not worth it.
     */
-    if (args[1]->const_item() && !use_strnxfrm(collation.collation) &&
-       !(specialflag & SPECIAL_NO_NEW_FUNC))
+    if (args[1]->const_item() && !use_strnxfrm(collation.collation))
     {
       String* res2 = args[1]->val_str(&cmp.value2);
       if (!res2)

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-08-24 22:44:50 +0000
+++ b/sql/mysqld.cc	2010-09-23 16:30:44 +0000
@@ -8725,11 +8725,7 @@ mysqld_get_one_option(int optid,
   case (int) OPT_SKIP_NEW:
     opt_specialflag|= SPECIAL_NO_NEW_FUNC;
     delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE;
-    myisam_concurrent_insert=0;
-    myisam_recover_options= HA_RECOVER_NONE;
-    sp_automatic_privileges=0;
-    my_use_symdir=0;
-    ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE);
+    ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE);
 #ifdef HAVE_QUERY_CACHE
     query_cache_size=0;
 #endif

=== modified file 'sql/records.cc'
--- a/sql/records.cc	2010-07-17 19:58:08 +0000
+++ b/sql/records.cc	2010-09-23 16:30:44 +0000
@@ -216,7 +216,6 @@ bool init_read_record(READ_RECORD *info,
     */
     if (!disable_rr_cache &&
         !table->sort.addon_field &&
-        ! (specialflag & SPECIAL_SAFE_MODE) &&
 	thd->variables.read_rnd_buff_size &&
 	!(table->file->ha_table_flags() & HA_FAST_KEY_READ) &&
 	(table->db_stat & HA_READ_ONLY ||

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2010-08-05 19:56:11 +0000
+++ b/sql/sql_delete.cc	2010-09-23 16:30:44 +0000
@@ -130,7 +130,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *
       - there should be no delete triggers associated with the table.
   */
   if (!using_limit && const_cond_result &&
-      !(specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) &&
       (thd->lex->sql_command == SQLCOM_TRUNCATE ||
        (!thd->current_stmt_binlog_row_based &&
         !(table->triggers && table->triggers->has_delete_triggers()))))

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-08-05 19:56:11 +0000
+++ b/sql/sql_parse.cc	2010-09-23 16:30:44 +0000
@@ -3086,9 +3086,7 @@ end_with_restore_list:
       goto error; /* purecov: inspected */
     thd->enable_slow_log= opt_log_slow_admin_statements;
     thd->query_plan_flags|= QPLAN_ADMIN;
-    res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
-      mysql_recreate_table(thd, first_table) :
-      mysql_optimize_table(thd, first_table, &lex->check_opt);
+    res= mysql_optimize_table(thd, first_table, &lex->check_opt);
     /* ! we write after unlocking the table */
     if (!res && !lex->no_write_to_binlog)
     {

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-08-24 22:44:50 +0000
+++ b/sql/sql_select.cc	2010-09-23 16:30:44 +0000
@@ -7187,8 +7187,6 @@ eq_ref_table(JOIN *join, ORDER *start_or
 static bool
 only_eq_ref_tables(JOIN *join,ORDER *order,table_map tables)
 {
-  if (specialflag &  SPECIAL_SAFE_MODE)
-    return 0;			// skip this optimize /* purecov: inspected */
   tables&= ~PSEUDO_TABLE_BITS;
   for (JOIN_TAB **tab=join->map2table ; tables ; tab++, tables>>=1)
   {

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-08-05 19:56:11 +0000
+++ b/sql/sql_yacc.yy	2010-09-23 16:30:44 +0000
@@ -6757,8 +6757,6 @@ cache_keys_spec:
           {
             Lex->select_lex.alloc_index_hints(YYTHD);
             Select->set_index_hint_type(INDEX_HINT_USE, 
-                                        global_system_variables.old_mode ? 
-                                        INDEX_HINT_MASK_JOIN : 
                                         INDEX_HINT_MASK_ALL);
           }
           cache_key_list_or_empty



More information about the commits mailing list