summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-04-01 11:34:52 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-04-01 11:34:52 +0200
commitc71aae73f6f864c97cf17b3e872346666b871c3f (patch)
tree4895816aee1a0fcef08daa0f68bf1b1fe9aa2b5a /sql/sql_load.cc
parent3c59ba32ab9cca29e01bd8dd2130af83ead8bde0 (diff)
parent7ca1ebd83a1a7d291593be7a94f5a37298dfc863 (diff)
downloadmariadb-git-c71aae73f6f864c97cf17b3e872346666b871c3f.tar.gz
merge of 5.1-main into 5.1-maria. MyISAM changes are propagated to Maria except
those of davi.arnaut@sun.com-20090219210935-9vilvcisyyieffxl (TODO).
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc29
1 files changed, 26 insertions, 3 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index cae8f682a09..9334d19fc1c 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -15,10 +15,10 @@
/* Copy data from a textfile to table */
-
#include "mysql_priv.h"
#include <my_dir.h>
#include <m_ctype.h>
+#include "rpl_mi.h"
#include "sql_repl.h"
#include "sp_head.h"
#include "sql_trigger.h"
@@ -310,8 +310,31 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
is_fifo = 1;
#endif
- if (opt_secure_file_priv &&
- strncmp(opt_secure_file_priv, name, strlen(opt_secure_file_priv)))
+ if (thd->slave_thread)
+ {
+#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
+ if (strncmp(active_mi->rli.slave_patternload_file, name,
+ active_mi->rli.slave_patternload_file_size))
+ {
+ /*
+ LOAD DATA INFILE in the slave SQL Thread can only read from
+ --slave-load-tmpdir". This should never happen. Please, report a bug.
+ */
+
+ sql_print_error("LOAD DATA INFILE in the slave SQL Thread can only read from --slave-load-tmpdir. " \
+ "Please, report a bug.");
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--slave-load-tmpdir");
+ DBUG_RETURN(TRUE);
+ }
+#else
+ /*
+ This is impossible and should never happen.
+ */
+ DBUG_ASSERT(FALSE);
+#endif
+ }
+ else if (opt_secure_file_priv &&
+ strncmp(opt_secure_file_priv, name, strlen(opt_secure_file_priv)))
{
/* Read only allowed from within dir specified by secure_file_priv */
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv");