summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-10 14:39:28 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-10 14:39:28 +0200
commitf27ca6f667f21b45325cc0f262f6aa632375be9a (patch)
tree124795f9fb62aa21b1d053535ac2d92fa82069b0 /sql
parent3d46768da2a784ddc9c341d1fb03468525bd38f1 (diff)
parent5044dae239d094582879792de7a762d3428223ce (diff)
downloadmariadb-git-f27ca6f667f21b45325cc0f262f6aa632375be9a.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt1
-rw-r--r--sql/mysql_install_db.cc18
-rw-r--r--sql/sql_lex.cc3
-rw-r--r--sql/sql_table.cc18
4 files changed, 37 insertions, 3 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index d011b1a07d2..814993355b0 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -413,6 +413,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/sql_lex.cc b/sql/sql_lex.cc
index b2dd04d8fd5..c028d49d620 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -3415,6 +3415,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 b22f831ddab..2df3f4ef34a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2474,7 +2474,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
@@ -2490,7 +2502,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)
{
@@ -6002,7 +6014,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;
}
}