List:Commits« Previous MessageNext Message »
From:Norvald H. Ryeng Date:May 23 2012 11:41am
Subject:bzr push into mysql-trunk branch (norvald.ryeng:3881 to 3883) WL#6311
View as plain text  
 3883 Norvald H. Ryeng	2012-05-23 [merge]
      WL#6311 Remove --safe-mode
      
      Null merge 5.5->trunk

 3882 Norvald H. Ryeng	2012-05-23
      WL#6311 Remove --safe-mode
      
      Remove the --safe-mode command line option. An error message about an
      invalid command line option will be printed if mysqld is started with
      this option.
      
      Also removes the SPECIAL_SAFE_MODE flag and all tests for it.

    modified:
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      sql/mysqld.cc
      sql/mysqld.h
      sql/records.cc
      sql/sql_admin.cc
      sql/sql_delete.cc
      sql/sql_insert.cc
      sql/sql_optimizer.cc
      sql/unireg.h
      storage/myisam/ha_myisam.cc
      storage/myisammrg/ha_myisammrg.cc
 3881 Marko Mäkelä	2012-05-23
      Fix errors after WL#5522 merge.

    modified:
      .bzr-mysql/default.conf
      storage/innobase/btr/btr0btr.cc
      storage/innobase/page/page0page.cc
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result	2012-05-09 16:53:03 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result	2012-05-23 11:20:06 +0000
@@ -733,7 +733,6 @@ The following options may be given as th
  not sure, leave this option unset
  --report-user=name  The account user name of the slave to be reported to the
  master during slave registration
- --safe-mode         Skip some optimize stages (for testing).
  --safe-user-create  Don't allow new user creation by the user who has no
  write privileges to the mysql.user table.
  --secure-auth       Disallow authentication for accounts that have old

=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	2012-05-09 16:53:03 +0000
+++ b/mysql-test/r/mysqld--help-win.result	2012-05-23 11:20:06 +0000
@@ -733,7 +733,6 @@ The following options may be given as th
  not sure, leave this option unset
  --report-user=name  The account user name of the slave to be reported to the
  master during slave registration
- --safe-mode         Skip some optimize stages (for testing).
  --safe-user-create  Don't allow new user creation by the user who has no
  write privileges to the mysql.user table.
  --secure-auth       Disallow authentication for accounts that have old

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-05-18 15:21:06 +0000
+++ b/sql/mysqld.cc	2012-05-23 11:20:06 +0000
@@ -6689,8 +6689,6 @@ struct my_option my_long_options[]=
    "will not do updates to tables in databases that start with foo and whose "
    "table names start with bar.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).",
-   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"safe-user-create", 0,
    "Don't allow new user creation by the user who has no write privileges to the mysql.user table.",
    &opt_safe_user_create, &opt_safe_user_create, 0, GET_BOOL,
@@ -7982,12 +7980,6 @@ mysqld_get_one_option(int optid,
     query_cache_size=0;
 #endif
     break;
-  case (int) OPT_SAFE:
-    opt_specialflag|= SPECIAL_SAFE_MODE;
-    delay_key_write_options= DELAY_KEY_WRITE_NONE;
-    myisam_recover_options= HA_RECOVER_DEFAULT;
-    ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE);
-    break;
   case (int) OPT_SKIP_HOST_CACHE:
     opt_specialflag|= SPECIAL_NO_HOST_CACHE;
     break;

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2012-05-04 10:00:43 +0000
+++ b/sql/mysqld.h	2012-05-23 10:37:22 +0000
@@ -576,7 +576,6 @@ enum options_mysqld
   OPT_REPLICATE_REWRITE_DB,
   OPT_REPLICATE_WILD_DO_TABLE,
   OPT_REPLICATE_WILD_IGNORE_TABLE,
-  OPT_SAFE,
   OPT_SERVER_ID,
   OPT_SKIP_HOST_CACHE,
   OPT_SKIP_LOCK,

=== modified file 'sql/records.cc'
--- a/sql/records.cc	2012-03-06 14:29:42 +0000
+++ b/sql/records.cc	2012-05-23 10:37:22 +0000
@@ -246,7 +246,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_admin.cc'
--- a/sql/sql_admin.cc	2012-03-21 15:59:46 +0000
+++ b/sql/sql_admin.cc	2012-05-23 10:37:22 +0000
@@ -1069,7 +1069,7 @@ bool Sql_cmd_optimize_table::execute(THD
                          FALSE, UINT_MAX, FALSE))
     goto error; /* purecov: inspected */
   thd->enable_slow_log= opt_log_slow_admin_statements;
-  res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
+  res= (specialflag & SPECIAL_NO_NEW_FUNC) ?
     mysql_recreate_table(thd, first_table) :
     mysql_admin_table(thd, first_table, &thd->lex->check_opt,
                       "optimize", TL_WRITE, 1, 0, 0, 0,

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2012-04-25 12:30:33 +0000
+++ b/sql/sql_delete.cc	2012-05-23 10:37:22 +0000
@@ -128,8 +128,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     handler::delete_all_rows() method.
 
     We can use delete_all_rows() if and only if:
-    - We allow new functions (not using option --skip-new), and are
-      not in safe mode (not using option --safe-mode)
+    - We allow new functions (not using option --skip-new)
     - There is no limit clause
     - The condition is constant
     - If there is a condition, then it it produces a non-zero value
@@ -138,7 +137,7 @@ 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)) &&
+      !(specialflag & SPECIAL_NO_NEW_FUNC) &&
        (!thd->is_current_stmt_binlog_format_row() &&
         !(table->triggers && table->triggers->has_delete_triggers())))
   {

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2012-04-30 09:05:12 +0000
+++ b/sql/sql_insert.cc	2012-05-23 10:37:22 +0000
@@ -397,8 +397,8 @@ void upgrade_lock_type(THD *thd, thr_loc
   {
     /*
       We do not use delayed threads if:
-      - we're running in the safe mode or skip-new mode -- the
-        feature is disabled in these modes
+      - we're running in skip-new mode -- the feature is disabled
+        in this mode
       - we're executing this statement on a replication slave --
         we need to ensure serial execution of queries on the
         slave
@@ -418,7 +418,7 @@ void upgrade_lock_type(THD *thd, thr_loc
         client connection and the delayed thread.
       - we're running the EXPLAIN INSERT command
     */
-    if (specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE) ||
+    if (specialflag & SPECIAL_NO_NEW_FUNC ||
         thd->variables.max_insert_delayed_threads == 0 ||
         thd->locked_tables_mode > LTM_LOCK_TABLES ||
         thd->lex->uses_stored_routines() || thd->lex->describe)

=== modified file 'sql/sql_optimizer.cc'
--- a/sql/sql_optimizer.cc	2012-05-23 05:02:04 +0000
+++ b/sql/sql_optimizer.cc	2012-05-23 10:37:22 +0000
@@ -7787,8 +7787,6 @@ static bool
 only_eq_ref_tables(JOIN *join, ORDER *order, table_map tables,
                    table_map *cached_eq_ref_tables, table_map *eq_ref_tables)
 {
-  if (specialflag &  SPECIAL_SAFE_MODE)
-    return false;               // skip this optimize /* purecov: inspected */
   tables&= ~PSEUDO_TABLE_BITS;
   for (JOIN_TAB **tab=join->map2table ; tables ; tab++, tables>>=1)
   {

=== modified file 'sql/unireg.h'
--- a/sql/unireg.h	2012-03-08 14:22:07 +0000
+++ b/sql/unireg.h	2012-05-23 10:37:22 +0000
@@ -71,7 +71,7 @@ typedef struct st_ha_create_information
 #define SPECIAL_BIG_SELECTS	256		/* Don't use heap tables */
 #define SPECIAL_NO_HOST_CACHE	512		/* Don't cache hosts */
 #define SPECIAL_SHORT_LOG_FORMAT 1024
-#define SPECIAL_SAFE_MODE	2048
+/* 2048 is no longer used */
 #define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
 
 	/* Extern defines */

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2012-04-19 07:02:54 +0000
+++ b/storage/myisam/ha_myisam.cc	2012-05-23 10:37:22 +0000
@@ -1490,25 +1490,22 @@ void ha_myisam::start_bulk_insert(ha_row
   can_enable_indexes= mi_is_all_keys_active(file->s->state.key_map,
                                             file->s->base.keys);
 
-  if (!(specialflag & SPECIAL_SAFE_MODE))
-  {
-    /*
-      Only disable old index if the table was empty and we are inserting
-      a lot of rows.
-      Note that in end_bulk_insert() we may truncate the table if
-      enable_indexes() failed, thus it's essential that indexes are
-      disabled ONLY for an empty table.
-    */
-    if (file->state->records == 0 && can_enable_indexes &&
-        (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
-      mi_disable_non_unique_index(file,rows);
-    else
+  /*
+    Only disable old index if the table was empty and we are inserting
+    a lot of rows.
+    Note that in end_bulk_insert() we may truncate the table if
+    enable_indexes() failed, thus it's essential that indexes are
+    disabled ONLY for an empty table.
+  */
+  if (file->state->records == 0 && can_enable_indexes &&
+      (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
+    mi_disable_non_unique_index(file,rows);
+  else
     if (!file->bulk_insert &&
         (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
     {
       mi_init_bulk_insert(file, thd->variables.bulk_insert_buff_size, rows);
     }
-  }
   DBUG_VOID_RETURN;
 }
 
@@ -1870,8 +1867,6 @@ int ha_myisam::info(uint flag)
 
 int ha_myisam::extra(enum ha_extra_function operation)
 {
-  if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_KEYREAD)
-    return 0;
   if (operation == HA_EXTRA_MMAP && !opt_myisam_use_mmap)
     return 0;
   return mi_extra(file, operation, 0);
@@ -1891,8 +1886,6 @@ int ha_myisam::reset(void)
 
 int ha_myisam::extra_opt(enum ha_extra_function operation, ulong cache_size)
 {
-  if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE)
-    return 0;
   return mi_extra(file, operation, (void*) &cache_size);
 }
 

=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc	2012-03-08 14:22:07 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc	2012-05-23 10:37:22 +0000
@@ -1399,8 +1399,6 @@ int ha_myisammrg::reset(void)
 int ha_myisammrg::extra_opt(enum ha_extra_function operation, ulong cache_size)
 {
   DBUG_ASSERT(this->file->children_attached);
-  if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_WRITE_CACHE)
-    return 0;
   return myrg_extra(file, operation, (void*) &cache_size);
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (norvald.ryeng:3881 to 3883) WL#6311Norvald H. Ryeng23 May