diff options
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r-- | sql/ha_innodb.cc | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index a8309d4f32c..b1e5a16bc32 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -118,6 +118,7 @@ my_bool innobase_use_native_aio = FALSE; my_bool innobase_fast_shutdown = TRUE; my_bool innobase_file_per_table = FALSE; my_bool innobase_locks_unsafe_for_binlog = FALSE; +my_bool innobase_create_status_file = FALSE; static char *internal_innobase_data_file_path = NULL; @@ -135,6 +136,10 @@ char innodb_dummy_stmt_trx_handle = 'D'; static HASH innobase_open_tables; +#ifdef __NETWARE__ /* some special cleanup for NetWare */ +bool nw_panic = FALSE; +#endif + static mysql_byte* innobase_get_key(INNOBASE_SHARE *share,uint *length, my_bool not_used __attribute__((unused))); static INNOBASE_SHARE *get_share(const char *table_name); @@ -420,6 +425,30 @@ innobase_mysql_print_thd( } /************************************************************************* +Creates a temporary file. */ +extern "C" +int +innobase_mysql_tmpfile(void) +/*========================*/ + /* out: temporary file descriptor, or < 0 on error */ +{ + char filename[FN_REFLEN]; + File fd = create_temp_file(filename, NullS, "ib", +#ifdef __WIN__ + O_BINARY | O_TRUNC | O_SEQUENTIAL | + O_TEMPORARY | O_SHORT_LIVED | +#endif /* __WIN__ */ + O_CREAT | O_EXCL | O_RDWR, + MYF(MY_WME)); +#ifndef __WIN__ + if (fd >= 0) { + unlink(filename); + } +#endif /* !__WIN__ */ + return(fd); +} + +/************************************************************************* Gets the InnoDB transaction handle for a MySQL handler object, creates an InnoDB transaction struct if the corresponding MySQL thread struct still lacks one. */ @@ -912,6 +941,7 @@ innobase_init(void) srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_max_n_open_files = (ulint) innobase_open_files; + srv_innodb_status = (ibool) innobase_create_status_file; srv_print_verbose_log = mysql_embedded ? 0 : 1; @@ -982,6 +1012,11 @@ innobase_end(void) DBUG_ENTER("innobase_end"); +#ifdef __NETWARE__ /* some special cleanup for NetWare */ + if (nw_panic) { + set_panic_flag_for_netware(); + } +#endif if (innodb_inited) { innodb_inited= 0; @@ -4403,7 +4438,7 @@ ha_innobase::update_table_comment( trx_search_latch_release_if_reserved(prebuilt->trx); str = NULL; - if (FILE* file = tmpfile()) { + if (FILE* file = os_file_create_tmpfile()) { long flen; /* output the data to a temporary file */ @@ -4465,7 +4500,7 @@ ha_innobase::get_foreign_key_create_info(void) update_thd(current_thd); - if (FILE* file = tmpfile()) { + if (FILE* file = os_file_create_tmpfile()) { long flen; prebuilt->trx->op_info = (char*)"getting info on foreign keys"; |