summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
Diffstat (limited to 'innobase')
-rw-r--r--innobase/dict/dict0dict.c2
-rw-r--r--innobase/include/os0file.h7
-rw-r--r--innobase/include/row0mysql.h3
-rw-r--r--innobase/lock/lock0lock.c2
-rw-r--r--innobase/os/os0file.c44
-rw-r--r--innobase/row/row0mysql.c1
6 files changed, 43 insertions, 16 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 84a655bcb77..aa5787ee30e 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -681,7 +681,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);
}
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h
index 930390241d3..6549a3748df 100644
--- a/innobase/include/os0file.h
+++ b/innobase/include/os0file.h
@@ -169,6 +169,13 @@ 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) */
+/***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned
at the first entry. In both Unix and Windows we automatically skip the '.'
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index af6d8969cfc..390e8c4da57 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -558,6 +558,9 @@ struct row_prebuilt_struct {
dtuple_t* clust_ref; /* prebuilt dtuple used in
sel/upd/del */
ulint select_lock_type;/* LOCK_NONE, LOCK_S, or LOCK_X */
+ ulint stored_select_lock_type;/* inside LOCK TABLES, either
+ LOCK_S or LOCK_X depending on the lock
+ type */
ulint mysql_row_len; /* length in bytes of a row in the
MySQL format */
ulint n_rows_fetched; /* number of rows fetched after
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 223d9af78d1..58c88f67017 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -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();
}
/*************************************************************************
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 9d428c283a5..6aca90885a6 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -311,14 +311,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(FALSE);
if (err == OS_FILE_DISK_FULL) {
@@ -482,6 +479,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);
+}
+
+/***************************************************************************
The os_file_opendir() function opens a directory stream corresponding to the
directory named by the dirname argument. The directory stream is positioned
at the first entry. In both Unix and Windows we automatically skip the '.'
@@ -809,7 +825,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) {
@@ -859,7 +875,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) {
@@ -1101,7 +1117,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_CREATE ?
"create" : "open");
if (retry) {
@@ -1186,7 +1202,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_CREATE ?
"create" : "open");
if (retry) {
@@ -1389,7 +1405,7 @@ os_file_close(
return(TRUE);
}
- os_file_handle_error(file, NULL, "close");
+ os_file_handle_error(NULL, "close");
return(FALSE);
#else
@@ -1398,7 +1414,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);
}
@@ -1651,7 +1667,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 */
@@ -1686,7 +1702,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 */
@@ -1946,7 +1962,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;
@@ -3157,7 +3173,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) {
@@ -3257,7 +3273,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;
}
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 623069cc90c..974dfa3e1c8 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -397,6 +397,7 @@ row_create_prebuilt(
prebuilt->clust_pcur = btr_pcur_create_for_mysql();
prebuilt->select_lock_type = LOCK_NONE;
+ prebuilt->stored_select_lock_type = 99999999;
prebuilt->sel_graph = NULL;