mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Complete applying InnoDB snapshot innodb-5.1-ss2479. Fixes
Bug #11894: innodb_file_per_table crashes w/ Windows .sym symbolic link hack Detailed revision comments: r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines branches/5.1: Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic link hack The crash was due to un-handled error 3 (path not found). In the case of file per table, change the call to os_file_handle_error_no_exit() from os_file_handle_error(). Also, checks for full path pattern during table create (Windows only), which is used in symbolic link and temp table creation. Approved by: Heikki
This commit is contained in:
parent
25f3574a4f
commit
1945f661f7
2 changed files with 49 additions and 6 deletions
|
@ -4990,6 +4990,29 @@ ha_innobase::create(
|
|||
DBUG_ENTER("ha_innobase::create");
|
||||
|
||||
DBUG_ASSERT(thd != NULL);
|
||||
DBUG_ASSERT(create_info != NULL);
|
||||
|
||||
#ifdef __WIN__
|
||||
/* Names passed in from server are in two formats:
|
||||
1. <database_name>/<table_name>: for normal table creation
|
||||
2. full path: for temp table creation, or sym link
|
||||
|
||||
When srv_file_per_table is on, check for full path pattern, i.e.
|
||||
X:\dir\..., X is a driver letter, or
|
||||
\\dir1\dir2\..., UNC path
|
||||
returns error if it is in full path format, but not creating a temp.
|
||||
table. Currently InnoDB does not support symbolic link on Windows. */
|
||||
|
||||
if (srv_file_per_table
|
||||
&& (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
|
||||
|
||||
if ((name[1] == ':')
|
||||
|| (name[0] == '\\' && name[1] == '\\')) {
|
||||
sql_print_error("Cannot create table %s\n", name);
|
||||
DBUG_RETURN(HA_ERR_GENERIC);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (form->s->fields > 1000) {
|
||||
/* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
|
||||
|
|
|
@ -1267,9 +1267,19 @@ try_again:
|
|||
if (file == INVALID_HANDLE_VALUE) {
|
||||
*success = FALSE;
|
||||
|
||||
retry = os_file_handle_error(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
/* When srv_file_per_table is on, file creation failure may not
|
||||
be critical to the whole instance. Do not crash the server in
|
||||
case of unknown errors. */
|
||||
if (srv_file_per_table) {
|
||||
retry = os_file_handle_error_no_exit(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
} else {
|
||||
retry = os_file_handle_error(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
}
|
||||
|
||||
if (retry) {
|
||||
goto try_again;
|
||||
}
|
||||
|
@ -1344,9 +1354,19 @@ try_again:
|
|||
if (file == -1) {
|
||||
*success = FALSE;
|
||||
|
||||
retry = os_file_handle_error(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
/* When srv_file_per_table is on, file creation failure may not
|
||||
be critical to the whole instance. Do not crash the server in
|
||||
case of unknown errors. */
|
||||
if (srv_file_per_table) {
|
||||
retry = os_file_handle_error_no_exit(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
} else {
|
||||
retry = os_file_handle_error(name,
|
||||
create_mode == OS_FILE_CREATE ?
|
||||
"create" : "open");
|
||||
}
|
||||
|
||||
if (retry) {
|
||||
goto try_again;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue