diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/archive/Makefile.am | 15 | ||||
-rw-r--r-- | storage/archive/ha_archive.cc | 14 | ||||
-rw-r--r-- | storage/blackhole/ha_blackhole.cc | 15 | ||||
-rw-r--r-- | storage/csv/ha_tina.cc | 26 | ||||
-rw-r--r-- | storage/csv/ha_tina.h | 1 | ||||
-rw-r--r-- | storage/example/ha_example.cc | 14 | ||||
-rw-r--r-- | storage/federated/ha_federated.cc | 18 | ||||
-rw-r--r-- | storage/innobase/CMakeLists.txt | 12 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | storage/innobase/include/handler0alter.h | 4 | ||||
-rw-r--r-- | storage/innobase/include/row0merge.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/row0types.h | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.c | 12 |
13 files changed, 74 insertions, 63 deletions
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am index 319ed467966..143d684025e 100644 --- a/storage/archive/Makefile.am +++ b/storage/archive/Makefile.am @@ -1,4 +1,5 @@ # Copyright (C) 2005-2006 MySQL AB +# Copyright (C) 2009 SUN Microsystems # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -68,14 +69,23 @@ archive_reader_LDFLAGS = @NOINST_LDFLAGS@ EXTRA_DIST = CMakeLists.txt plug.in if HAVE_DTRACE_DASH_G +# The object for static and dynamic linking of archive differ +# For static linkage of archive to mysqld libarchive_a_LIBADD = probes_mysql.o libarchive_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers -CLEANFILES = probes_mysql.o dtrace_files dtrace_providers +# For archive as shared library +ha_archive_la_LIBADD = probes_sh_mysql.o +ha_archive_la_DEPENDENCIES = probes_sh_mysql.o dtrace_shared_files dtrace_providers + +CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers dtrace_shared_files DTRACEFILES = libarchive_a-ha_archive.o +DTRACESHAREDFILES = .libs/ha_archive_la-ha_archive.o DTRACEPROVIDER = probes_mysql.d dtrace_files: echo $(DTRACEFILES) > $@ +dtrace_shared_files: + echo $(DTRACESHAREDFILES) > $@ dtrace_providers: probes_mysql.d echo $(DTRACEPROVIDER) > $@ probes_mysql.d: @@ -83,6 +93,9 @@ probes_mysql.d: $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d echo timestamp > dtrace_sources +probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDFILES) + $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@ + probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES) $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@ endif diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index bdad3e42e44..1cb9b8bba80 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -172,8 +172,8 @@ int archive_db_init(void *p) if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)) goto error; - if (hash_init(&archive_open_tables, table_alias_charset, 32, 0, 0, - (hash_get_key) archive_get_key, 0, 0)) + if (my_hash_init(&archive_open_tables, table_alias_charset, 32, 0, 0, + (my_hash_get_key) archive_get_key, 0, 0)) { VOID(pthread_mutex_destroy(&archive_mutex)); } @@ -198,7 +198,7 @@ error: int archive_db_done(void *p) { - hash_free(&archive_open_tables); + my_hash_free(&archive_open_tables); VOID(pthread_mutex_destroy(&archive_mutex)); return 0; @@ -316,9 +316,9 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc) pthread_mutex_lock(&archive_mutex); length=(uint) strlen(table_name); - if (!(share=(ARCHIVE_SHARE*) hash_search(&archive_open_tables, - (uchar*) table_name, - length))) + if (!(share=(ARCHIVE_SHARE*) my_hash_search(&archive_open_tables, + (uchar*) table_name, + length))) { char *tmp_name; azio_stream archive_tmp; @@ -394,7 +394,7 @@ int ha_archive::free_share() pthread_mutex_lock(&archive_mutex); if (!--share->use_count) { - hash_delete(&archive_open_tables, (uchar*) share); + my_hash_delete(&archive_open_tables, (uchar*) share); thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); /* diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc index 03ed57f38e8..e64933f6629 100644 --- a/storage/blackhole/ha_blackhole.cc +++ b/storage/blackhole/ha_blackhole.cc @@ -319,8 +319,9 @@ static st_blackhole_share *get_share(const char *table_name) length= (uint) strlen(table_name); pthread_mutex_lock(&blackhole_mutex); - if (!(share= (st_blackhole_share*) hash_search(&blackhole_open_tables, - (uchar*) table_name, length))) + if (!(share= (st_blackhole_share*) + my_hash_search(&blackhole_open_tables, + (uchar*) table_name, length))) { if (!(share= (st_blackhole_share*) my_malloc(sizeof(st_blackhole_share) + length, @@ -350,7 +351,7 @@ static void free_share(st_blackhole_share *share) { pthread_mutex_lock(&blackhole_mutex); if (!--share->use_count) - hash_delete(&blackhole_open_tables, (uchar*) share); + my_hash_delete(&blackhole_open_tables, (uchar*) share); pthread_mutex_unlock(&blackhole_mutex); } @@ -377,16 +378,16 @@ static int blackhole_init(void *p) blackhole_hton->flags= HTON_CAN_RECREATE; VOID(pthread_mutex_init(&blackhole_mutex, MY_MUTEX_INIT_FAST)); - (void) hash_init(&blackhole_open_tables, system_charset_info,32,0,0, - (hash_get_key) blackhole_get_key, - (hash_free_key) blackhole_free_key, 0); + (void) my_hash_init(&blackhole_open_tables, system_charset_info,32,0,0, + (my_hash_get_key) blackhole_get_key, + (my_hash_free_key) blackhole_free_key, 0); return 0; } static int blackhole_fini(void *p) { - hash_free(&blackhole_open_tables); + my_hash_free(&blackhole_open_tables); pthread_mutex_destroy(&blackhole_mutex); return 0; diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 07c4785ab90..9cc0f1e607b 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -111,8 +111,8 @@ static int tina_init_func(void *p) tina_hton= (handlerton *)p; VOID(pthread_mutex_init(&tina_mutex,MY_MUTEX_INIT_FAST)); - (void) hash_init(&tina_open_tables,system_charset_info,32,0,0, - (hash_get_key) tina_get_key,0,0); + (void) my_hash_init(&tina_open_tables,system_charset_info,32,0,0, + (my_hash_get_key) tina_get_key,0,0); tina_hton->state= SHOW_OPTION_YES; tina_hton->db_type= DB_TYPE_CSV_DB; tina_hton->create= tina_create_handler; @@ -123,7 +123,7 @@ static int tina_init_func(void *p) static int tina_done_func(void *p) { - hash_free(&tina_open_tables); + my_hash_free(&tina_open_tables); pthread_mutex_destroy(&tina_mutex); return 0; @@ -148,9 +148,9 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) If share is not present in the hash, create a new share and initialize its members. */ - if (!(share=(TINA_SHARE*) hash_search(&tina_open_tables, - (uchar*) table_name, - length))) + if (!(share=(TINA_SHARE*) my_hash_search(&tina_open_tables, + (uchar*) table_name, + length))) { if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), &share, sizeof(*share), @@ -377,7 +377,7 @@ static int free_share(TINA_SHARE *share) share->tina_write_opened= FALSE; } - hash_delete(&tina_open_tables, (uchar*) share); + my_hash_delete(&tina_open_tables, (uchar*) share); thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); my_free((uchar*) share, MYF(0)); @@ -448,6 +448,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg) buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin); chain= chain_buffer; file_buff= new Transparent_file(); + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);; } @@ -594,7 +595,7 @@ int ha_tina::find_current_row(uchar *buf) bool read_all; DBUG_ENTER("ha_tina::find_current_row"); - free_root(&blobroot, MYF(MY_MARK_BLOCKS_FREE)); + free_root(&blobroot, MYF(0)); /* We do not read further then local_saved_data_file_length in order @@ -1073,8 +1074,6 @@ int ha_tina::rnd_init(bool scan) records_is_known= 0; chain_ptr= chain; - init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); - DBUG_RETURN(0); } @@ -1192,6 +1191,7 @@ int ha_tina::extra(enum ha_extra_function operation) DBUG_RETURN(0); } + /* Set end_pos to the last valid byte of continuous area, closest to the given "hole", stored in the buffer. "Valid" here means, @@ -1394,8 +1394,6 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) /* set current position to the beginning of the file */ current_position= next_position= 0; - init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); - /* Read the file row-by-row. If everything is ok, repair is not needed. */ while (!(rc= find_current_row(buf))) { @@ -1595,8 +1593,6 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) /* set current position to the beginning of the file */ current_position= next_position= 0; - init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); - /* Read the file row-by-row. If everything is ok, repair is not needed. */ while (!(rc= find_current_row(buf))) { @@ -1604,7 +1600,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) count--; current_position= next_position; } - + free_root(&blobroot, MYF(0)); my_free((char*)buf, MYF(0)); diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 02e0700a825..a246d1858e5 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -98,6 +98,7 @@ public: my_free(chain, 0); if (file_buff) delete file_buff; + free_root(&blobroot, MYF(0)); } const char *table_type() const { return "CSV"; } const char *index_type(uint inx) { return "NONE"; } diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 4b982f2943f..9bc666663c3 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -133,8 +133,8 @@ static int example_init_func(void *p) example_hton= (handlerton *)p; VOID(pthread_mutex_init(&example_mutex,MY_MUTEX_INIT_FAST)); - (void) hash_init(&example_open_tables,system_charset_info,32,0,0, - (hash_get_key) example_get_key,0,0); + (void) my_hash_init(&example_open_tables,system_charset_info,32,0,0, + (my_hash_get_key) example_get_key,0,0); example_hton->state= SHOW_OPTION_YES; example_hton->create= example_create_handler; @@ -151,7 +151,7 @@ static int example_done_func(void *p) if (example_open_tables.records) error= 1; - hash_free(&example_open_tables); + my_hash_free(&example_open_tables); pthread_mutex_destroy(&example_mutex); DBUG_RETURN(0); @@ -175,9 +175,9 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) pthread_mutex_lock(&example_mutex); length=(uint) strlen(table_name); - if (!(share=(EXAMPLE_SHARE*) hash_search(&example_open_tables, - (uchar*) table_name, - length))) + if (!(share=(EXAMPLE_SHARE*) my_hash_search(&example_open_tables, + (uchar*) table_name, + length))) { if (!(share=(EXAMPLE_SHARE *) my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), @@ -222,7 +222,7 @@ static int free_share(EXAMPLE_SHARE *share) pthread_mutex_lock(&example_mutex); if (!--share->use_count) { - hash_delete(&example_open_tables, (uchar*) share); + my_hash_delete(&example_open_tables, (uchar*) share); thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); my_free(share, MYF(0)); diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index a3fa42d7d05..05be8b27a8b 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -459,8 +459,8 @@ int federated_db_init(void *p) if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)) goto error; - if (!hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0, - (hash_get_key) federated_get_key, 0, 0)) + if (!my_hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0, + (my_hash_get_key) federated_get_key, 0, 0)) { DBUG_RETURN(FALSE); } @@ -483,7 +483,7 @@ error: int federated_done(void *p) { - hash_free(&federated_open_tables); + my_hash_free(&federated_open_tables); VOID(pthread_mutex_destroy(&federated_mutex)); return 0; @@ -1495,10 +1495,10 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) goto error; /* TODO: change tmp_share.scheme to LEX_STRING object */ - if (!(share= (FEDERATED_SHARE *) hash_search(&federated_open_tables, - (uchar*) tmp_share.share_key, - tmp_share. - share_key_length))) + if (!(share= (FEDERATED_SHARE *) my_hash_search(&federated_open_tables, + (uchar*) tmp_share.share_key, + tmp_share. + share_key_length))) { query.set_charset(system_charset_info); query.append(STRING_WITH_LEN("SELECT ")); @@ -1560,7 +1560,7 @@ static int free_share(FEDERATED_SHARE *share) pthread_mutex_lock(&federated_mutex); if (!--share->use_count) { - hash_delete(&federated_open_tables, (uchar*) share); + my_hash_delete(&federated_open_tables, (uchar*) share); thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); free_root(&mem_root, MYF(0)); @@ -2892,7 +2892,7 @@ int ha_federated::info(uint flag) } if (flag & HA_STATUS_AUTO) - stats.auto_increment_value= mysql->last_used_con->insert_id; + stats.auto_increment_value= mysql->insert_id; mysql_free_result(result); diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 57ad7f4b28c..d67b518642c 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -86,12 +86,12 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ADD_DEFINITIONS(-DHAVE_WINDOWS_ATOMICS -DIB_HAVE_PAUSE_INSTRUCTION) IF (MYSQL_VERSION_ID GREATER "50137") - IF (WITH_INNOBASE_STORAGE_ENGINE) - MYSQL_STORAGE_ENGINE(INNOBASE) - ELSE (WITH_INNOBASE_STORAGE_ENGINE) - SET (INNODB_SOURCES ${INNOBASE_SOURCES}) - MYSQL_STORAGE_ENGINE(INNODB) - ENDIF (WITH_INNOBASE_STORAGE_ENGINE) + MYSQL_STORAGE_ENGINE(INNOBASE) + # Use ha_innodb for plugin name, if plugin is built + GET_TARGET_PROPERTY(LIB_LOCATION ha_innobase LOCATION) + IF(LIB_LOCATION) + 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) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b15212f74a7..eac9f9b0597 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4551,7 +4551,7 @@ calc_row_difference( upd_t* uvect, /*!< in/out: update vector */ uchar* old_row, /*!< in: old row in MySQL format */ uchar* new_row, /*!< in: new row in MySQL format */ - struct st_table* table, /*!< in: table in MySQL data + TABLE* table, /*!< in: table in MySQL data dictionary */ uchar* upd_buff, /*!< in: buffer to use */ ulint buff_len, /*!< in: buffer length */ diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h index 985b76f4f50..7f5af6d2e76 100644 --- a/storage/innobase/include/handler0alter.h +++ b/storage/innobase/include/handler0alter.h @@ -27,7 +27,7 @@ UNIV_INTERN void innobase_rec_to_mysql( /*==================*/ - TABLE* table, /*!< in/out: MySQL table */ + struct TABLE* table, /*!< in/out: MySQL table */ const rec_t* rec, /*!< in: record */ const dict_index_t* index, /*!< in: index */ const ulint* offsets); /*!< in: rec_get_offsets( @@ -39,4 +39,4 @@ UNIV_INTERN void innobase_rec_reset( /*===============*/ - TABLE* table); /*!< in/out: MySQL table */ + struct TABLE* table); /*!< in/out: MySQL table */ diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index 62a5efd11f7..fbeb125ce7b 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -191,7 +191,7 @@ row_merge_build_indexes( unless creating a PRIMARY KEY */ dict_index_t** indexes, /*!< in: indexes to be created */ ulint n_indexes, /*!< in: size of indexes[] */ - TABLE* table); /*!< in/out: MySQL table, for + struct TABLE* table); /*!< in/out: MySQL table, for reporting erroneous key value if applicable */ #endif /* row0merge.h */ diff --git a/storage/innobase/include/row0types.h b/storage/innobase/include/row0types.h index 7920fd75061..1be729206ba 100644 --- a/storage/innobase/include/row0types.h +++ b/storage/innobase/include/row0types.h @@ -54,6 +54,6 @@ typedef struct purge_node_struct purge_node_t; typedef struct row_ext_struct row_ext_t; /* MySQL data types */ -typedef struct st_table TABLE; +struct TABLE; #endif diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c index a303a2f3278..54d701444e2 100644 --- a/storage/innobase/row/row0merge.c +++ b/storage/innobase/row/row0merge.c @@ -408,7 +408,7 @@ row_merge_buf_add( /** Structure for reporting duplicate records. */ struct row_merge_dup_struct { const dict_index_t* index; /*!< index being sorted */ - TABLE* table; /*!< MySQL table object */ + struct TABLE* table; /*!< MySQL table object */ ulint n_dup; /*!< number of duplicates */ }; @@ -1100,7 +1100,7 @@ ulint row_merge_read_clustered_index( /*===========================*/ trx_t* trx, /*!< in: transaction */ - TABLE* table, /*!< in/out: MySQL table object, + struct TABLE* table, /*!< in/out: MySQL table object, for reporting erroneous records */ const dict_table_t* old_table,/*!< in: table where rows are read from */ @@ -1382,7 +1382,7 @@ row_merge_blocks( ulint* foffs1, /*!< in/out: offset of second source list in the file */ merge_file_t* of, /*!< in/out: output file */ - TABLE* table) /*!< in/out: MySQL table, for + struct TABLE* table) /*!< in/out: MySQL table, for reporting erroneous key value if applicable */ { @@ -1563,7 +1563,7 @@ row_merge( ulint* half, /*!< in/out: half the file */ row_merge_block_t* block, /*!< in/out: 3 buffers */ int* tmpfd, /*!< in/out: temporary file handle */ - TABLE* table) /*!< in/out: MySQL table, for + struct TABLE* table) /*!< in/out: MySQL table, for reporting erroneous key value if applicable */ { @@ -1658,7 +1658,7 @@ row_merge_sort( index entries */ row_merge_block_t* block, /*!< in/out: 3 buffers */ int* tmpfd, /*!< in/out: temporary file handle */ - TABLE* table) /*!< in/out: MySQL table, for + struct TABLE* table) /*!< in/out: MySQL table, for reporting erroneous key value if applicable */ { @@ -2437,7 +2437,7 @@ row_merge_build_indexes( unless creating a PRIMARY KEY */ dict_index_t** indexes, /*!< in: indexes to be created */ ulint n_indexes, /*!< in: size of indexes[] */ - TABLE* table) /*!< in/out: MySQL table, for + struct TABLE* table) /*!< in/out: MySQL table, for reporting erroneous key value if applicable */ { |