Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
fb9257dc
Commit
fb9257dc
authored
May 28, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: Add diagnostics when tmpfile() fails at start (Bug #3919)
parent
cb5c3f6e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
16 deletions
+39
-16
innobase/dict/dict0dict.c
innobase/dict/dict0dict.c
+1
-1
innobase/include/os0file.h
innobase/include/os0file.h
+7
-0
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+1
-1
innobase/os/os0file.c
innobase/os/os0file.c
+30
-14
No files found.
innobase/dict/dict0dict.c
View file @
fb9257dc
...
...
@@ -642,7 +642,7 @@ dict_init(void)
rw_lock_create
(
&
dict_operation_lock
);
rw_lock_set_level
(
&
dict_operation_lock
,
SYNC_DICT_OPERATION
);
dict_foreign_err_file
=
tmpfile
();
dict_foreign_err_file
=
os_file_create_
tmpfile
();
mutex_create
(
&
dict_foreign_err_mutex
);
mutex_set_level
(
&
dict_foreign_err_mutex
,
SYNC_ANY_LATCH
);
}
...
...
innobase/include/os0file.h
View file @
fb9257dc
...
...
@@ -133,6 +133,13 @@ Creates the seek mutexes used in positioned reads and writes. */
void
os_io_init_simple
(
void
);
/*===================*/
/***************************************************************************
Creates a temporary file. In case of error, causes abnormal termination. */
FILE
*
os_file_create_tmpfile
(
void
);
/*========================*/
/* out: temporary file handle (never NULL) */
/********************************************************************
A simple function to open or create a file. */
...
...
innobase/lock/lock0lock.c
View file @
fb9257dc
...
...
@@ -510,7 +510,7 @@ lock_sys_create(
/* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */
lock_latest_err_file
=
tmpfile
();
lock_latest_err_file
=
os_file_create_
tmpfile
();
}
/*************************************************************************
...
...
innobase/os/os0file.c
View file @
fb9257dc
...
...
@@ -301,14 +301,11 @@ os_file_handle_error(
/*=================*/
/* out: TRUE if we should retry the
operation */
os_file_t
file
,
/* in: file pointer */
const
char
*
name
,
/* in: name of a file or NULL */
const
char
*
operation
)
/* in: operation */
{
ulint
err
;
UT_NOT_USED
(
file
);
err
=
os_file_get_last_error
();
if
(
err
==
OS_FILE_DISK_FULL
)
{
...
...
@@ -374,6 +371,25 @@ os_io_init_simple(void)
}
}
/***************************************************************************
Creates a temporary file. In case of error, causes abnormal termination. */
FILE
*
os_file_create_tmpfile
(
void
)
/*========================*/
/* out: temporary file handle (never NULL) */
{
FILE
*
file
=
tmpfile
();
if
(
file
==
NULL
)
{
ut_print_timestamp
(
stderr
);
fputs
(
" InnoDB: Error: unable to create temporary file
\n
"
,
stderr
);
os_file_handle_error
(
NULL
,
"tmpfile"
);
ut_error
;
}
return
(
file
);
}
/********************************************************************
A simple function to open or create a file. */
...
...
@@ -430,7 +446,7 @@ try_again:
if
(
file
==
INVALID_HANDLE_VALUE
)
{
*
success
=
FALSE
;
retry
=
os_file_handle_error
(
file
,
name
,
retry
=
os_file_handle_error
(
name
,
create_mode
==
OS_FILE_OPEN
?
"open"
:
"create"
);
if
(
retry
)
{
...
...
@@ -472,7 +488,7 @@ try_again:
if
(
file
==
-
1
)
{
*
success
=
FALSE
;
retry
=
os_file_handle_error
(
file
,
name
,
retry
=
os_file_handle_error
(
name
,
create_mode
==
OS_FILE_OPEN
?
"open"
:
"create"
);
if
(
retry
)
{
...
...
@@ -678,7 +694,7 @@ try_again:
if
(
file
==
INVALID_HANDLE_VALUE
)
{
*
success
=
FALSE
;
retry
=
os_file_handle_error
(
file
,
name
,
retry
=
os_file_handle_error
(
name
,
create_mode
==
OS_FILE_OPEN
?
"open"
:
"create"
);
if
(
retry
)
{
...
...
@@ -766,7 +782,7 @@ try_again:
if
(
file
==
-
1
)
{
*
success
=
FALSE
;
retry
=
os_file_handle_error
(
file
,
name
,
retry
=
os_file_handle_error
(
name
,
create_mode
==
OS_FILE_OPEN
?
"open"
:
"create"
);
if
(
retry
)
{
...
...
@@ -801,7 +817,7 @@ os_file_close(
return
(
TRUE
);
}
os_file_handle_error
(
file
,
NULL
,
"close"
);
os_file_handle_error
(
NULL
,
"close"
);
return
(
FALSE
);
#else
int
ret
;
...
...
@@ -809,7 +825,7 @@ os_file_close(
ret
=
close
(
file
);
if
(
ret
==
-
1
)
{
os_file_handle_error
(
file
,
NULL
,
"close"
);
os_file_handle_error
(
NULL
,
"close"
);
return
(
FALSE
);
}
...
...
@@ -1029,7 +1045,7 @@ os_file_flush(
return
(
TRUE
);
}
os_file_handle_error
(
file
,
NULL
,
"flush"
);
os_file_handle_error
(
NULL
,
"flush"
);
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
...
...
@@ -1063,7 +1079,7 @@ os_file_flush(
fprintf
(
stderr
,
" InnoDB: Error: the OS said file flush did not succeed
\n
"
);
os_file_handle_error
(
file
,
NULL
,
"flush"
);
os_file_handle_error
(
NULL
,
"flush"
);
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
...
...
@@ -1323,7 +1339,7 @@ try_again:
#ifdef __WIN__
error_handling:
#endif
retry
=
os_file_handle_error
(
file
,
NULL
,
"read"
);
retry
=
os_file_handle_error
(
NULL
,
"read"
);
if
(
retry
)
{
goto
try_again
;
...
...
@@ -2278,7 +2294,7 @@ try_again:
os_aio_array_free_slot
(
array
,
slot
);
retry
=
os_file_handle_error
(
file
,
name
,
retry
=
os_file_handle_error
(
name
,
type
==
OS_FILE_READ
?
"aio read"
:
"aio write"
);
if
(
retry
)
{
...
...
@@ -2378,7 +2394,7 @@ os_aio_windows_handle(
ut_a
(
TRUE
==
os_file_flush
(
slot
->
file
));
}
}
else
{
os_file_handle_error
(
slot
->
file
,
slot
->
name
,
"Windows aio"
);
os_file_handle_error
(
slot
->
name
,
"Windows aio"
);
ret_val
=
FALSE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment