diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.cc | 3 | ||||
-rw-r--r-- | sql/item.h | 5 | ||||
-rw-r--r-- | sql/rpl_mi.cc | 30 | ||||
-rw-r--r-- | sql/rpl_parallel.cc | 7 | ||||
-rw-r--r-- | sql/share/errmsg-utf8.txt | 2 | ||||
-rw-r--r-- | sql/slave.cc | 23 | ||||
-rw-r--r-- | sql/sql_db.cc | 6 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 2 | ||||
-rw-r--r-- | sql/table.cc | 2 |
9 files changed, 52 insertions, 28 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 17d00ce2486..ca0704c7aa8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3356,6 +3356,7 @@ void handler::print_error(int error, myf errflag) break; case ENOENT: case ENOTDIR: + case ELOOP: textno=ER_FILE_NOT_FOUND; break; case ENOSPC: @@ -3840,7 +3841,7 @@ int handler::delete_table(const char *name) for (const char **ext=bas_ext(); *ext ; ext++) { - if (my_handler_delete_with_symlink(key_file_misc, name, *ext, 0)) + if (mysql_file_delete_with_symlink(key_file_misc, name, *ext, 0)) { if (my_errno != ENOENT) { diff --git a/sql/item.h b/sql/item.h index b09e9297826..d4484c1d74e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4612,6 +4612,11 @@ public: virtual double val_real() = 0; virtual longlong val_int() = 0; virtual int save_in_field(Field *field, bool no_conversions) = 0; + bool walk(Item_processor processor, bool walk_subquery, uchar *args) + { + return (item->walk(processor, walk_subquery, args)) || + (this->*processor)(args); + } }; /** diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 3e73d80ef48..b03db07e443 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1084,6 +1084,7 @@ bool Master_info_index::init_all_master_info() int err_num= 0, succ_num= 0; // The number of success read Master_info char sign[MAX_CONNECTION_NAME+1]; File index_file_nr; + THD *thd; DBUG_ENTER("init_all_master_info"); DBUG_ASSERT(master_info_index); @@ -1115,6 +1116,10 @@ bool Master_info_index::init_all_master_info() DBUG_RETURN(1); } + thd= new THD; /* Needed by start_slave_threads */ + thd->thread_stack= (char*) &thd; + thd->store_globals(); + reinit_io_cache(&index_file, READ_CACHE, 0L,0,0); while (!init_strvar_from_file(sign, sizeof(sign), &index_file, NULL)) @@ -1130,7 +1135,7 @@ bool Master_info_index::init_all_master_info() mi->error()) { delete mi; - DBUG_RETURN(1); + goto error; } init_thread_mask(&thread_mask,mi,0 /*not inverse*/); @@ -1159,7 +1164,7 @@ bool Master_info_index::init_all_master_info() { /* Master_info is not in HASH; Add it */ if (master_info_index->add_master_info(mi, FALSE)) - DBUG_RETURN(1); + goto error; succ_num++; mi->unlock_slave_threads(); } @@ -1196,14 +1201,14 @@ bool Master_info_index::init_all_master_info() /* Master_info was not registered; add it */ if (master_info_index->add_master_info(mi, FALSE)) - DBUG_RETURN(1); + goto error; succ_num++; if (!opt_skip_slave_start) { if (start_slave_threads(current_thd, 1 /* need mutex */, - 0 /* no wait for start*/, + 1 /* wait for start*/, mi, buf_master_info_file, buf_relay_log_info_file, @@ -1222,6 +1227,8 @@ bool Master_info_index::init_all_master_info() mi->unlock_slave_threads(); } } + thd->reset_globals(); + delete thd; if (!err_num) // No Error on read Master_info { @@ -1229,16 +1236,19 @@ bool Master_info_index::init_all_master_info() sql_print_information("Reading of all Master_info entries succeded"); DBUG_RETURN(0); } - else if (succ_num) // Have some Error and some Success + if (succ_num) // Have some Error and some Success { sql_print_warning("Reading of some Master_info entries failed"); DBUG_RETURN(2); } - else // All failed - { - sql_print_error("Reading of all Master_info entries failed!"); - DBUG_RETURN(1); - } + + sql_print_error("Reading of all Master_info entries failed!"); + DBUG_RETURN(1); + +error: + thd->reset_globals(); + delete thd; + DBUG_RETURN(1); } diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index a814628e72c..ad734c23d48 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -1360,11 +1360,10 @@ handle_rpl_parallel_thread(void *arg) */ rpl_parallel_entry *e= rpt->current_entry; /* - Ensure that we will unblock rpl_pause_for_ftrwl() - e->pause_sub_id may be LONGLONG_MAX if rpt->current_entry has changed + Wait for rpl_unpause_after_ftwrl() to wake us up. + Note that rpl_pause_for_ftwrl() may wait for 'e->pause_sub_id' + to change. This should happen eventually in finish_event_group() */ - DBUG_ASSERT(e->pause_sub_id == (uint64)ULONGLONG_MAX || - e->last_committed_sub_id >= e->pause_sub_id); mysql_mutex_lock(&e->LOCK_parallel_entry); mysql_mutex_unlock(&rpt->LOCK_rpl_thread); if (rpt->pause_for_ftwrl) diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index b4332b2ce53..d335b0b420b 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -4841,7 +4841,7 @@ WARN_DATA_TRUNCATED 01000 spa "Datos truncados para columna '%s' en la línea %lu" ER_WARN_USING_OTHER_HANDLER eng "Using storage engine %s for table '%s'" - ger "Für Tabelle '%s' wird Speicher-Engine %s benutzt" + ger "Speicher-Engine %s wird für Tabelle '%s' benutzt" jpn "ストレージエンジン %s が表 '%s' に利用されています。" por "Usando engine de armazenamento %s para tabela '%s'" spa "Usando motor de almacenamiento %s para tabla '%s'" diff --git a/sql/slave.cc b/sql/slave.cc index 47bdf5eb3e8..484dfe81a76 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -519,13 +519,22 @@ int init_slave() if (active_mi->host[0] && !opt_skip_slave_start) { - if (start_slave_threads(0, /* No active thd */ - 1 /* need mutex */, - 0 /* no wait for start*/, - active_mi, - master_info_file, - relay_log_info_file, - SLAVE_IO | SLAVE_SQL)) + int error; + THD *thd= new THD; + thd->thread_stack= (char*) &thd; + thd->store_globals(); + + error= start_slave_threads(0, /* No active thd */ + 1 /* need mutex */, + 1 /* wait for start*/, + active_mi, + master_info_file, + relay_log_info_file, + SLAVE_IO | SLAVE_SQL); + + thd->reset_globals(); + delete thd; + if (error) { sql_print_error("Failed to create slave threads"); goto err; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 701f4e6aa4e..f626b4e6112 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -846,7 +846,7 @@ mysql_rm_db_internal(THD *thd,char *db, bool if_exists, bool silent) if there exists a table with the name 'db', so let's just do it separately. We know this file exists and needs to be deleted anyway. */ - if (my_handler_delete_with_symlink(key_file_misc, path, "", MYF(0)) && + if (mysql_file_delete_with_symlink(key_file_misc, path, "", MYF(0)) && my_errno != ENOENT) { my_error(EE_DELETE, MYF(0), path, my_errno); @@ -1152,7 +1152,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, We ignore ENOENT error in order to skip files that was deleted by concurrently running statement like REPAIR TABLE ... */ - if (my_handler_delete_with_symlink(key_file_misc, filePath, "", MYF(0)) && + if (mysql_file_delete_with_symlink(key_file_misc, filePath, "", MYF(0)) && my_errno != ENOENT) { my_error(EE_DELETE, MYF(0), filePath, my_errno); @@ -1268,7 +1268,7 @@ long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path) continue; } strxmov(filePath, org_path, "/", file->name, NullS); - if (my_handler_delete_with_symlink(key_file_misc, filePath, "", MYF(MY_WME))) + if (mysql_file_delete_with_symlink(key_file_misc, filePath, "", MYF(MY_WME))) { goto err; } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d3a5d0aeef6..09b87a3b1d1 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2200,7 +2200,7 @@ static int mysql_test_handler_read(Prepared_statement *stmt, THD *thd= stmt->thd; LEX *lex= stmt->lex; SQL_HANDLER *ha_table; - DBUG_ENTER("mysql_test_select"); + DBUG_ENTER("mysql_test_handler_read"); lex->select_lex.context.resolve_in_select_list= TRUE; diff --git a/sql/table.cc b/sql/table.cc index fe09ec8948d..37c0b630efc 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -571,7 +571,7 @@ enum open_frm_error open_table_def(THD *thd, TABLE_SHARE *share, uint flags) { DBUG_ASSERT(flags & GTS_TABLE); DBUG_ASSERT(flags & GTS_USE_DISCOVERY); - my_handler_delete_with_symlink(key_file_frm, path, "", MYF(0)); + mysql_file_delete_with_symlink(key_file_frm, path, "", MYF(0)); file= -1; } else |