Commit 63a5c570 authored by Timothy Smith's avatar Timothy Smith

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
parent 4e7bc33e
...@@ -4990,6 +4990,29 @@ ha_innobase::create( ...@@ -4990,6 +4990,29 @@ ha_innobase::create(
DBUG_ENTER("ha_innobase::create"); DBUG_ENTER("ha_innobase::create");
DBUG_ASSERT(thd != NULL); 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) { if (form->s->fields > 1000) {
/* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020, /* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
......
...@@ -1267,9 +1267,19 @@ os_file_create( ...@@ -1267,9 +1267,19 @@ os_file_create(
if (file == INVALID_HANDLE_VALUE) { if (file == INVALID_HANDLE_VALUE) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(name, /* When srv_file_per_table is on, file creation failure may not
create_mode == OS_FILE_CREATE ? be critical to the whole instance. Do not crash the server in
"create" : "open"); 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) { if (retry) {
goto try_again; goto try_again;
} }
...@@ -1344,9 +1354,19 @@ os_file_create( ...@@ -1344,9 +1354,19 @@ os_file_create(
if (file == -1) { if (file == -1) {
*success = FALSE; *success = FALSE;
retry = os_file_handle_error(name, /* When srv_file_per_table is on, file creation failure may not
create_mode == OS_FILE_CREATE ? be critical to the whole instance. Do not crash the server in
"create" : "open"); 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) { if (retry) {
goto try_again; goto try_again;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment