summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-12-22 09:31:24 +0300
committerAlexander Nozdrin <alik@sun.com>2009-12-22 09:31:24 +0300
commitf238adf75d6bce104678be4e4a4a1d0bfde890c5 (patch)
tree54f1c9bcd072587e1860fe234c3264734b3b8dc5 /storage
parent6ddab77da26d4529db403e573298f927d315adeb (diff)
parent23e70189ab6412aa7af04dd81fe1b446b5f674c7 (diff)
downloadmariadb-git-f238adf75d6bce104678be4e4a4a1d0bfde890c5.tar.gz
Manual merge from mysql-trunk.
Conflicts: - storage/ibmdb2i/ha_ibmdb2i.cc
Diffstat (limited to 'storage')
-rw-r--r--storage/ibmdb2i/db2i_constraints.cc28
-rw-r--r--storage/ibmdb2i/ha_ibmdb2i.cc2
-rw-r--r--storage/innobase/CMakeLists.txt14
-rw-r--r--storage/innobase/handler/ha_innodb.cc3
-rw-r--r--storage/myisam/mi_packrec.c41
-rw-r--r--storage/myisam/mi_static.c3
-rw-r--r--storage/myisam/myisamdef.h1
7 files changed, 46 insertions, 46 deletions
diff --git a/storage/ibmdb2i/db2i_constraints.cc b/storage/ibmdb2i/db2i_constraints.cc
index 50af6c27898..cc2821238b6 100644
--- a/storage/ibmdb2i/db2i_constraints.cc
+++ b/storage/ibmdb2i/db2i_constraints.cc
@@ -329,7 +329,7 @@ char* ha_ibmdb2i::get_foreign_key_create_info(void)
/* Process the constraint name. */
- info.strncat(STRING_WITH_LEN(" CONSTRAINT "));
+ info.strncat(STRING_WITH_LEN(",\n CONSTRAINT "));
convNameForCreateInfo(thd, info,
FKCstDef->CstName.Name, FKCstDef->CstName.Len);
@@ -398,7 +398,6 @@ char* ha_ibmdb2i::get_foreign_key_create_info(void)
if ((i+1) < cstCnt)
{
- info.strcat(',');
tempPtr = (char*)cstHdr + cstHdr->CstLen;
cstHdr = (constraint_hdr_t*)(tempPtr);
}
@@ -671,28 +670,3 @@ uint ha_ibmdb2i::referenced_by_foreign_key(void)
}
DBUG_RETURN(count);
}
-
-
-bool ha_ibmdb2i::check_if_incompatible_data(HA_CREATE_INFO *info,
- uint table_changes)
-{
- DBUG_ENTER("ha_ibmdb2i::check_if_incompatible_data");
- uint i;
- /* Check that auto_increment value and field definitions were
- not changed. */
- if ((info->used_fields & HA_CREATE_USED_AUTO &&
- info->auto_increment_value != 0) ||
- table_changes != IS_EQUAL_YES)
- DBUG_RETURN(COMPATIBLE_DATA_NO);
- /* Check if any fields were renamed. */
- for (i= 0; i < table->s->fields; i++)
- {
- Field *field= table->field[i];
- if (field->flags & FIELD_IS_RENAMED)
- {
- DBUG_PRINT("info", ("Field has been renamed, copy table"));
- DBUG_RETURN(COMPATIBLE_DATA_NO);
- }
- }
- DBUG_RETURN(COMPATIBLE_DATA_YES);
-}
diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc
index 759562e3217..81d7e59d8e3 100644
--- a/storage/ibmdb2i/ha_ibmdb2i.cc
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc
@@ -284,7 +284,7 @@ static int ibmdb2i_init_func(void *p)
was_ILE_inited = false;
ibmdb2i_hton= (handlerton *)p;
VOID(pthread_mutex_init(&ibmdb2i_mutex,MY_MUTEX_INIT_FAST));
- (void) my_hash_init(&ibmdb2i_open_tables,system_charset_info,32,0,0,
+ (void) my_hash_init(&ibmdb2i_open_tables,table_alias_charset,32,0,0,
(my_hash_get_key) ibmdb2i_get_key,0,0);
ibmdb2i_hton->state= SHOW_OPTION_YES;
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index d67b518642c..3f9808a2022 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -15,13 +15,6 @@
# This is the CMakeLists for InnoDB Plugin
-
-# TODO: remove the two FLAGS_DEBUG settings when merging into
-# 6.0-based trees, like is already the case for other engines in
-# those trees.
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
# Starting at 5.1.38, MySQL CMake files are simplified. But the plugin
# CMakeLists.txt still needs to work with previous versions of MySQL.
IF (MYSQL_VERSION_ID GREATER "50137")
@@ -93,10 +86,5 @@ IF (MYSQL_VERSION_ID GREATER "50137")
SET_TARGET_PROPERTIES(ha_innobase PROPERTIES OUTPUT_NAME ha_innodb)
ENDIF(LIB_LOCATION)
ELSE (MYSQL_VERSION_ID GREATER "50137")
- IF (NOT SOURCE_SUBLIBS)
- ADD_DEFINITIONS(-D_WIN32 -DMYSQL_SERVER)
- ADD_LIBRARY(innobase STATIC ${INNOBASE_SOURCES})
- # Require mysqld_error.h, which is built as part of the GenError
- ADD_DEPENDENCIES(innobase GenError)
- ENDIF (NOT SOURCE_SUBLIBS)
+ MYSQL_STORAGE_ENGINE(INNODB_PLUGIN)
ENDIF (MYSQL_VERSION_ID GREATER "50137")
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 1c3a86fb2b3..57d4d8bf16e 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -110,9 +110,6 @@ extern "C" {
# ifndef MYSQL_PLUGIN_IMPORT
# define MYSQL_PLUGIN_IMPORT /* nothing */
# endif /* MYSQL_PLUGIN_IMPORT */
-/* This is needed because of Bug #3596. Let us hope that pthread_mutex_t
-is defined the same in both builds: the MySQL server and the InnoDB plugin. */
-extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count;
#if MYSQL_VERSION_ID < 50124
/* this is defined in mysql_priv.h inside #ifdef MYSQL_SERVER
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 5ef9aa7f88f..7f048ed62e3 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1492,20 +1492,54 @@ static int _mi_read_rnd_mempack_record(MI_INFO*, uchar *,my_off_t, my_bool);
my_bool _mi_memmap_file(MI_INFO *info)
{
MYISAM_SHARE *share=info->s;
+ my_bool eom;
+
DBUG_ENTER("mi_memmap_file");
if (!info->s->file_map)
{
+ my_off_t data_file_length= share->state.state.data_file_length;
+
+ if (myisam_mmap_size != SIZE_T_MAX)
+ {
+ pthread_mutex_lock(&THR_LOCK_myisam_mmap);
+ eom= data_file_length > myisam_mmap_size - myisam_mmap_used - MEMMAP_EXTRA_MARGIN;
+ if (!eom)
+ myisam_mmap_used+= data_file_length + MEMMAP_EXTRA_MARGIN;
+ pthread_mutex_unlock(&THR_LOCK_myisam_mmap);
+ }
+ else
+ eom= data_file_length > myisam_mmap_size - MEMMAP_EXTRA_MARGIN;
+
+ if (eom)
+ {
+ DBUG_PRINT("warning", ("File is too large for mmap"));
+ DBUG_RETURN(0);
+ }
if (my_seek(info->dfile,0L,MY_SEEK_END,MYF(0)) <
share->state.state.data_file_length+MEMMAP_EXTRA_MARGIN)
{
DBUG_PRINT("warning",("File isn't extended for memmap"));
+ if (myisam_mmap_size != SIZE_T_MAX)
+ {
+ pthread_mutex_lock(&THR_LOCK_myisam_mmap);
+ myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN;
+ pthread_mutex_unlock(&THR_LOCK_myisam_mmap);
+ }
DBUG_RETURN(0);
}
if (mi_dynmap_file(info,
share->state.state.data_file_length +
MEMMAP_EXTRA_MARGIN))
+ {
+ if (myisam_mmap_size != SIZE_T_MAX)
+ {
+ pthread_mutex_lock(&THR_LOCK_myisam_mmap);
+ myisam_mmap_used-= data_file_length + MEMMAP_EXTRA_MARGIN;
+ pthread_mutex_unlock(&THR_LOCK_myisam_mmap);
+ }
DBUG_RETURN(0);
+ }
}
info->opt_flag|= MEMMAP_USED;
info->read_record= share->read_record= _mi_read_mempack_record;
@@ -1518,6 +1552,13 @@ void _mi_unmap_file(MI_INFO *info)
{
VOID(my_munmap((char*) info->s->file_map,
(size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
+
+ if (myisam_mmap_size != SIZE_T_MAX)
+ {
+ pthread_mutex_lock(&THR_LOCK_myisam_mmap);
+ myisam_mmap_used-= info->s->mmaped_length + MEMMAP_EXTRA_MARGIN;
+ pthread_mutex_unlock(&THR_LOCK_myisam_mmap);
+ }
}
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index a3ba785a94f..a43a099663b 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -40,7 +40,8 @@ ulong myisam_concurrent_insert= 0;
my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4;
-
+ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
+pthread_mutex_t THR_LOCK_myisam_mmap;
static int always_valid(const char *filename __attribute__((unused)))
{
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index b64c7f6bd7f..1aa900061f3 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -437,7 +437,6 @@ typedef struct st_mi_sort_param
#define MI_MAX_BLOCK_LENGTH ((((ulong) 1 << 24)-1) & (~ (ulong) (MI_DYN_ALIGN_SIZE-1)))
#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER+sizeof(uint32))
-#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for file */
#define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */
#define PACK_TYPE_SPACE_FIELDS 2