diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-01-10 14:30:11 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-01-10 14:30:11 +0200 |
commit | 5044dae239d094582879792de7a762d3428223ce (patch) | |
tree | de7baaf095317ab19949f4e7fa205cf9dce44ab8 /sql | |
parent | 4b05d60e62ef6e21d5329a9667813df890034ff0 (diff) | |
parent | 78e6fafcaa93bdd2cf793a82a812137eb7a779a7 (diff) | |
download | mariadb-git-5044dae239d094582879792de7a762d3428223ce.tar.gz |
Merge 10.0 into 10.1
Diffstat (limited to 'sql')
-rw-r--r-- | sql/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sql/mysql_install_db.cc | 18 | ||||
-rw-r--r-- | sql/slave.cc | 15 | ||||
-rw-r--r-- | sql/sql_lex.cc | 3 | ||||
-rw-r--r-- | sql/sql_table.cc | 18 |
5 files changed, 41 insertions, 14 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index ec7e9207f38..46eb4bec3cc 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -415,6 +415,7 @@ IF(WIN32) ${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c COMPONENT Server ) + SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR}) TARGET_LINK_LIBRARIES(mysql_install_db mysys) ADD_LIBRARY(winservice STATIC winservice.c) diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc index c39789f7c97..c23a20ebac9 100644 --- a/sql/mysql_install_db.cc +++ b/sql/mysql_install_db.cc @@ -233,6 +233,20 @@ static void get_basedir(char *basedir, int size, const char *mysqld_path) } } +#define STR(s) _STR(s) +#define _STR(s) #s + +static char *get_plugindir() +{ + static char plugin_dir[2*MAX_PATH]; + get_basedir(plugin_dir, sizeof(plugin_dir), mysqld_path); + strcat(plugin_dir, "/" STR(INSTALL_PLUGINDIR)); + + if (access(plugin_dir, 0) == 0) + return plugin_dir; + + return NULL; +} /** Allocate and initialize command line for mysqld --bootstrap. @@ -313,6 +327,10 @@ static int create_myini() fprintf(myini,"protocol=pipe\n"); else if (opt_port) fprintf(myini,"port=%d\n",opt_port); + + char *plugin_dir = get_plugindir(); + if (plugin_dir) + fprintf(myini, "plugin-dir=%s\n", plugin_dir); fclose(myini); return 0; } diff --git a/sql/slave.cc b/sql/slave.cc index 1846938f746..717d37a7907 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4796,11 +4796,11 @@ pthread_handler_t handle_slave_sql(void *arg) { rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL, "Error initializing relay log position: %s", errmsg); - goto err; + goto err_before_start; } rli->reset_inuse_relaylog(); if (rli->alloc_inuse_relaylog(rli->group_relay_log_name)) - goto err; + goto err_before_start; strcpy(rli->future_event_master_log_name, rli->group_master_log_name); THD_CHECK_SENTRY(thd); @@ -4977,6 +4977,7 @@ pthread_handler_t handle_slave_sql(void *arg) } } + err: if (mi->using_parallel()) rli->parallel.wait_for_done(thd, rli); @@ -4994,15 +4995,7 @@ pthread_handler_t handle_slave_sql(void *arg) rli->group_master_log_pos, tmp.c_ptr_safe()); } - err: - - /* - Once again, in case we aborted with an error and skipped the first one. - (We want the first one to be before the printout of stop position to - get the correct position printed.) - */ - if (mi->using_parallel()) - rli->parallel.wait_for_done(thd, rli); + err_before_start: /* Some events set some playgrounds, which won't be cleared because thread diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 6dffd99472a..19281f44771 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3379,6 +3379,9 @@ void LEX::first_lists_tables_same() if (query_tables_last == &first_table->next_global) query_tables_last= first_table->prev_global; + if (query_tables_own_last == &first_table->next_global) + query_tables_own_last= first_table->prev_global; + if ((next= *first_table->prev_global= first_table->next_global)) next->prev_global= first_table->prev_global; /* include in new place */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index aaf423b7290..836e2bda70c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2473,7 +2473,19 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, int frm_delete_error, trigger_drop_error= 0; /* Delete the table definition file */ strmov(end,reg_ext); - frm_delete_error= mysql_file_delete(key_file_frm, path, MYF(MY_WME)); + if (table_type && table_type != view_pseudo_hton && + table_type->discover_table) + { + /* + Table type is using discovery and may not need a .frm file. + Delete it silently if it exists + */ + (void) mysql_file_delete(key_file_frm, path, MYF(0)); + frm_delete_error= 0; + } + else + frm_delete_error= mysql_file_delete(key_file_frm, path, + MYF(MY_WME)); if (frm_delete_error) frm_delete_error= my_errno; else @@ -2489,7 +2501,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, else if (frm_delete_error && if_exists) thd->clear_error(); } - non_tmp_error= error ? TRUE : non_tmp_error; + non_tmp_error|= MY_TEST(error); } if (error) { @@ -5932,7 +5944,7 @@ drop_create_field: while ((f_key= fk_key_it++)) { if (my_strcasecmp(system_charset_info, f_key->foreign_id->str, - key->name.str) == 0) + keyname) == 0) goto remove_key; } } |