=== modified file 'mysql-test/suite/innodb/r/innodb-mdev-7408.result'
--- mysql-test/suite/innodb/r/innodb-mdev-7408.result	2015-02-18 09:25:59 +0000
+++ mysql-test/suite/innodb/r/innodb-mdev-7408.result	2015-02-18 11:05:12 +0000
@@ -3,8 +3,6 @@
 NULL
 CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
 SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
-ERROR 42000: Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT'
-SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT';
 drop table `stop_it-IT`;
 CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
 SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';

=== modified file 'mysql-test/suite/innodb/t/innodb-mdev-7408.test'
--- mysql-test/suite/innodb/t/innodb-mdev-7408.test	2015-02-18 09:25:59 +0000
+++ mysql-test/suite/innodb/t/innodb-mdev-7408.test	2015-02-18 10:20:15 +0000
@@ -2,9 +2,7 @@
 
 select @@global.innodb_ft_server_stopword_table;
 CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
---error 1231
 SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
-SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT';
 drop table `stop_it-IT`;
 
 CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- storage/innobase/handler/ha_innodb.cc	2015-01-21 13:33:39 +0000
+++ storage/innobase/handler/ha_innodb.cc	2015-02-18 11:02:19 +0000
@@ -14645,20 +14645,59 @@
 	int		len = sizeof(buff);
 	trx_t*		trx;
 	int		ret = 1;
+	char		path[FN_REFLEN + 1];
+	const char*	real_name;
 
 	ut_a(save != NULL);
 	ut_a(value != NULL);
 
 	stopword_table_name = value->val_str(value, buff, &len);
+	real_name = stopword_table_name;
 
 	trx = check_trx_exists(thd);
 
 	row_mysql_lock_data_dictionary(trx);
 
+	if (stopword_table_name) {
+		int length;
+		char db[FN_REFLEN + 1], table[FN_REFLEN + 1];
+		const char* slash;
+
+		slash = strstr(stopword_table_name,"/");
+		memset(path, 0, sizeof(path));
+
+		if (slash) {
+			memset(db, 0, sizeof(db));
+			memset(table, 0, sizeof(table));
+			strncpy(db, stopword_table_name, slash-stopword_table_name);
+			strcpy(table, slash+1);
+		} else {
+			db[0]='\0';
+			strcpy(table, stopword_table_name);
+		}
+
+		length = build_table_filename(path, sizeof(path) - 1, db, table, "", 0);
+
+		if (length > FN_REFLEN) {
+			*static_cast<const char**>(save) = stopword_table_name;
+			ret = 0;
+		}
+
+		slash = path;
+		/* Find the last occurrence of db name */
+		do {
+			slash = strstr(slash, db);
+			if (slash) {
+				real_name = slash;
+				slash+=strlen(db);
+			}
+		} while (slash);
+	}
+
 	/* Validate the stopword table's (if supplied) existence and
 	of the right format */
 	if (!stopword_table_name
-	    || fts_valid_stopword_table(stopword_table_name)) {
+	    || fts_valid_stopword_table(real_name)) {
 		*static_cast<const char**>(save) = stopword_table_name;
 		ret = 0;
 	}

=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- storage/xtradb/handler/ha_innodb.cc	2015-01-21 13:34:58 +0000
+++ storage/xtradb/handler/ha_innodb.cc	2015-02-18 10:57:57 +0000
@@ -15415,20 +15415,59 @@
 	int		len = sizeof(buff);
 	trx_t*		trx;
 	int		ret = 1;
+	char		path[FN_REFLEN + 1];
+	const char*	real_name;
 
 	ut_a(save != NULL);
 	ut_a(value != NULL);
 
 	stopword_table_name = value->val_str(value, buff, &len);
+	real_name = stopword_table_name;
 
 	trx = check_trx_exists(thd);
 
 	row_mysql_lock_data_dictionary(trx);
 
+	if (stopword_table_name) {
+		int length;
+		char db[FN_REFLEN + 1], table[FN_REFLEN + 1];
+		const char* slash;
+
+		slash = strstr(stopword_table_name,"/");
+		memset(path, 0, sizeof(path));
+
+		if (slash) {
+			memset(db, 0, sizeof(db));
+			memset(table, 0, sizeof(table));
+			strncpy(db, stopword_table_name, slash-stopword_table_name);
+			strcpy(table, slash+1);
+		} else {
+			db[0]='\0';
+			strcpy(table, stopword_table_name);
+		}
+
+		length = build_table_filename(path, sizeof(path) - 1, db, table, "", 0);
+
+		if (length > FN_REFLEN) {
+			*static_cast<const char**>(save) = stopword_table_name;
+			ret = 0;
+		}
+
+		slash = path;
+		/* Find the last occurrence of db name */
+		do {
+			slash = strstr(slash, db);
+			if (slash) {
+				real_name = slash;
+				slash+=strlen(db);
+			}
+		} while (slash);
+	}
+
 	/* Validate the stopword table's (if supplied) existence and
 	of the right format */
 	if (!stopword_table_name
-	    || fts_valid_stopword_table(stopword_table_name)) {
+	    || fts_valid_stopword_table(real_name)) {
 		*static_cast<const char**>(save) = stopword_table_name;
 		ret = 0;
 	}

