diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-11-05 16:15:20 +0100 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-07 08:52:30 +0100 |
commit | 3ad37ed0eb343cd173b103974aded5783958a88e (patch) | |
tree | f4ff854553d26a9e7d57791e7d671d4349a58d2d /storage/innobase/include | |
parent | 46f2f24ec43e9c1fa2d994afd615f58736c00d65 (diff) | |
parent | 0339cbe2f628f8a122ba7ea3a75fc99fa1dc4c96 (diff) | |
download | mariadb-git-3ad37ed0eb343cd173b103974aded5783958a88e.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/data0data.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/data0data.ic | 2 | ||||
-rw-r--r-- | storage/innobase/include/dict0types.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/fts0fts.h | 7 | ||||
-rw-r--r-- | storage/innobase/include/fts0opt.h | 3 | ||||
-rw-r--r-- | storage/innobase/include/mem0mem.h | 5 | ||||
-rw-r--r-- | storage/innobase/include/rem0rec.h | 2 | ||||
-rw-r--r-- | storage/innobase/include/row0ins.h | 5 | ||||
-rw-r--r-- | storage/innobase/include/ut0mem.h | 23 | ||||
-rw-r--r-- | storage/innobase/include/ut0wqueue.h | 29 |
10 files changed, 37 insertions, 43 deletions
diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h index 0b20bfbe975..5e53dce8429 100644 --- a/storage/innobase/include/data0data.h +++ b/storage/innobase/include/data0data.h @@ -168,7 +168,7 @@ dfield_data_is_binary_equal( const dfield_t* field, /*!< in: field */ ulint len, /*!< in: data length or UNIV_SQL_NULL */ const byte* data) /*!< in: data */ - MY_ATTRIBUTE((nonnull, warn_unused_result)); + MY_ATTRIBUTE((nonnull(1), warn_unused_result)); /*********************************************************************//** Gets info bits in a data tuple. diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic index be0186d53fe..92be8f8c589 100644 --- a/storage/innobase/include/data0data.ic +++ b/storage/innobase/include/data0data.ic @@ -225,7 +225,7 @@ dfield_data_is_binary_equal( { ut_ad(len != UNIV_SQL_DEFAULT); return(len == dfield_get_len(field) - && (len == UNIV_SQL_NULL + && (!len || len == UNIV_SQL_NULL || !memcmp(dfield_get_data(field), data, len))); } diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h index d0e1ddaa664..d0da45ab218 100644 --- a/storage/innobase/include/dict0types.h +++ b/storage/innobase/include/dict0types.h @@ -141,6 +141,8 @@ struct table_name_t }; #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG +/** Dump the change buffer at startup */ +extern my_bool ibuf_dump; /** Flag to control insert buffer debugging. */ extern uint ibuf_debug; #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 8643f0f79a3..74e0ee7b360 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -320,9 +320,6 @@ public: /** Mutex protecting bg_threads* and fts_add_wq. */ ib_mutex_t bg_threads_mutex; - /** Whether the table was added to fts_optimize_wq(); - protected by bg_threads_mutex */ - unsigned in_queue:1; /** Whether the ADDED table record sync-ed after crash recovery; protected by bg_threads_mutex */ unsigned added_synced:1; @@ -348,6 +345,10 @@ public: /** Vector of FTS indexes, this is mainly for caching purposes. */ ib_vector_t* indexes; + /** Whether the table exists in fts_optimize_wq; + protected by fts_optimize_wq mutex */ + bool in_queue; + /** Heap for fts_t allocation. */ mem_heap_t* fts_heap; }; diff --git a/storage/innobase/include/fts0opt.h b/storage/innobase/include/fts0opt.h index 4b4d1c4c84a..c527ad8e528 100644 --- a/storage/innobase/include/fts0opt.h +++ b/storage/innobase/include/fts0opt.h @@ -25,6 +25,9 @@ Created 2011-02-15 Jimmy Yang #ifndef INNODB_FTS0OPT_H #define INNODB_FTS0OPT_H +/** The FTS optimize thread's work queue. */ +extern ib_wqueue_t* fts_optimize_wq; + /******************************************************************** Callback function to fetch the rows in an FTS INDEX record. */ ibool diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h index 6d0f95cba19..fa22b3d3086 100644 --- a/storage/innobase/include/mem0mem.h +++ b/storage/innobase/include/mem0mem.h @@ -237,7 +237,10 @@ inline void* mem_heap_dup(mem_heap_t* heap, const void* data, size_t len) { - return(memcpy(mem_heap_alloc(heap, len), data, len)); + ut_ad(data || !len); + return UNIV_LIKELY(data != NULL) + ? memcpy(mem_heap_alloc(heap, len), data, len) + : NULL; } /** Duplicate a NUL-terminated string, allocated from a memory heap. diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index eae636d6b7d..0aadf59bfb2 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -1024,7 +1024,7 @@ rec_init_offsets_temp( ulint n_core, const dict_col_t::def_t*def_val, rec_comp_status_t status = REC_STATUS_ORDINARY) - MY_ATTRIBUTE((nonnull)); + MY_ATTRIBUTE((nonnull(1,2,3))); /** Determine the offset to each field in temporary file. @param[in] rec temporary file record @param[in] index index of that the record belongs to diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h index 87a72d88eb6..9b6aac9c548 100644 --- a/storage/innobase/include/row0ins.h +++ b/storage/innobase/include/row0ins.h @@ -146,9 +146,8 @@ row_ins_sec_index_entry( dict_index_t* index, /*!< in: secondary index */ dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr, /*!< in: query thread */ - bool check_ref) /*!< in: TRUE if we want to check that - the referenced table is ok, FALSE if we - want to check the foreign key table */ + bool check_foreign = true) /*!< in: true if check + foreign table is needed, false otherwise */ MY_ATTRIBUTE((warn_unused_result)); /***********************************************************//** Inserts a row to a table. This is a high-level function used in diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h index 1a430e98a10..414c00dfae8 100644 --- a/storage/innobase/include/ut0mem.h +++ b/storage/innobase/include/ut0mem.h @@ -30,29 +30,6 @@ Created 5/30/1994 Heikki Tuuri #include "os0event.h" #include "ut0mutex.h" -/**********************************************************************//** -Copies up to size - 1 characters from the NUL-terminated string src to -dst, NUL-terminating the result. Returns strlen(src), so truncation -occurred if the return value >= size. -@return strlen(src) */ -ulint -ut_strlcpy( -/*=======*/ - char* dst, /*!< in: destination buffer */ - const char* src, /*!< in: source buffer */ - ulint size); /*!< in: size of destination buffer */ - -/**********************************************************************//** -Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last -(size - 1) bytes of src, not the first. -@return strlen(src) */ -ulint -ut_strlcpy_rev( -/*===========*/ - char* dst, /*!< in: destination buffer */ - const char* src, /*!< in: source buffer */ - ulint size); /*!< in: size of destination buffer */ - /******************************************************************** Concatenate 3 strings.*/ char* diff --git a/storage/innobase/include/ut0wqueue.h b/storage/innobase/include/ut0wqueue.h index 6a096a36894..5a895f4ea3c 100644 --- a/storage/innobase/include/ut0wqueue.h +++ b/storage/innobase/include/ut0wqueue.h @@ -38,7 +38,18 @@ processing. // Forward declaration struct ib_list_t; -struct ib_wqueue_t; + +/** Work queue */ +struct ib_wqueue_t +{ + /** Mutex protecting everything */ + ib_mutex_t mutex; + /** Work item list */ + ib_list_t* items; + /** event we use to signal additions to list; + os_event_set() and os_event_reset() are protected by the mutex */ + os_event_t event; +}; /****************************************************************//** Create a new work queue. @@ -54,15 +65,14 @@ ib_wqueue_free( /*===========*/ ib_wqueue_t* wq); /*!< in: work queue */ -/****************************************************************//** -Add a work item to the queue. */ +/** Add a work item to the queue. +@param[in,out] wq work queue +@param[in] item work item +@param[in,out] heap memory heap to use for allocating list node +@param[in] wq_locked work queue mutex locked */ void -ib_wqueue_add( -/*==========*/ - ib_wqueue_t* wq, /*!< in: work queue */ - void* item, /*!< in: work item */ - mem_heap_t* heap); /*!< in: memory heap to use for - allocating the list node */ +ib_wqueue_add(ib_wqueue_t* wq, void* item, mem_heap_t* heap, + bool wq_locked = false); /** Check if queue is empty. @param wq wait queue @@ -101,5 +111,4 @@ ib_wqueue_len( /*==========*/ ib_wqueue_t* wq); /*<! in: work queue */ - #endif /* IB_WORK_QUEUE_H */ |