diff options
author | monty@mashka.mysql.fi <> | 2004-02-20 17:43:02 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2004-02-20 17:43:02 +0200 |
commit | 494e43c1f56d2a65fc804af865ae82661fbb046f (patch) | |
tree | e13a23a1c9f28ed5eb2d903ba59a153cda3355ac /innobase/include | |
parent | f8b4732a5edccdf71eb65093c8bb6ec028176fec (diff) | |
parent | e1fee022fa10fc0cceafbd774441d70311e10434 (diff) | |
download | mariadb-git-494e43c1f56d2a65fc804af865ae82661fbb046f.tar.gz |
merge with 4.0 to get security fixes and latest bug fixes
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/Makefile.am | 2 | ||||
-rw-r--r-- | innobase/include/mem0mem.ic | 32 | ||||
-rw-r--r-- | innobase/include/srv0start.h | 10 | ||||
-rw-r--r-- | innobase/include/sync0rw.ic | 36 | ||||
-rw-r--r-- | innobase/include/sync0sync.ic | 4 | ||||
-rw-r--r-- | innobase/include/univold.i | 164 | ||||
-rw-r--r-- | innobase/include/univoldmysql.i | 181 | ||||
-rw-r--r-- | innobase/include/usr0sess.h | 43 | ||||
-rw-r--r-- | innobase/include/ut0rnd.ic | 8 |
9 files changed, 41 insertions, 439 deletions
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 8664f6dfc17..ab1f14d0770 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -50,7 +50,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \ trx0sys.h trx0sys.ic trx0trx.h trx0trx.ic trx0types.h \ - trx0undo.h trx0undo.ic univ.i univold.i univoldmysql.i \ + trx0undo.h trx0undo.ic univ.i \ usr0sess.h usr0sess.ic usr0types.h ut0byte.h ut0byte.ic \ ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \ ut0sort.h ut0ut.h ut0ut.ic diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index 1ff8c66e80a..e863fe41c4b 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -162,7 +162,7 @@ mem_heap_alloc( mem_block_set_free(block, free + MEM_SPACE_NEEDED(n)); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG /* In the debug version write debugging info to the field */ mem_field_init((byte*)buf, n); @@ -171,7 +171,7 @@ mem_heap_alloc( caller */ buf = (byte*)buf + MEM_FIELD_HEADER_SIZE; - #endif +#endif #ifdef UNIV_SET_MEM_TO_ZERO memset(buf, '\0', n); #endif @@ -212,15 +212,15 @@ mem_heap_free_heap_top( { mem_block_t* block; mem_block_t* prev_block; - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG ibool error; ulint total_size; ulint size; - #endif +#endif ut_ad(mem_heap_check(heap)); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG /* Validate the heap and get its total allocated size */ mem_heap_validate_or_print(heap, NULL, FALSE, &error, &total_size, @@ -232,7 +232,7 @@ mem_heap_free_heap_top( NULL); ut_a(!error); - #endif +#endif block = UT_LIST_GET_LAST(heap->base); @@ -259,7 +259,7 @@ mem_heap_free_heap_top( /* Set the free field of block */ mem_block_set_free(block, old_top - (byte*)block); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG ut_ad(mem_block_get_start(block) <= mem_block_get_free(block)); /* In the debug version erase block from top up */ @@ -271,7 +271,7 @@ mem_heap_free_heap_top( mem_current_allocated_memory -= (total_size - size); mutex_exit(&mem_hash_mutex); - #endif +#endif /* If free == start, we may free the block if it is not the first one */ @@ -317,7 +317,7 @@ mem_heap_get_top( buf = (byte*)block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG ut_ad(mem_block_get_start(block) <=(ulint)((byte*)buf - (byte*)block)); /* In the debug version, advance buf to point at the storage which @@ -327,7 +327,7 @@ mem_heap_get_top( /* Check that the field lengths agree */ ut_ad(n == (ulint)mem_field_header_get_len(buf)); - #endif +#endif return(buf); } @@ -351,13 +351,13 @@ mem_heap_free_top( /* Subtract the free field of block */ mem_block_set_free(block, mem_block_get_free(block) - MEM_SPACE_NEEDED(n)); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG ut_ad(mem_block_get_start(block) <= mem_block_get_free(block)); /* In the debug version check the consistency, and erase field */ mem_field_erase((byte*)block + mem_block_get_free(block), n); - #endif +#endif /* If free == start, we may free the block if it is not the first one */ @@ -417,7 +417,7 @@ mem_heap_create_func( /* Add the created block itself as the first block in the list */ UT_LIST_ADD_FIRST(list, block->base, block); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG if (block == NULL) { @@ -426,7 +426,7 @@ mem_heap_create_func( mem_hash_insert(block, file_name, line); - #endif +#endif return(block); } @@ -452,14 +452,14 @@ mem_heap_free_func( block = UT_LIST_GET_LAST(heap->base); - #ifdef UNIV_MEM_DEBUG +#ifdef UNIV_MEM_DEBUG /* In the debug version remove the heap from the hash table of heaps and check its consistency */ mem_hash_remove(heap, file_name, line); - #endif +#endif if (heap->free_block) { mem_heap_free_block_free(heap); diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h index 97a59fd14c7..0074de537c3 100644 --- a/innobase/include/srv0start.h +++ b/innobase/include/srv0start.h @@ -21,16 +21,6 @@ srv_normalize_path_for_win( /*=======================*/ char* str); /* in/out: null-terminated character string */ /************************************************************************* -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, own: string which has the separator if the - string is not empty */ - char* str); /* in: null-terminated character string */ -/************************************************************************* Reads the data files and their sizes from a character string given in the .cnf file. */ diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic index 36ef0a985ed..caf6f5f1de4 100644 --- a/innobase/include/sync0rw.ic +++ b/innobase/include/sync0rw.ic @@ -140,10 +140,10 @@ rw_lock_s_lock_low( /* Set the shared lock by incrementing the reader count */ lock->reader_count++; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_add_debug_info(lock, pass, RW_LOCK_SHARED, file_name, line); - #endif +#endif lock->last_s_file_name = file_name; lock->last_s_line = line; @@ -175,9 +175,9 @@ rw_lock_s_lock_direct( lock->last_s_file_name = file_name; lock->last_s_line = line; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_add_debug_info(lock, 0, RW_LOCK_SHARED, file_name, line); - #endif +#endif } /********************************************************************** @@ -204,9 +204,9 @@ rw_lock_x_lock_direct( lock->last_x_file_name = file_name; lock->last_x_line = line; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_add_debug_info(lock, 0, RW_LOCK_EX, file_name, line); - #endif +#endif } /********************************************************************** @@ -275,10 +275,10 @@ rw_lock_s_lock_func_nowait( /* Set the shared lock by incrementing the reader count */ lock->reader_count++; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_add_debug_info(lock, 0, RW_LOCK_SHARED, file_name, line); - #endif +#endif lock->last_s_file_name = file_name; lock->last_s_line = line; @@ -320,9 +320,9 @@ rw_lock_x_lock_func_nowait( lock->writer_count++; lock->pass = 0; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_add_debug_info(lock, 0, RW_LOCK_EX, file_name, line); - #endif +#endif lock->last_x_file_name = file_name; lock->last_x_line = line; @@ -361,9 +361,9 @@ rw_lock_s_unlock_func( ut_a(lock->reader_count > 0); lock->reader_count--; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_remove_debug_info(lock, pass, RW_LOCK_SHARED); - #endif +#endif /* If there may be waiters and this was the last s-lock, signal the object */ @@ -402,9 +402,9 @@ rw_lock_s_unlock_direct( lock->reader_count--; - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_remove_debug_info(lock, 0, RW_LOCK_SHARED); - #endif +#endif ut_ad(!lock->waiters); ut_ad(rw_lock_validate(lock)); @@ -442,9 +442,9 @@ rw_lock_x_unlock_func( rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED); } - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_remove_debug_info(lock, pass, RW_LOCK_EX); - #endif +#endif /* If there may be waiters, signal the lock */ if (lock->waiters && (lock->writer_count == 0)) { @@ -486,9 +486,9 @@ rw_lock_x_unlock_direct( rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED); } - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG rw_lock_remove_debug_info(lock, 0, RW_LOCK_EX); - #endif +#endif ut_ad(!lock->waiters); ut_ad(rw_lock_validate(lock)); diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic index c11cc0d196e..816b44a5bd3 100644 --- a/innobase/include/sync0sync.ic +++ b/innobase/include/sync0sync.ic @@ -250,9 +250,9 @@ mutex_enter_func( if (!mutex_test_and_set(mutex)) { - #ifdef UNIV_SYNC_DEBUG +#ifdef UNIV_SYNC_DEBUG mutex_set_debug_info(mutex, file_name, line); - #endif +#endif mutex->file_name = file_name; mutex->line = line; diff --git a/innobase/include/univold.i b/innobase/include/univold.i deleted file mode 100644 index 8bcd28e180f..00000000000 --- a/innobase/include/univold.i +++ /dev/null @@ -1,164 +0,0 @@ -/*************************************************************************** -Version control for database, common definitions, and include files - -(c) 1994 - 2000 Innobase Oy - -Created 1/20/1994 Heikki Tuuri -****************************************************************************/ - -#ifndef univ_i -#define univ_i - -#define UNIV_INTEL -#define UNIV_PENTIUM -/* If UNIV_WINNT is not defined, we assume Windows 95 */ - -#define UNIV_WINNT -#define UNIV_WINNT4 -#define __NT__ - -#define UNIV_VISUALC - -#define __WIN__ -#define _WIN32_WINNT 0x0400 - -/* DEBUG VERSION CONTROL - ===================== */ -/* Make a non-inline debug version */ -/* -#define UNIV_DEBUG -#define UNIV_MEM_DEBUG -#define UNIV_SYNC_DEBUG -#define UNIV_SEARCH_DEBUG - -#define UNIV_IBUF_DEBUG - -#define UNIV_SEARCH_PERF_STAT -#define UNIV_SYNC_PERF_STAT -*/ -#define UNIV_LIGHT_MEM_DEBUG - -#define YYDEBUG 1 -/* -#define UNIV_SQL_DEBUG -#define UNIV_LOG_DEBUG -*/ - /* the above option prevents forcing of log to disk - at a buffer page write: it should be tested with this - option off; also some ibuf tests are suppressed */ -/* -#define UNIV_BASIC_LOG_DEBUG -*/ - /* the above option enables basic recovery debugging: - new allocated file pages are reset */ - -/* The debug version is slower, thus we may change the length of test loops -depending on the UNIV_DBC parameter */ -#ifdef UNIV_DEBUG -#define UNIV_DBC 1 -#else -#define UNIV_DBC 100 -#endif - -#ifndef UNIV_DEBUG -/* Definition for inline version */ - -#ifdef UNIV_VISUALC -#define UNIV_INLINE __inline -#elif defined(UNIV_GNUC) -#define UNIV_INLINE extern __inline__ -#endif - -#else -/* If we want to compile a noninlined version we use the following macro -definitions: */ - -#define UNIV_NONINL -#define UNIV_INLINE - -#endif /* UNIV_DEBUG */ -/* If the compiler does not know inline specifier, we use: */ -/* -#define UNIV_INLINE static -*/ - - -/* - MACHINE VERSION CONTROL - ======================= -*/ - -#ifdef UNIV_PENTIUM - -/* In a 32-bit computer word size is 4 */ -#define UNIV_WORD_SIZE 4 - -/* The following alignment is used in memory allocations in memory heap -management to ensure correct alignment for doubles etc. */ -#define UNIV_MEM_ALIGNMENT 8 - -/* The following alignment is used in aligning lints etc. */ -#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE - -#endif - -/* - DATABASE VERSION CONTROL - ======================== -*/ - -/* The universal page size of the database */ -#define UNIV_PAGE_SIZE (2 * 8192)/* NOTE! Currently, this has to be a - power of 2 and divisible by - UNIV_MEM_ALIGNMENT */ - -/* Do non-buffered io in buffer pool read/write operations */ -#define UNIV_NON_BUFFERED_IO - -/* Maximum number of parallel threads in a parallelized operation */ -#define UNIV_MAX_PARALLELISM 32 - -/* - UNIVERSAL TYPE DEFINITIONS - ========================== -*/ - - -typedef unsigned char byte; - -/* An other basic type we use is unsigned long integer which is intended to be -equal to the word size of the machine. */ - -typedef unsigned long int ulint; - -typedef long int lint; - -/* The following type should be at least a 64-bit floating point number */ -typedef double utfloat; - -/* The 'undefined' value for a ulint */ -#define ULINT_UNDEFINED ((ulint)(-1)) - -/* The undefined 32-bit unsigned integer */ -#define ULINT32_UNDEFINED 0xFFFFFFFF - -/* Maximum value for a ulint */ -#define ULINT_MAX ((ulint)(-2)) - - -/* Definition of the boolean type */ -typedef ulint bool; - -#define TRUE 1 -#define FALSE 0 - -/* The following number as the length of a logical field means that the field -has the SQL NULL as its value. */ -#define UNIV_SQL_NULL ULINT_UNDEFINED - -#include <stdio.h> -#include "ut0dbg.h" -#include "ut0ut.h" -#include "db0err.h" - -#endif diff --git a/innobase/include/univoldmysql.i b/innobase/include/univoldmysql.i deleted file mode 100644 index 269b584d073..00000000000 --- a/innobase/include/univoldmysql.i +++ /dev/null @@ -1,181 +0,0 @@ -/*************************************************************************** -Version control for database, common definitions, and include files - -(c) 1994 - 1996 Innobase Oy - -Created 1/20/1994 Heikki Tuuri -****************************************************************************/ - -#ifndef univ_i -#define univ_i - -#define UNIV_INTEL -#define UNIV_PENTIUM -/* If UNIV_WINNT is not defined, we assume Windows 95 */ - -#define UNIV_WINNT -#define UNIV_WINNT4 - -#define UNIV_VISUALC - -/* DEBUG VERSION CONTROL - ===================== */ -/* Make a profiler version where mutex_fence does not use CPUID and therefore -is not totally safe. The sync-library must be recompiled before profiling. */ -/* -#define UNIV_PROFILE -*/ -/* When the following flag is defined, also mutex lock word reset to 0 -in mutex_exit is performed using a serializing instruction, which does not -allow speculative reads be performed before memory writes */ -/* -#define SYNC_SERIALIZE_MUTEX_RESET -*/ -/* Make a non-inline debug version */ - -#define UNIV_DEBUG -#define UNIV_MEM_DEBUG -#define UNIV_SYNC_DEBUG -#define UNIV_SEARCH_DEBUG - -#define UNIV_IBUF_DEBUG - -#define UNIV_SEARCH_PERF_STAT -#define UNIV_SYNC_PERF_STAT - - -#define UNIV_LIGHT_MEM_DEBUG - -#define YYDEBUG 1 -/* -#define UNIV_SQL_DEBUG -#define UNIV_LOG_DEBUG -*/ - /* the above option prevents forcing of log to disk - at a buffer page write: it should be tested with this - option off; also some ibuf tests are suppressed */ -/* -#define UNIV_BASIC_LOG_DEBUG -*/ - /* the above option enables basic recovery debugging: - new allocated file pages are reset */ - -/* The debug version is slower, thus we may change the length of test loops -depending on the UNIV_DBC parameter */ -#ifdef UNIV_DEBUG -#define UNIV_DBC 1 -#else -#define UNIV_DBC 100 -#endif - -#ifndef UNIV_DEBUG -/* Definition for inline version */ - -#ifdef UNIV_VISUALC -#define UNIV_INLINE __inline -#elif defined(UNIV_GNUC) -#define UNIV_INLINE extern __inline__ -#endif - -#else -/* If we want to compile a noninlined version we use the following macro -definitions: */ - -#define UNIV_NONINL -#define UNIV_INLINE - -#endif /* UNIV_DEBUG */ -/* If the compiler does not know inline specifier, we use: */ -/* -#define UNIV_INLINE static -*/ - - -/* - MACHINE VERSION CONTROL - ======================= -*/ - -#ifdef UNIV_PENTIUM - -/* In a 32-bit computer word size is 4 */ -#define UNIV_WORD_SIZE 4 - -/* The following alignment is used in memory allocations in memory heap -management to ensure correct alignment for doubles etc. */ -#define UNIV_MEM_ALIGNMENT 8 - -/* The following alignment is used in aligning lints etc. */ -#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE - -#endif - -/* - DATABASE VERSION CONTROL - ======================== -*/ - -/* The universal page size of the database */ -#define UNIV_PAGE_SIZE 8192 /* NOTE! Currently, this has to be a - power of 2 and divisible by - UNIV_MEM_ALIGNMENT */ -/* 2-based logarithm of UNIV_PAGE_SIZE */ -#define UNIV_PAGE_SIZE_SHIFT 13 - -/* Do asynchronous io in buffer pool read/write operations */ -#ifdef UNIV_WINNT -#define UNIV_ASYNC_IO -#endif - -/* Do non-buffered io in buffer pool read/write operations */ -#define UNIV_NON_BUFFERED_IO - -/* Maximum number of parallel threads in a parallelized operation */ -#define UNIV_MAX_PARALLELISM 32 - -/* - UNIVERSAL TYPE DEFINITIONS - ========================== -*/ - -/* -typedef unsigned char byte; -*/ - -/* An other basic type we use is unsigned long integer which is intended to be -equal to the word size of the machine. */ - -typedef unsigned long int ulint; - -typedef long int lint; - -/* The following type should be at least a 64-bit floating point number */ -typedef double utfloat; - -/* The 'undefined' value for a ulint */ -#define ULINT_UNDEFINED ((ulint)(-1)) - -/* The undefined 32-bit unsigned integer */ -#define ULINT32_UNDEFINED 0xFFFFFFFF - -/* Maximum value for a ulint */ -#define ULINT_MAX ((ulint)(-2)) - -/* Definition of the boolean type */ -#ifndef bool -typedef ulint bool; -#endif - -#define TRUE 1 -#define FALSE 0 - -/* The following number as the length of a logical field means that the field -has the SQL NULL as its value. */ -#define UNIV_SQL_NULL ULINT_UNDEFINED - -#include <stdio.h> -#include "ut0dbg.h" -#include "ut0ut.h" -#include "db0err.h" - -#endif diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h index 365f828ecfc..e277d801672 100644 --- a/innobase/include/usr0sess.h +++ b/innobase/include/usr0sess.h @@ -66,28 +66,6 @@ sess_open( byte* addr_buf, /* in: client address */ ulint addr_len); /* in: client address length */ /************************************************************************* -Closes a session, freeing the memory occupied by it. */ - -void -sess_close( -/*=======*/ - sess_t* sess); /* in, own: session object */ -/************************************************************************* -Raises an SQL error. */ - -void -sess_raise_error_low( -/*=================*/ - trx_t* trx, /* in: transaction */ - ulint err_no, /* in: error number */ - ulint type, /* in: more info of the error, or 0 */ - dict_table_t* table, /* in: dictionary table or NULL */ - dict_index_t* index, /* in: table index or NULL */ - dtuple_t* tuple, /* in: tuple to insert or NULL */ - rec_t* rec, /* in: record or NULL */ - char* err_str);/* in: arbitrary null-terminated error string, - or NULL */ -/************************************************************************* Closes a session, freeing the memory occupied by it, if it is in a state where it should be closed. */ @@ -117,16 +95,6 @@ sess_srv_msg_send_simple( ulint rel_kernel); /* in: SESS_RELEASE_KERNEL or SESS_NOT_RELEASE_KERNEL */ /*************************************************************************** -Processes a message from a client. NOTE: May release the kernel mutex -temporarily. */ - -void -sess_receive_msg_rel_kernel( -/*========================*/ - sess_t* sess, /* in: session */ - byte* str, /* in: message string */ - ulint len); /* in: message length */ -/*************************************************************************** When a command has been completed, this function sends the message about it to the client. */ @@ -136,17 +104,6 @@ sess_command_completed_message( sess_t* sess, /* in: session */ byte* msg, /* in: message buffer */ ulint len); /* in: message data length */ -/*********************************************************************** -Starts a new connection and a session, or starts a query based on a client -message. This is called by a SRV_COM thread. */ - -void -sess_process_cli_msg( -/*=================*/ - byte* str, /* in: message string */ - ulint len, /* in: string length */ - byte* addr, /* in: address string */ - ulint alen); /* in: address length */ /* The session handle. All fields are protected by the kernel mutex */ diff --git a/innobase/include/ut0rnd.ic b/innobase/include/ut0rnd.ic index e166a26fe86..5493c37404a 100644 --- a/innobase/include/ut0rnd.ic +++ b/innobase/include/ut0rnd.ic @@ -176,19 +176,19 @@ ut_fold_string( /* out: folded value */ char* str) /* in: null-terminated string */ { - #ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG ulint i = 0; - #endif +#endif ulint fold = 0; ut_ad(str); while (*str != '\0') { - #ifdef UNIV_DEBUG +#ifdef UNIV_DEBUG i++; ut_a(i < 100); - #endif +#endif fold = ut_fold_ulint_pair(fold, (ulint)(*str)); str++; |