diff options
-rw-r--r-- | innobase/data/data0type.c | 7 | ||||
-rw-r--r-- | innobase/dict/dict0dict.c | 23 | ||||
-rw-r--r-- | innobase/dict/dict0load.c | 4 | ||||
-rw-r--r-- | innobase/include/data0type.ic | 7 | ||||
-rw-r--r-- | innobase/include/srv0srv.h | 6 | ||||
-rw-r--r-- | innobase/include/srv0start.h | 10 | ||||
-rw-r--r-- | innobase/include/sync0sync.h | 4 | ||||
-rw-r--r-- | innobase/include/sync0sync.ic | 2 | ||||
-rw-r--r-- | innobase/include/trx0trx.h | 4 | ||||
-rw-r--r-- | innobase/lock/lock0lock.c | 7 | ||||
-rw-r--r-- | innobase/row/row0ins.c | 14 | ||||
-rw-r--r-- | innobase/row/row0mysql.c | 11 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 20 | ||||
-rw-r--r-- | innobase/srv/srv0start.c | 5 | ||||
-rw-r--r-- | innobase/sync/sync0rw.c | 2 | ||||
-rw-r--r-- | innobase/sync/sync0sync.c | 19 | ||||
-rw-r--r-- | innobase/trx/trx0roll.c | 9 | ||||
-rw-r--r-- | innobase/trx/trx0trx.c | 2 | ||||
-rw-r--r-- | innobase/ut/ut0ut.c | 4 |
19 files changed, 145 insertions, 15 deletions
diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c index 00048bf6fbb..b1297fe7a5b 100644 --- a/innobase/data/data0type.c +++ b/innobase/data/data0type.c @@ -81,6 +81,7 @@ dtype_get_at_most_n_mbchars( ulint data_len, const char* str) { +#ifndef UNIV_HOTBACKUP ut_a(data_len != UNIV_SQL_NULL); if (dtype_str_needs_mysql_cmp(dtype)) { @@ -99,6 +100,12 @@ dtype_get_at_most_n_mbchars( } return(data_len); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************* diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 800d7dcd9e9..6ec4809790e 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -53,6 +53,7 @@ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve /* Identifies generated InnoDB foreign key names */ static char dict_ibfk[] = "_ibfk_"; +#ifndef UNIV_HOTBACKUP /********************************************************************** Compares NUL-terminated UTF-8 strings case insensitively. @@ -76,6 +77,7 @@ void innobase_casedn_str( /*================*/ char* a); /* in/out: string to put in lower case */ +#endif /* !UNIV_HOTBACKUP */ /************************************************************************** Adds a column to the data dictionary hash table. */ @@ -2095,6 +2097,7 @@ dict_foreign_find_index( dict_index_t* types_idx)/* in: NULL or an index to whose types the column types must match */ { +#ifndef UNIV_HOTBACKUP dict_index_t* index; const char* col_name; ulint i; @@ -2139,6 +2142,12 @@ dict_foreign_find_index( } return(NULL); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************** @@ -2492,6 +2501,7 @@ dict_scan_col( const char** name) /* out,own: the column name; NULL if no name was scannable */ { +#ifndef UNIV_HOTBACKUP dict_col_t* col; ulint i; @@ -2525,6 +2535,12 @@ dict_scan_col( } return(ptr); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************* @@ -2542,6 +2558,7 @@ dict_scan_table_name( const char** ref_name)/* out,own: the table name; NULL if no name was scannable */ { +#ifndef UNIV_HOTBACKUP const char* database_name = NULL; ulint database_name_len = 0; const char* table_name = NULL; @@ -2623,6 +2640,12 @@ dict_scan_table_name( *table = dict_table_get_low(ref); return(ptr); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************* diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 17b53a7a140..7fd1ca08c04 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -8,7 +8,9 @@ Created 4/24/1996 Heikki Tuuri *******************************************************/ #include "dict0load.h" +#ifndef UNIV_HOTBACKUP #include "mysql_version.h" +#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_NONINL #include "dict0load.ic" @@ -792,6 +794,7 @@ dict_load_table( name, (ulong)mix_len); } +#ifndef UNIV_HOTBACKUP #if MYSQL_VERSION_ID < 50003 /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the "compact format" flag. */ @@ -807,6 +810,7 @@ dict_load_table( return(NULL); } #endif /* MYSQL_VERSION_ID < 50300 */ +#endif /* !UNIV_HOTBACKUP */ ut_a(0 == ut_strcmp("SPACE", dict_field_get_col( diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index 0b92ffbe7f1..15833905761 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -273,6 +273,7 @@ dtype_get_fixed_size( /* out: fixed size, or 0 */ dtype_t* type) /* in: type */ { +#ifndef UNIV_HOTBACKUP ulint mtype; mtype = dtype_get_mtype(type); @@ -321,6 +322,12 @@ dtype_get_fixed_size( } return(0); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /*************************************************************************** diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index c5374fd00fa..27cdaf2e505 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -294,6 +294,12 @@ srv_boot(void); /*==========*/ /* out: DB_SUCCESS or error code */ /************************************************************************* +Initializes the server. */ + +void +srv_init(void); +/*==========*/ +/************************************************************************* Frees the OS fast mutex created in srv_boot(). */ void diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h index 8df0f97c4ff..d24f119c0b0 100644 --- a/innobase/include/srv0start.h +++ b/innobase/include/srv0start.h @@ -53,6 +53,16 @@ srv_parse_log_group_home_dirs( error */ char* str, /* in: character string */ char*** log_group_home_dirs); /* out, own: log group home dirs */ +/************************************************************************* +Adds a slash or a backslash to the end of a string if it is missing +and the string is not empty. */ + +char* +srv_add_path_separator_if_needed( +/*=============================*/ + /* out: string which has the separator if the + string is not empty */ + char* str); /* in: null-terminated character string */ /******************************************************************** Starts Innobase and creates a new database if database files are not found and the user wants. Server parameters are diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h index 5046a960bcf..c798c047fa3 100644 --- a/innobase/include/sync0sync.h +++ b/innobase/include/sync0sync.h @@ -17,7 +17,9 @@ Created 9/5/1995 Heikki Tuuri #include "os0sync.h" #include "sync0arr.h" +#ifndef UNIV_HOTBACKUP extern my_bool timed_mutexes; +#endif /* UNIV_HOTBACKUP */ /********************************************************************** Initializes the synchronization data structures. */ @@ -475,6 +477,7 @@ struct mutex_struct { const char* cfile_name;/* File name where mutex created */ ulint cline; /* Line where created */ ulint magic_n; +#ifndef UNIV_HOTBACKUP ulong count_using; /* count of times mutex used */ ulong count_spin_loop; /* count of spin loops */ ulong count_spin_rounds; /* count of spin rounds */ @@ -484,6 +487,7 @@ struct mutex_struct { ulonglong lmax_spent_time; /* mutex os_wait timer msec */ const char* cmutex_name;/* mutex name */ ulint mutex_type;/* 0 - usual mutex 1 - rw_lock mutex */ +#endif /* !UNIV_HOTBACKUP */ }; #define MUTEX_MAGIC_N (ulint)979585 diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index f26f3788dc3..b3fde61db5e 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -250,7 +250,9 @@ mutex_enter_func( /* Note that we do not peek at the value of lock_word before trying the atomic test_and_set; we could peek, and possibly save time. */ +#ifndef UNIV_HOTBACKUP mutex->count_using++; +#endif /* UNIV_HOTBACKUP */ if (!mutex_test_and_set(mutex)) { diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index b63afdd526c..8ac18241e32 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -173,10 +173,10 @@ their transaction objects for a recovery. */ int trx_recover_for_mysql( -/*=================*/ +/*==================*/ /* out: number of prepared transactions */ XID* xid_list, /* in/out: prepared transactions */ - uint len); /* in: number of slots in xid_list */ + ulint len); /* in: number of slots in xid_list */ /*********************************************************************** This function is used to commit one X/Open XA distributed transaction diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 05466764063..a2560c1faae 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -694,7 +694,7 @@ lock_is_table_exclusive( trx_t* trx) /* in: transaction */ { lock_t* lock; - bool ok = FALSE; + ibool ok = FALSE; ut_ad(table && trx); @@ -4219,7 +4219,8 @@ lock_get_n_rec_locks(void) return(n_locks); } - + +#ifndef UNIV_HOTBACKUP /************************************************************************* Prints info of locks for all transactions. */ @@ -4743,7 +4744,7 @@ lock_validate(void) return(TRUE); } - +#endif /* !UNIV_HOTBACKUP */ /*============ RECORD LOCK CHECKS FOR ROW OPERATIONS ====================*/ /************************************************************************* diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 9edc18025d7..87ed497ba1e 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1546,6 +1546,7 @@ row_ins_scan_sec_index_for_duplicate( dtuple_t* entry, /* in: index entry */ que_thr_t* thr) /* in: query thread */ { +#ifndef UNIV_HOTBACKUP ulint n_unique; ulint i; int cmp; @@ -1662,6 +1663,12 @@ next_rec: dtuple_set_n_fields_cmp(entry, n_fields_cmp); return(err); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /******************************************************************* @@ -1681,6 +1688,7 @@ row_ins_duplicate_error_in_clust( que_thr_t* thr, /* in: query thread */ mtr_t* mtr) /* in: mtr */ { +#ifndef UNIV_HOTBACKUP ulint err; rec_t* rec; page_t* page; @@ -1801,6 +1809,12 @@ row_ins_duplicate_error_in_clust( err = DB_SUCCESS; func_exit: return(err); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /******************************************************************* diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index fbfac88292f..f1673aa6fa5 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -260,6 +260,7 @@ row_mysql_handle_errors( que_thr_t* thr, /* in: query thread */ trx_savept_t* savept) /* in: savepoint or NULL */ { +#ifndef UNIV_HOTBACKUP ulint err; handle_new_error: @@ -359,6 +360,12 @@ handle_new_error: trx->error_state = DB_SUCCESS; return(FALSE); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************ @@ -2072,6 +2079,7 @@ row_add_table_to_background_drop_list( return(TRUE); } +#ifndef UNIV_HOTBACKUP /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for @@ -2692,6 +2700,7 @@ funct_exit: return((int) err); } +#endif /* !UNIV_HOTBACKUP */ /************************************************************************* Drops a table for MySQL. If the name of the table to be dropped is equal @@ -3088,7 +3097,9 @@ funct_exit: trx->op_info = ""; +#ifndef UNIV_HOTBACKUP srv_wake_master_thread(); +#endif /* !UNIV_HOTBACKUP */ return((int) err); } diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 7da2ee10d27..55ce452772d 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -848,7 +848,7 @@ srv_get_thread_type(void) /************************************************************************* Initializes the server. */ -static + void srv_init(void) /*==========*/ @@ -1310,6 +1310,7 @@ srv_boot(void) return(DB_SUCCESS); } +#ifndef UNIV_HOTBACKUP /************************************************************************* Reserves a slot in the thread table for the current MySQL OS thread. NOTE! The kernel mutex has to be reserved by the caller! */ @@ -1368,6 +1369,7 @@ srv_table_reserve_slot_for_mysql(void) return(slot); } +#endif /* !UNIV_HOTBACKUP */ /******************************************************************* Puts a MySQL OS thread to wait for a lock to be released. If an error @@ -1382,6 +1384,7 @@ srv_suspend_mysql_thread( que_thr_t* thr) /* in: query thread associated with the MySQL OS thread */ { +#ifndef UNIV_HOTBACKUP srv_slot_t* slot; os_event_t event; double wait_time; @@ -1520,6 +1523,12 @@ srv_suspend_mysql_thread( trx->error_state = DB_LOCK_WAIT_TIMEOUT; } +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /************************************************************************ @@ -1532,6 +1541,7 @@ srv_release_mysql_thread_if_suspended( que_thr_t* thr) /* in: query thread associated with the MySQL OS thread */ { +#ifndef UNIV_HOTBACKUP srv_slot_t* slot; ulint i; @@ -1553,8 +1563,15 @@ srv_release_mysql_thread_if_suspended( } /* not found */ +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } +#ifndef UNIV_HOTBACKUP /********************************************************************** Refreshes the values used to calculate per-second averages. */ static @@ -2576,3 +2593,4 @@ suspend_thread: return(0); #endif } +#endif /* !UNIV_HOTBACKUP */ diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 983a8306773..b2f97492e70 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -479,7 +479,6 @@ srv_normalize_path_for_win( Adds a slash or a backslash to the end of a string if it is missing and the string is not empty. */ -static char* srv_add_path_separator_if_needed( /*=============================*/ @@ -531,6 +530,7 @@ srv_calc_high32( return(file_size >> (32 - UNIV_PAGE_SIZE_SHIFT)); } +#ifndef UNIV_HOTBACKUP /************************************************************************* Creates or opens the log files and closes them. */ static @@ -1834,4 +1834,5 @@ void set_panic_flag_for_netware() extern ibool panic_shutdown; panic_shutdown = TRUE; } -#endif +#endif /* __NETWARE__ */ +#endif /* !UNIV_HOTBACKUP */ diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c index 359945594be..973b46fdd50 100644 --- a/innobase/sync/sync0rw.c +++ b/innobase/sync/sync0rw.c @@ -102,8 +102,10 @@ rw_lock_create_func( lock->mutex.cfile_name = cfile_name; lock->mutex.cline = cline; +#ifndef UNIV_HOTBACKUP lock->mutex.cmutex_name = cmutex_name; lock->mutex.mutex_type = 1; +#endif /* !UNIV_HOTBACKUP */ rw_lock_set_waiters(lock, 0); rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED); diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index 788965f82ef..98b91ed5211 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -215,6 +215,7 @@ mutex_create_func( mutex->level = SYNC_LEVEL_NONE; mutex->cfile_name = cfile_name; mutex->cline = cline; +#ifndef UNIV_HOTBACKUP mutex->cmutex_name= cmutex_name; mutex->count_using= 0; mutex->mutex_type= 0; @@ -224,7 +225,7 @@ mutex_create_func( mutex->count_spin_rounds= 0; mutex->count_os_wait= 0; mutex->count_os_yield= 0; - +#endif /* !UNIV_HOTBACKUP */ /* Check that lock_word is aligned; this is important on Intel */ ut_ad(((ulint)(&(mutex->lock_word))) % 4 == 0); @@ -372,9 +373,9 @@ mutex_spin_wait( ulint ltime_diff; ulint sec; ulint ms; - +#ifndef UNIV_HOTBACKUP uint timer_started = 0; - +#endif /* !UNIV_HOTBACKUP */ ut_ad(mutex); mutex_loop: @@ -388,8 +389,10 @@ mutex_loop: memory word. */ spin_loop: +#ifndef UNIV_HOTBACKUP mutex_spin_wait_count++; mutex->count_spin_loop++; +#endif /* !UNIV_HOTBACKUP */ while (mutex_get_lock_word(mutex) != 0 && i < SYNC_SPIN_ROUNDS) { @@ -403,6 +406,7 @@ spin_loop: if (i == SYNC_SPIN_ROUNDS) { +#ifndef UNIV_HOTBACKUP mutex->count_os_yield++; if (timed_mutexes == 1 && timer_started==0) { @@ -410,6 +414,7 @@ spin_loop: lstart_time= (ib_longlong)sec * 1000000 + ms; timer_started = 1; } +#endif /* !UNIV_HOTBACKUP */ os_thread_yield(); } @@ -422,7 +427,9 @@ spin_loop: mutex_spin_round_count += i; +#ifndef UNIV_HOTBACKUP mutex->count_spin_rounds += i; +#endif /* !UNIV_HOTBACKUP */ if (mutex_test_and_set(mutex) == 0) { @@ -504,8 +511,8 @@ Now there is no risk of infinite wait on the event. */ mutex_system_call_count++; mutex_os_wait_count++; +#ifndef UNIV_HOTBACKUP mutex->count_os_wait++; - /* !!!!! Sometimes os_wait can be called without os_thread_yield */ @@ -516,12 +523,13 @@ Now there is no risk of infinite wait on the event. */ lstart_time= (ib_longlong)sec * 1000000 + ms; timer_started = 1; } - +#endif /* !UNIV_HOTBACKUP */ sync_array_wait_event(sync_primary_wait_array, index); goto mutex_loop; finish_timing: +#ifndef UNIV_HOTBACKUP if (timed_mutexes == 1 && timer_started==1) { ut_usectime(&sec, &ms); @@ -534,6 +542,7 @@ finish_timing: mutex->lmax_spent_time= ltime_diff; } } +#endif /* !UNIV_HOTBACKUP */ return; } diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index cba3040fd0e..e57057de7ff 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -52,6 +52,7 @@ trx_general_rollback_for_mysql( trx_savept_t* savept) /* in: pointer to savepoint undo number, if partial rollback requested */ { +#ifndef UNIV_HOTBACKUP mem_heap_t* heap; que_thr_t* thr; roll_node_t* roll_node; @@ -103,6 +104,12 @@ trx_general_rollback_for_mysql( srv_active_wake_master_thread(); return((int) trx->error_state); +#else /* UNIV_HOTBACKUP */ + /* This function depends on MySQL code that is not included in + InnoDB Hot Backup builds. Besides, this function should never + be called in InnoDB Hot Backup. */ + ut_error; +#endif /* UNIV_HOTBACKUP */ } /*********************************************************************** @@ -322,7 +329,7 @@ were set after this savepoint are deleted. */ ulint trx_release_savepoint_for_mysql( -/*================================*/ +/*============================*/ /* out: if no savepoint of the name found then DB_NO_SAVEPOINT, diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 6619286ee71..f254f3ff904 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -1844,7 +1844,7 @@ trx_recover_for_mysql( /* out: number of prepared transactions stored in xid_list */ XID* xid_list, /* in/out: prepared transactions */ - uint len) /* in: number of slots in xid_list */ + ulint len) /* in: number of slots in xid_list */ { trx_t* trx; int num_of_transactions = 0; diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index ee94c756959..1fffd08c718 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -416,7 +416,11 @@ ut_print_namel( { const char* s = name; const char* e = s + namelen; +#ifdef UNIV_HOTBACKUP + int q = '"'; +#else int q = mysql_get_identifier_quote_char(trx, name, namelen); +#endif if (q == EOF) { fwrite(name, 1, namelen, f); return; |