diff options
author | Michael Widenius <monty@askmonty.org> | 2010-09-23 19:30:44 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-09-23 19:30:44 +0300 |
commit | 5ce4825b63997f6db76a12b0f764d175734699fb (patch) | |
tree | 0d2b9b95d1eb2c047e4337fda92a3aa58471e62a | |
parent | ec06ba24553d2d83b3a6a6bc4d8150910b01ee7c (diff) | |
download | mariadb-git-5ce4825b63997f6db76a12b0f764d175734699fb.tar.gz |
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.
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
-rw-r--r-- | sql/field.cc | 3 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 3 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/records.cc | 1 | ||||
-rw-r--r-- | sql/sql_delete.cc | 1 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 2 |
8 files changed, 4 insertions, 18 deletions
diff --git a/sql/field.cc b/sql/field.cc index 597ec4f68d0..62c7d31367d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6703,8 +6703,7 @@ void Field_string::sql_type(String &res) const 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); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 36a999c9e76..5458933c3d2 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4683,8 +4683,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) 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) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ccbc7fd3ba1..a671c4409f3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -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 diff --git a/sql/records.cc b/sql/records.cc index 10d145fb1e2..4c75ec10f0a 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -216,7 +216,6 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table, */ 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 || diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 361a5db1f2c..5564d628594 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -130,7 +130,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, - 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())))) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index af66c9447b0..0d0c4ad786a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2e966dbdde3..f649297aceb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7187,8 +7187,6 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab) 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) { diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e01289ad087..75a16e19d83 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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 |