summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <iggy@mysql.com>2006-06-23 12:15:39 -0400
committerunknown <iggy@mysql.com>2006-06-23 12:15:39 -0400
commit401450f867212ac1adbd3352f8cd899c4c898d8e (patch)
tree84e0892e2a4c8fa339378199cd66bd712cd29dec /sql
parent71019ccf5bbc4d7323a48d20b89391ea5c6eabc0 (diff)
downloadmariadb-git-401450f867212ac1adbd3352f8cd899c4c898d8e.tar.gz
Bug#20616: drop_temp_table test fails on Windows platform
sql/sql_table.cc: Check for FN_DEVCHAR in the table name just before file creation. This allows for temporary tables to contain FN_DEVCHAR in the name. sql/table.cc: Removed the check for FN_DEVCHAR is done at this level because it prevents Windows from creating any table with FN_DEVCHAR in the name.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc17
-rw-r--r--sql/table.cc8
2 files changed, 16 insertions, 9 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 275cfbaa088..77c681d4a48 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1656,8 +1656,23 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
my_casedn_str(files_charset_info, path);
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
}
- else
+ else
+ {
+ #ifdef FN_DEVCHAR
+ /* check if the table name contains FN_DEVCHAR when defined */
+ const char *start= alias;
+ while (*start != '\0')
+ {
+ if (*start == FN_DEVCHAR)
+ {
+ my_error(ER_WRONG_TABLE_NAME, MYF(0), alias);
+ DBUG_RETURN(TRUE);
+ }
+ start++;
+ }
+ #endif
build_table_path(path, sizeof(path), db, alias, reg_ext);
+ }
/* Check if table already exists */
if ((create_info->options & HA_LEX_CREATE_TMP_TABLE)
diff --git a/sql/table.cc b/sql/table.cc
index 711f250c271..cfdb9bd93aa 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1614,10 +1614,6 @@ bool check_db_name(char *name)
if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR ||
*name == FN_EXTCHAR)
return 1;
-#ifdef FN_DEVCHAR
- if (*name == FN_DEVCHAR)
- return 1;
-#endif
name++;
}
return last_char_is_space || (uint) (name - start) > NAME_LEN;
@@ -1660,10 +1656,6 @@ bool check_table_name(const char *name, uint length)
#endif
if (*name == '/' || *name == '\\' || *name == FN_EXTCHAR)
return 1;
-#ifdef FN_DEVCHAR
- if (*name == FN_DEVCHAR)
- return 1;
-#endif
name++;
}
#if defined(USE_MB) && defined(USE_MB_IDENT)