diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
commit | b4a0b2c2f862ab0de853dc34e1e56f6159043e45 (patch) | |
tree | 18a0c25fdc9ac0076da19247666414a46434b85e /storage | |
parent | 9809f05199aeb0b67991fac41bd86f38730768dc (diff) | |
download | mariadb-git-b4a0b2c2f862ab0de853dc34e1e56f6159043e45.tar.gz |
post-merge fixes.
most tests pass.
5.3 merge is next
Diffstat (limited to 'storage')
39 files changed, 49 insertions, 261 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index eeb9b12007b..3701957ec4f 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -822,29 +822,6 @@ int ha_example::delete_all_rows() /** @brief - Used for handler specific truncate table. The table is locked in - exclusive mode and handler is responsible for reseting the auto- - increment counter. - - @details - Called from Truncate_statement::handler_truncate. - Not used if the handlerton supports HTON_CAN_RECREATE, unless this - engine can be used as a partition. In this case, it is invoked when - a particular partition is to be truncated. - - @see - Truncate_statement in sql_truncate.cc - Remarks in handler::truncate. -*/ -int ha_example::truncate() -{ - DBUG_ENTER("ha_example::truncate"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - - -/** - @brief This create a lock on the table. If you are implementing a storage engine that can handle transacations look at ha_berkely.cc to see how you will want to go about doing this. Otherwise you should consider calling flock() diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index 98ef563b877..27b97395544 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -245,7 +245,6 @@ public: int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); ///< required int delete_all_rows(void); - int truncate(); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int delete_table(const char *from); diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 17412808d44..ab338d9281f 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -390,6 +390,12 @@ #include <mysql/plugin.h> +#ifdef I_AM_PARANOID +#define MIN_PORT 1023 +#else +#define MIN_PORT 0 +#endif + /* Variables for federated share methods */ static HASH federated_open_tables; // To track open tables mysql_mutex_t federated_mutex; // To init the hash @@ -624,11 +630,7 @@ int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share) share->username= server->username; share->password= server->password; share->database= server->db; -#ifndef I_AM_PARANOID - share->port= server->port > 0 && server->port < 65536 ? -#else - share->port= server->port > 1023 && server->port < 65536 ? -#endif + share->port= server->port > MIN_PORT && server->port < 65536 ? (ushort) server->port : MYSQL_PORT; share->hostname= server->host; if (!(share->socket= server->socket) && @@ -3044,16 +3046,6 @@ int ha_federated::delete_all_rows() /* - Used to manually truncate the table via a delete of all rows in a table. -*/ - -int ha_federated::truncate() -{ - return delete_all_rows(); -} - - -/* The idea with handler::store_lock() is the following: The statement decided which locks we should need for the table diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 0d79ffe38a6..ab14ddb5544 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -318,6 +318,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "sql_analyse.h" // append_escaped() #include "sql_show.h" // append_identifier() +#ifdef I_AM_PARANOID +#define MIN_PORT 1023 +#else +#define MIN_PORT 0 +#endif + /* Variables for federatedx share methods */ static HASH federatedx_open_tables; // To track open tables static HASH federatedx_open_servers; // To track open servers @@ -536,11 +542,7 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share) share->username= server->username; share->password= server->password; share->database= server->db; -#ifndef I_AM_PARANOID - share->port= server->port > 0 && server->port < 65536 ? -#else - share->port= server->port > 1023 && server->port < 65536 ? -#endif + share->port= server->port > MIN_PORT && server->port < 65536 ? (ushort) server->port : MYSQL_PORT; share->hostname= server->host; if (!(share->socket= server->socket) && @@ -557,9 +559,8 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share) DBUG_RETURN(0); error: - my_sprintf(error_buffer, - (error_buffer, "server name: '%s' doesn't exist!", - share->connection_string)); + sprintf(error_buffer, "server name: '%s' doesn't exist!", + share->connection_string); my_error(error_num, MYF(0), error_buffer); DBUG_RETURN(error_num); } @@ -2584,8 +2585,8 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index, if (io->query(sql_query.ptr(), sql_query.length())) { - my_sprintf(error_buffer, (error_buffer, "error: %d '%s'", - io->error_code(), io->error_str())); + sprintf(error_buffer, "error: %d '%s'", + io->error_code(), io->error_str()); retval= ER_QUERY_ON_FOREIGN_DATA_SOURCE; goto error; } @@ -3308,9 +3309,8 @@ static int test_connection(MYSQL_THD thd, federatedx_io *io, if ((retval= io->query(str.ptr(), str.length()))) { - my_sprintf(buffer, (buffer, - "database: '%s' username: '%s' hostname: '%s'", - share->database, share->username, share->hostname)); + sprintf(buffer, "database: '%s' username: '%s' hostname: '%s'", + share->database, share->username, share->hostname); DBUG_PRINT("info", ("error-code: %d", io->error_code())); my_error(ER_CANT_CREATE_FEDERATED_TABLE, MYF(0), buffer); } diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 96763f7ce31..93034ac0ad3 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -330,7 +330,7 @@ public: /* fix server to be able to get remote server table flags */ return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); } diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index fc6e89e54e0..e16a5e38a0f 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -455,13 +455,6 @@ int ha_heap::delete_all_rows() } -int ha_heap::truncate() -{ - int error= delete_all_rows(); - return error ? error : reset_auto_increment(0); -} - - int ha_heap::reset_auto_increment(ulonglong value) { file->s->auto_increment= value; diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index cc335870f06..c8652d6db69 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -99,7 +99,6 @@ public: int reset(); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - int truncate(); int reset_auto_increment(ulonglong value); int disable_indexes(uint mode); int enable_indexes(uint mode); diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 8227449679e..331257dbe3d 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -300,7 +300,7 @@ static void _ma_check_print_msg(HA_CHECK *param, const char *msg_type, THD *thd= (THD *) param->thd; Protocol *protocol= thd->protocol; uint length, msg_length; - char msgbuf[HA_MAX_MSG_BUF]; + char msgbuf[MYSQL_ERRMSG_SIZE]; char name[NAME_LEN * 2 + 2]; msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); @@ -827,15 +827,16 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | CANNOT_ROLLBACK_FLAG | - HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | + HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_REPAIR | HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), can_enable_indexes(1), bulk_insert_single_undo(BULK_INSERT_NONE) {} -handler *ha_maria::clone(MEM_ROOT *mem_root) +handler *ha_maria::clone(const char *name, MEM_ROOT *mem_root) { - ha_maria *new_handler= static_cast <ha_maria *>(handler::clone(mem_root)); + ha_maria *new_handler= static_cast <ha_maria *>(handler::clone(name, + mem_root)); if (new_handler) { new_handler->file->state= file->state; @@ -1937,8 +1938,8 @@ end: bool ha_maria::check_and_repair(THD *thd) { int error, crashed; - LEX_STRING old_query; HA_CHECK_OPT check_opt; + const CSET_STRING query_backup= thd->query_string; DBUG_ENTER("ha_maria::check_and_repair"); check_opt.init(); @@ -1967,10 +1968,8 @@ bool ha_maria::check_and_repair(THD *thd) if (!file->state->del && (maria_recover_options & HA_RECOVER_QUICK)) check_opt.flags |= T_QUICK; - old_query= thd->query_string; - mysql_mutex_lock(&LOCK_thread_count); - thd->query_string= table->s->table_name; - mysql_mutex_unlock(&LOCK_thread_count); + thd->set_query(table->s->table_name.str, + (uint) table->s->table_name.length, system_charset_info); if (!(crashed= maria_is_crashed(file))) { @@ -1988,9 +1987,7 @@ bool ha_maria::check_and_repair(THD *thd) if (repair(thd, &check_opt)) error= 1; } - mysql_mutex_lock(&LOCK_thread_count); - thd->query_string= old_query; - mysql_mutex_unlock(&LOCK_thread_count); + thd->set_query(query_backup); DBUG_RETURN(error); } @@ -2418,7 +2415,6 @@ int ha_maria::external_lock(THD *thd, int lock_type) if (file->trn) { /* This can only happen with tables created with clone() */ - DBUG_ASSERT(cloned); trnman_increment_locked_tables(file->trn); } diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 1e540fd5e7b..53df1d2cfa6 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -58,7 +58,7 @@ class ha_maria :public handler public: ha_maria(handlerton *hton, TABLE_SHARE * table_arg); ~ha_maria() {} - handler *clone(MEM_ROOT *mem_root); + handler *clone(const char *name, MEM_ROOT *mem_root); const char *table_type() const { return "Aria"; } const char *index_type(uint key_number); diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 41944753c98..84db7cc395a 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -4067,9 +4067,6 @@ err: int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, const char * name, my_bool rep_quick) { -#ifndef THREAD - return maria_repair_by_sort(param, info, name, rep_quick); -#else int got_error; uint i,key, total_key_length, istep; ha_rows start_records; @@ -4546,7 +4543,6 @@ err: if (!got_error && (param->testflag & T_UNPACK)) restore_data_file_type(share); DBUG_RETURN(got_error); -#endif /* THREAD */ } /* Read next record and return next key */ diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c index 2da40dcb8f6..0a36e52e4ae 100644 --- a/storage/maria/ma_close.c +++ b/storage/maria/ma_close.c @@ -113,7 +113,6 @@ int maria_close(register MARIA_HA *info) if (my_close(share->kfile.file, MYF(0))) error= my_errno; } -#ifdef THREAD thr_lock_delete(&share->lock); (void) pthread_mutex_destroy(&share->key_del_lock); { @@ -124,7 +123,6 @@ int maria_close(register MARIA_HA *info) rwlock_destroy(&share->keyinfo[i].root_lock); } } -#endif DBUG_ASSERT(share->now_transactional == share->base.born_transactional); /* We assign -1 because checkpoint does not need to flush (in case we diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c index 2c13ddfe5bb..22ffb05af38 100644 --- a/storage/maria/ma_delete.c +++ b/storage/maria/ma_delete.c @@ -118,7 +118,6 @@ int maria_delete(MARIA_HA *info,const uchar *record) mi_sizestore(lastpos, info->cur_row.lastpos); _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (info->invalidator != 0) { DBUG_PRINT("info", ("invalidator... '%s' (delete)", @@ -142,7 +141,6 @@ err: } _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); info->update|=HA_STATE_WRITTEN; /* Buffer changed */ - allow_break(); /* Allow SIGHUP & SIGINT */ if (save_errno == HA_ERR_KEY_NOT_FOUND) { maria_print_error(share, HA_ERR_CRASHED); diff --git a/storage/maria/ma_delete_all.c b/storage/maria/ma_delete_all.c index 2eb966bd7a7..940d4d00987 100644 --- a/storage/maria/ma_delete_all.c +++ b/storage/maria/ma_delete_all.c @@ -138,7 +138,6 @@ int maria_delete_all_rows(MARIA_HA *info) if (share->file_map) _ma_dynmap_file(info, (my_off_t) 0); #endif - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(0); err: @@ -146,7 +145,6 @@ err: int save_errno=my_errno; _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); info->update|=HA_STATE_WRITTEN; /* Buffer changed */ - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(my_errno=save_errno); } } /* maria_delete_all_rows */ diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c index 6668d0e5f3d..7fe0a97fa46 100644 --- a/storage/maria/ma_dynrec.c +++ b/storage/maria/ma_dynrec.c @@ -36,13 +36,11 @@ static my_bool delete_dynamic_record(MARIA_HA *info,MARIA_RECORD_POS filepos, static my_bool _ma_cmp_buffer(File file, const uchar *buff, my_off_t filepos, uint length); -#ifdef THREAD /* Play it safe; We have a small stack when using threads */ #undef my_alloca #undef my_afree #define my_alloca(A) my_malloc((A),MYF(0)) #define my_afree(A) my_free((A)) -#endif /* Interface function from MARIA_HA */ @@ -1597,9 +1595,6 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info, my_bool error= 1; DBUG_ENTER("_ma_cmp_dynamic_record"); - /* We are going to do changes; dont let anybody disturb */ - dont_break(); /* Dont allow SIGHUP or SIGINT */ - if (info->opt_flag & WRITE_CACHE_USED) { info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK); diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c index 34f55bd0bf8..af35bf37865 100644 --- a/storage/maria/ma_init.c +++ b/storage/maria/ma_init.c @@ -70,7 +70,6 @@ int maria_init(void) _ma_init_block_record_data(); trnman_end_trans_hook= _ma_trnman_end_trans_hook; maria_create_trn_hook= dummy_maria_create_trn_hook; - my_handler_error_register(); } my_hash_init(&maria_stored_state, &my_charset_bin, 32, 0, sizeof(LSN), 0, (my_hash_free_key) history_state_free, 0); diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 6de5253a2dd..abd7253e77a 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -1395,10 +1395,8 @@ my_bool _ma_lock_key_del(MARIA_HA *info, my_bool insert_at_end) info->key_del_used= 2; /* insert-with-append */ return 1; } -#ifdef THREAD while (share->key_del_used) pthread_cond_wait(&share->key_del_cond, &share->key_del_lock); -#endif info->key_del_used= 1; share->key_del_used= 1; share->key_del_current= share->state.key_del; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 606959c56a0..1a341110125 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -200,9 +200,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name, bzero(info.rec_buff, share->base.default_rec_buff_size); *m_info=info; -#ifdef THREAD thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info); -#endif m_info->open_list.data=(void*) m_info; maria_open_list=list_add(maria_open_list,&m_info->open_list); @@ -838,7 +836,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->state_history->next= 0; } } -#ifdef THREAD thr_lock_init(&share->lock); pthread_mutex_init(&share->intern_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&share->key_del_lock, MY_MUTEX_INIT_FAST); @@ -906,7 +903,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->lock.start_trans= _ma_block_start_trans_no_versioning; } } -#endif /* Memory mapping can only be requested after initializing intern_lock. */ diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 566131ec77b..5d192f9cfc2 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -528,7 +528,6 @@ static void pagecache_debug_print _VARARGS((const char *fmt, ...)); #endif /* defined(PAGECACHE_DEBUG_LOG) && defined(PAGECACHE_DEBUG) */ #if defined(PAGECACHE_DEBUG) || !defined(DBUG_OFF) -#ifdef THREAD static long pagecache_thread_id; #define KEYCACHE_THREAD_TRACE(l) \ KEYCACHE_DBUG_PRINT(l,("|thread %ld",pagecache_thread_id)) @@ -540,11 +539,6 @@ static long pagecache_thread_id; #define KEYCACHE_THREAD_TRACE_END(l) \ KEYCACHE_DBUG_PRINT(l,("]thread %ld",pagecache_thread_id)) -#else /* THREAD */ -#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,("")) -#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,("")) -#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,("")) -#endif /* THREAD */ #else #define KEYCACHE_THREAD_TRACE_BEGIN(l) #define KEYCACHE_THREAD_TRACE_END(l) @@ -945,11 +939,9 @@ ulong resize_pagecache(PAGECACHE *pagecache, uint age_threshold) { ulong blocks; -#ifdef THREAD struct st_my_thread_var *thread; WQUEUE *wqueue; -#endif DBUG_ENTER("resize_pagecache"); if (!pagecache->inited) @@ -963,7 +955,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, mysql_mutex_lock(&pagecache->cache_lock); -#ifdef THREAD wqueue= &pagecache->resize_queue; thread= my_thread_var; wqueue_link_into_queue(wqueue, thread); @@ -972,7 +963,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, { mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } -#endif pagecache->resize_in_flush= 1; if (flush_all_key_blocks(pagecache)) @@ -985,16 +975,12 @@ ulong resize_pagecache(PAGECACHE *pagecache, } pagecache->resize_in_flush= 0; pagecache->can_be_used= 0; -#ifdef THREAD while (pagecache->cnt_for_resize_op) { KEYCACHE_DBUG_PRINT("resize_pagecache: wait", ("suspend thread %ld", thread->id)); mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } -#else - KEYCACHE_DBUG_ASSERT(pagecache->cnt_for_resize_op == 0); -#endif end_pagecache(pagecache, 0); /* Don't free mutex */ /* The following will work even if use_mem is 0 */ @@ -1003,7 +989,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, pagecache->readwrite_flags); finish: -#ifdef THREAD wqueue_unlink_from_queue(wqueue, thread); /* Signal for the next resize request to proceeed if any */ if (wqueue->last_thread) @@ -1012,7 +997,6 @@ finish: ("thread %ld", wqueue->last_thread->next->id)); mysql_cond_signal(&wqueue->last_thread->next->suspend); } -#endif mysql_mutex_unlock(&pagecache->cache_lock); DBUG_RETURN(blocks); } @@ -1034,7 +1018,6 @@ static inline void inc_counter_for_resize_op(PAGECACHE *pagecache) */ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) { -#ifdef THREAD struct st_my_thread_var *last_thread; if (!--pagecache->cnt_for_resize_op && (last_thread= pagecache->resize_queue.last_thread)) @@ -1043,9 +1026,6 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) ("thread %ld", last_thread->next->id)); mysql_cond_signal(&last_thread->next->suspend); } -#else - pagecache->cnt_for_resize_op--; -#endif } /* @@ -1246,7 +1226,6 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, PCBLOCK_INFO(block); KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); -#ifdef THREAD if (!hot && pagecache->waiting_for_block.last_thread) { /* Signal that in the LRU warm sub-chain an available block has appeared */ @@ -1284,10 +1263,6 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, #endif return; } -#else /* THREAD */ - KEYCACHE_DBUG_ASSERT(! (!hot && pagecache->waiting_for_block.last_thread)); - /* Condition not transformed using DeMorgan, to keep the text identical */ -#endif /* THREAD */ ptr_ins= hot ? &pagecache->used_ins : &pagecache->used_last; ins= *ptr_ins; if (ins) @@ -1485,12 +1460,8 @@ static inline void remove_reader(PAGECACHE_BLOCK_LINK *block) DBUG_ENTER("remove_reader"); PCBLOCK_INFO(block); DBUG_ASSERT(block->hash_link->requests > 0); -#ifdef THREAD if (! --block->hash_link->requests && block->condvar) mysql_cond_signal(block->condvar); -#else - --block->hash_link->requests; -#endif DBUG_VOID_RETURN; } @@ -1504,7 +1475,6 @@ static inline void wait_for_readers(PAGECACHE *pagecache __attribute__((unused)), PAGECACHE_BLOCK_LINK *block) { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; while (block->hash_link->requests) { @@ -1515,9 +1485,6 @@ static inline void wait_for_readers(PAGECACHE *pagecache mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); block->condvar= NULL; } -#else - KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0); -#endif } @@ -1549,7 +1516,6 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) if ((*hash_link->prev= hash_link->next)) hash_link->next->prev= hash_link->prev; hash_link->block= NULL; -#ifdef THREAD if (pagecache->waiting_for_hash_link.last_thread) { /* Signal that a free hash link has appeared */ @@ -1588,9 +1554,6 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) hash_link); return; } -#else /* THREAD */ - KEYCACHE_DBUG_ASSERT(! (pagecache->waiting_for_hash_link.last_thread)); -#endif /* THREAD */ hash_link->next= pagecache->free_hash_list; pagecache->free_hash_list= hash_link; } @@ -1702,7 +1665,6 @@ restart: } else { -#ifdef THREAD /* Wait for a free hash link */ struct st_my_thread_var *thread= my_thread_var; PAGECACHE_PAGE page; @@ -1715,9 +1677,6 @@ restart: ("suspend thread %ld", thread->id)); mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); thread->opt_info= NULL; -#else - KEYCACHE_DBUG_ASSERT(0); -#endif DBUG_PRINT("info", ("restarting...")); goto restart; } @@ -1838,7 +1797,6 @@ restart: DBUG_ASSERT(hash_link->requests > 0); hash_link->requests--; { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -1848,16 +1806,6 @@ restart: mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* - Given the use of "resize_in_flush", it seems impossible - that this whole branch is ever entered in single-threaded case - because "(wrmode && pagecache->resize_in_flush)" cannot be true. - TODO: Check this, and then put the whole branch into the - "#ifdef THREAD" guard. - */ -#endif } /* Invalidate page in the block if it has not been done yet */ if (block->status) @@ -1891,7 +1839,6 @@ restart: KEYCACHE_DBUG_PRINT("find_block", ("request waiting for old page to be saved")); { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into the queue of those waiting for the old page */ wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); @@ -1903,10 +1850,6 @@ restart: mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif } KEYCACHE_DBUG_PRINT("find_block", ("request for old page resubmitted")); @@ -1974,7 +1917,6 @@ restart: all of them must get the same block */ -#ifdef THREAD if (! pagecache->used_last) { struct st_my_thread_var *thread= my_thread_var; @@ -1989,9 +1931,6 @@ restart: while (thread->next); thread->opt_info= NULL; } -#else - KEYCACHE_DBUG_ASSERT(pagecache->used_last); -#endif block= hash_link->block; if (! block) { @@ -2062,10 +2001,8 @@ restart: /* Remove the hash link for this page from the hash table */ unlink_hash(pagecache, block->hash_link); /* All pending requests for this page must be resubmitted */ -#ifdef THREAD if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif } link_to_file_list(pagecache, block, file, (my_bool)(block->hash_link ? 1 : 0)); @@ -2230,7 +2167,6 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache, uint lock_type) { /* Lock failed we will wait */ -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; DBUG_ENTER("pagecache_wait_lock"); DBUG_PRINT("info", ("fail to lock, waiting... 0x%lx", (ulong)block)); @@ -2244,9 +2180,6 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache, mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - DBUG_ASSERT(0); -#endif PCBLOCK_INFO(block); if ((block->status & (PCBLOCK_REASSIGNED | PCBLOCK_IN_SWITCH)) || file.file != block->hash_link->file.file || @@ -2398,11 +2331,9 @@ static void release_wrlock(PAGECACHE_BLOCK_LINK *block, my_bool read_lock) if (block->wlocks > 0) DBUG_VOID_RETURN; /* Multiple write locked */ DBUG_PRINT("info", ("WR lock reset, block 0x%lx", (ulong)block)); -#ifdef THREAD /* release all threads waiting for read lock or one waiting for write */ if (block->wqueue[COND_FOR_WRLOCK].last_thread) wqueue_release_one_locktype_from_queue(&block->wqueue[COND_FOR_WRLOCK]); -#endif PCBLOCK_INFO(block); DBUG_VOID_RETURN; } @@ -2436,11 +2367,9 @@ static void release_rdlock(PAGECACHE_BLOCK_LINK *block) if (block->rlocks > 0) DBUG_VOID_RETURN; /* Multiple write locked */ DBUG_PRINT("info", ("RD lock reset, block 0x%lx", (ulong)block)); -#ifdef THREAD /* release all threads waiting for read lock or one waiting for write */ if (block->wqueue[COND_FOR_WRLOCK].last_thread) wqueue_release_one_locktype_from_queue(&block->wqueue[COND_FOR_WRLOCK]); -#endif PCBLOCK_INFO(block); DBUG_VOID_RETURN; } @@ -2639,10 +2568,8 @@ static void read_block(PAGECACHE *pagecache, DBUG_PRINT("read_block", ("primary request: new page in cache")); /* Signal that all pending requests for this page now can be processed */ -#ifdef THREAD if (block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif } else { @@ -2651,7 +2578,6 @@ static void read_block(PAGECACHE *pagecache, that submitted secondary requests */ -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into a queue and wait until it can be processed */ wqueue_add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread); @@ -2662,10 +2588,6 @@ static void read_block(PAGECACHE *pagecache, mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while (thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif DBUG_PRINT("read_block", ("secondary request: new page in cache")); } @@ -3941,11 +3863,9 @@ restart: } KEYCACHE_DBUG_PRINT("key_cache_insert", ("Page injection")); -#ifdef THREAD /* Signal that all pending requests for this now can be processed. */ if (block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif } } else @@ -3960,11 +3880,9 @@ restart: block->status&= ~PCBLOCK_ERROR; } -#ifdef THREAD if (need_page_ready_signal && block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif if (first_REDO_LSN_for_page) { @@ -4114,11 +4032,9 @@ static void free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block) /* Keep track of the number of currently unused blocks. */ pagecache->blocks_unused++; -#ifdef THREAD /* All pending requests for this page must be resubmitted. */ if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif } @@ -4246,14 +4162,12 @@ static int flush_cached_blocks(PAGECACHE *pagecache, *first_errno= my_errno ? my_errno : -1; rc|= PCFLUSH_ERROR; } -#ifdef THREAD /* Let to proceed for possible waiting requests to write to the block page. It might happen only during an operation to resize the key cache. */ if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif /* type will never be FLUSH_IGNORE_CHANGED here */ if (! (type == FLUSH_KEEP || type == FLUSH_KEEP_LAZY || type == FLUSH_FORCE_WRITE)) @@ -4348,7 +4262,6 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache, uint cnt= 0; #endif -#ifdef THREAD struct st_file_in_flush us_flusher, *other_flusher; us_flusher.file= file->file; us_flusher.flush_queue.last_thread= NULL; @@ -4400,7 +4313,6 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache, sleep(10); mysql_mutex_lock(&pagecache->cache_lock); } -#endif if (type != FLUSH_IGNORE_CHANGED) { @@ -4527,7 +4439,6 @@ restart: #endif block= first_in_switch; { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -4538,10 +4449,6 @@ restart: &pagecache->cache_lock); } while (thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif } #if defined(PAGECACHE_DEBUG) cnt++; @@ -4579,12 +4486,10 @@ restart: } } } -#ifdef THREAD /* wake up others waiting to flush this file */ my_hash_delete(&pagecache->files_in_flush, (uchar *)&us_flusher); if (us_flusher.flush_queue.last_thread) wqueue_release_queue(&us_flusher.flush_queue); -#endif } #ifndef DBUG_OFF @@ -4716,7 +4621,6 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, of memory at most. */ mysql_mutex_lock(&pagecache->cache_lock); -#ifdef THREAD for (;;) { struct st_file_in_flush *other_flusher; @@ -4751,7 +4655,6 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, while (thread->next); } } -#endif /* Count how many dirty pages are interesting */ for (file_hash= 0; file_hash < PAGECACHE_CHANGED_BLOCKS_HASH; file_hash++) diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index c994f19d309..c40e4ed6fed 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -313,7 +313,6 @@ static ha_rows find_all_keys(MARIA_SORT_PARAM *info, uint keys, } /* find_all_keys */ -#ifdef THREAD /* Search after all keys and place them in a temp. file */ pthread_handler_t _ma_thr_find_all_keys(void *arg) @@ -657,7 +656,6 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) my_free(mergebuf); DBUG_RETURN(got_error); } -#endif /* THREAD */ /* Write all keys in memory to file for later merge */ diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c index 8c572b45547..ea911ac4a8a 100644 --- a/storage/maria/ma_static.c +++ b/storage/maria/ma_static.c @@ -39,10 +39,10 @@ my_bool maria_inited= FALSE; my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */ my_bool maria_recovery_changed_data= 0, maria_recovery_verbose= 0; pthread_mutex_t THR_LOCK_maria; -#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) -ulong maria_concurrent_insert= 2; -#else +#ifdef DONT_USE_RW_LOCKS ulong maria_concurrent_insert= 0; +#else +ulong maria_concurrent_insert= 2; #endif my_off_t maria_max_temp_length= MAX_FILE_SIZE; ulong maria_bulk_insert_tree_size=8192*1024; diff --git a/storage/maria/ma_statrec.c b/storage/maria/ma_statrec.c index 9e01e5d062a..e085821b9d0 100644 --- a/storage/maria/ma_statrec.c +++ b/storage/maria/ma_statrec.c @@ -116,9 +116,6 @@ my_bool _ma_cmp_static_record(register MARIA_HA *info, { DBUG_ENTER("_ma_cmp_static_record"); - /* We are going to do changes; dont let anybody disturb */ - dont_break(); /* Dont allow SIGHUP or SIGINT */ - if (info->opt_flag & WRITE_CACHE_USED) { if (flush_io_cache(&info->rec_cache)) diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c index 90c9b4a9c7f..cb83116a7cd 100644 --- a/storage/maria/ma_test1.c +++ b/storage/maria/ma_test1.c @@ -70,7 +70,7 @@ extern int _ma_flush_table_files(MARIA_HA *info, uint flush_data_or_index, int main(int argc,char *argv[]) { -#if defined(SAFE_MUTEX) && defined(THREAD) +#ifdef SAFE_MUTEX safe_mutex_deadlock_detector= 1; #endif MY_INIT(argv[0]); diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c index 25684bdb61c..5fa27d331ba 100644 --- a/storage/maria/ma_test2.c +++ b/storage/maria/ma_test2.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) char *blob_buffer; MARIA_CREATE_INFO create_info; -#if defined(SAFE_MUTEX) && defined(THREAD) +#ifdef SAFE_MUTEX safe_mutex_deadlock_detector= 1; #endif MY_INIT(argv[0]); diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c index 31459d8587a..4051da022c0 100644 --- a/storage/maria/ma_update.c +++ b/storage/maria/ma_update.c @@ -186,7 +186,6 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec) there is no index change there could be data change. */ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (info->invalidator != 0) { DBUG_PRINT("info", ("invalidator... '%s' (update)", @@ -243,7 +242,6 @@ err: err_end: _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (save_errno == HA_ERR_KEY_NOT_FOUND) { maria_print_error(share, HA_ERR_CRASHED); diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index 9af17e14978..b52c00ec91a 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -108,7 +108,6 @@ int maria_write(MARIA_HA *info, uchar *record) } if (_ma_readinfo(info,F_WRLCK,1)) DBUG_RETURN(my_errno); - dont_break(); /* Dont allow SIGHUP or SIGINT */ if (share->base.reloc == (ha_rows) 1 && share->base.records == (ha_rows) 1 && @@ -314,7 +313,6 @@ int maria_write(MARIA_HA *info, uchar *record) if (share->is_log_table) _ma_update_status((void*) info); - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(0); err: @@ -400,7 +398,6 @@ err2: save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */ DBUG_PRINT("error", ("got error: %d", save_errno)); _ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(my_errno=save_errno); } /* maria_write */ diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index e1ebde515dd..aa8af02ca17 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -19,12 +19,8 @@ #include <myisampack.h> /* packing of keys */ #include <my_tree.h> #include <my_bitmap.h> -#ifdef THREAD #include <my_pthread.h> #include <thr_lock.h> -#else -#include <my_no_pthread.h> -#endif #include <hash.h> #include "ma_loghandler.h" #include "ma_control_file.h" @@ -250,10 +246,8 @@ typedef struct st_maria_file_bitmap uint non_flushable; /**< 0 if bitmap and log are in sync */ PAGECACHE_FILE file; /* datafile where bitmap is stored */ -#ifdef THREAD pthread_mutex_t bitmap_lock; pthread_cond_t bitmap_cond; /**< When bitmap becomes flushable */ -#endif /* Constants, allocated when initiating bitmaps */ uint sizes[8]; /* Size per bit combination */ uint total_size; /* Total usable size of bitmap page */ @@ -394,7 +388,6 @@ typedef struct st_maria_share my_bool have_versioning; my_bool key_del_used; /* != 0 if key_del is locked */ my_bool deleting; /* we are going to delete this table */ -#ifdef THREAD THR_LOCK lock; void (*lock_restore_status)(void *); /** @@ -411,7 +404,6 @@ typedef struct st_maria_share intern_lock, lock them in this order. */ pthread_mutex_t close_lock; -#endif my_off_t mmaped_length; uint nonmmaped_inserts; /* counter of writing in non-mmaped area */ @@ -482,8 +474,6 @@ typedef struct st_maria_block_scan MARIA_RECORD_POS row_base_page; } MARIA_BLOCK_SCAN; -typedef ICP_RESULT (*index_cond_func_t)(void *param); - struct st_maria_handler { MARIA_SHARE *s; /* Shared between open:s */ @@ -577,12 +567,10 @@ struct st_maria_handler my_bool once_flags; /* For MARIA_MRG */ /* For bulk insert enable/disable transactions control */ my_bool switched_transactional; -#ifdef __WIN__ +#ifdef _WIN32 my_bool owned_by_merge; /* This Maria table is part of a merge union */ #endif -#ifdef THREAD THR_LOCK_DATA lock; -#endif uchar *maria_rtree_recursion_state; /* For RTREE */ uchar length_buff[5]; /* temp buff to store blob lengths */ int maria_rtree_recursion_depth; @@ -776,10 +764,8 @@ struct st_maria_handler #define MARIA_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT #define maria_unique_store(A,B) mi_int4store((A),(B)) -#ifdef THREAD extern pthread_mutex_t THR_LOCK_maria; -#endif -#if !defined(THREAD) || defined(DONT_USE_RW_LOCKS) +#ifdef DONT_USE_RW_LOCKS #define rw_wrlock(A) {} #define rw_rdlock(A) {} #define rw_unlock(A) {} @@ -1200,9 +1186,7 @@ C_MODE_END int _ma_flush_pending_blocks(MARIA_SORT_PARAM *param); int _ma_sort_ft_buf_flush(MARIA_SORT_PARAM *sort_param); int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param); -#ifdef THREAD pthread_handler_t _ma_thr_find_all_keys(void *arg); -#endif int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param); int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 3121deb66e4..bc43d9631ab 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -138,7 +138,7 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type, THD* thd = (THD*)param->thd; Protocol *protocol= thd->protocol; size_t length, msg_length; - char msgbuf[HA_MAX_MSG_BUF]; + char msgbuf[MYSQL_ERRMSG_SIZE]; char name[NAME_LEN*2+2]; msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); @@ -1846,17 +1846,6 @@ int ha_myisam::delete_all_rows() } -/* - Intended to support partitioning. - Allows a particular partition to be truncated. -*/ - -int ha_myisam::truncate() -{ - int error= delete_all_rows(); - return error ? error : reset_auto_increment(0); -} - int ha_myisam::reset_auto_increment(ulonglong value) { file->s->state.auto_increment= value; diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index b5415bb0dc7..b1916881dab 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -71,6 +71,7 @@ class ha_myisam: public handler HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN); } uint max_supported_keys() const { return MI_MAX_KEY; } + uint max_supported_key_parts() const { return HA_MAX_KEY_SEG; } uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } uint checksum() const; @@ -116,7 +117,6 @@ class ha_myisam: public handler int reset(void); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - int truncate(); int reset_auto_increment(ulonglong value); int disable_indexes(uint mode); int enable_indexes(uint mode); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index daae02e6846..e86c5a7c0fb 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -79,8 +79,7 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param); static SORT_KEY_BLOCKS *alloc_key_blocks(HA_CHECK *param, uint blocks, uint buffer_length); static ha_checksum mi_byte_checksum(const uchar *buf, uint length); -static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share); -static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); +static void set_data_file_type(MI_SORT_INFO *sort_info, MYISAM_SHARE *share); void myisamchk_init(HA_CHECK *param) { diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index e932234a998..79c4ef03a56 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -670,7 +670,7 @@ get_one_option(int optid, case OPT_STATS_METHOD: { int method; - enum_mi_stats_method UNINIT_VAR(method_conv); + enum_handler_stats_method UNINIT_VAR(method_conv); myisam_stats_method_str= argument; if ((method= find_type(argument, &myisam_stats_method_typelib, FIND_TYPE_BASIC)) <= 0) diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 3f82d96b88b..e400089b881 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -225,8 +225,6 @@ typedef struct st_mi_isam_share mysql_rwlock_t mmap_lock; } MYISAM_SHARE; -typedef ICP_RESULT (*index_cond_func_t)(void *param); - struct st_myisam_info { MYISAM_SHARE *s; /* Shared between open:s */ diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 22b4794dbde..1f89aa5fd23 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1227,11 +1227,11 @@ ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, } -int ha_myisammrg::truncate() +int ha_myisammrg::delete_all_rows() { int err= 0; MYRG_TABLE *table; - DBUG_ENTER("ha_myisammrg::truncate"); + DBUG_ENTER("ha_myisammrg::delete_all_rows"); for (table= file->open_tables; table != file->end_table; table++) { diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 14734eed064..735c7ff53be 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -131,7 +131,7 @@ public: int rnd_pos(uchar * buf, uchar *pos); void position(const uchar *record); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); - int truncate(); + int delete_all_rows(); int info(uint); int reset(void); int extra(enum ha_extra_function operation); diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 31016ba47b8..34aaafb6fcc 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -14,6 +14,7 @@ IF(BOOST_OK) IF(CMAKE_CXX_FLAGS)
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
ENDIF()
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE)
diff --git a/storage/pbxt/src/discover_xt.cc b/storage/pbxt/src/discover_xt.cc index ee52c182a73..05891bdf19d 100644 --- a/storage/pbxt/src/discover_xt.cc +++ b/storage/pbxt/src/discover_xt.cc @@ -1493,7 +1493,8 @@ static bool mysql_create_table_no_lock(THD *thd, if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { /* Open table and put in temporary table list */ - if (!(open_temporary_table(thd, path, db, table_name, 1))) + TABLE *table= open_table_uncached(thd, path, db, table_name, TRUE); + if (!table) { (void) rm_temporary_table(create_info->db_type, path); goto unlock_and_end; diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc index 0746958bf4c..5b9e30a9213 100644 --- a/storage/pbxt/src/ha_pbxt.cc +++ b/storage/pbxt/src/ha_pbxt.cc @@ -5819,7 +5819,7 @@ int ha_pbxt::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) ref_tbl_name++; ref_db_name++; - fk_info->forein_id = thd_make_lex_string(thd, 0, + fk_info->foreign_id = thd_make_lex_string(thd, 0, fk->co_name, (uint) strlen(fk->co_name), 1); fk_info->referenced_db = thd_make_lex_string(thd, 0, diff --git a/storage/pbxt/src/myxt_xt.cc b/storage/pbxt/src/myxt_xt.cc index d36f7334cfd..7fd94aeaef7 100644 --- a/storage/pbxt/src/myxt_xt.cc +++ b/storage/pbxt/src/myxt_xt.cc @@ -2062,11 +2062,7 @@ static TABLE *my_open_table(XTThreadPtr self, XTDatabaseHPtr XT_UNUSED(db), XTPa return NULL; } -#if MYSQL_VERSION_ID >= 50404 - if ((error = open_table_from_share(thd, share, "", 0, (uint) READ_ALL, 0, table, OTM_OPEN))) -#else if ((error = open_table_from_share(thd, share, "", 0, (uint) READ_ALL, 0, table, FALSE))) -#endif { xt_free(self, table); lex_end(&new_lex); diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index ec063b782c1..2113a28d4f8 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -361,11 +361,6 @@ int ha_perfschema::delete_all_rows(void) DBUG_RETURN(result); } -int ha_perfschema::truncate() -{ - return delete_all_rows(); -} - THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index c0ee0827dbc..9557bc25b6e 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -124,8 +124,6 @@ public: int delete_all_rows(void); - int truncate(); - int delete_table(const char *from); int rename_table(const char * from, const char * to); |