summaryrefslogtreecommitdiff
path: root/storage/mroonga
diff options
context:
space:
mode:
authorEugene Kosov <eugene.kosov@mariadb.com>2019-07-16 15:42:36 +0300
committerEugene Kosov <eugene.kosov@mariadb.com>2019-07-16 18:39:21 +0300
commit0f83c8878dc1389212c134f65d37a43d9d248250 (patch)
tree6950ea9b6c449a6e5d8a0205b3d06ae275a6234c /storage/mroonga
parentaa96e56c55c44d2c20c1cd70325ef88ad0af8f98 (diff)
parentd2f094d9e63e97293915b17b30a73b2552647a38 (diff)
downloadmariadb-git-0f83c8878dc1389212c134f65d37a43d9d248250.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'storage/mroonga')
-rw-r--r--storage/mroonga/ha_mroonga.hpp188
-rw-r--r--storage/mroonga/vendor/groonga/lib/hash.c34
-rw-r--r--storage/mroonga/vendor/groonga/lib/ii.c17
-rw-r--r--storage/mroonga/vendor/groonga/lib/pat.c14
-rw-r--r--storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c49
5 files changed, 94 insertions, 208 deletions
diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp
index 4c64959b17f..7347af25bdc 100644
--- a/storage/mroonga/ha_mroonga.hpp
+++ b/storage/mroonga/ha_mroonga.hpp
@@ -407,11 +407,11 @@ public:
ha_mroonga(handlerton *hton, TABLE_SHARE *share_arg);
~ha_mroonga();
const char *table_type() const; // required
- const char *index_type(uint inx);
+ const char *index_type(uint inx) mrn_override;
const char **bas_ext() const; // required
- ulonglong table_flags() const; // required
- ulong index_flags(uint idx, uint part, bool all_parts) const; // required
+ ulonglong table_flags() const mrn_override; // required
+ ulong index_flags(uint idx, uint part, bool all_parts) const mrn_override; // required
// required
int create(const char *name, TABLE *form, HA_CREATE_INFO *info
@@ -430,40 +430,40 @@ public:
#ifndef MRN_HANDLER_HAVE_HA_CLOSE
int close(); // required
#endif
- int info(uint flag); // required
+ int info(uint flag) mrn_override; // required
- uint lock_count() const;
+ uint lock_count() const mrn_override;
THR_LOCK_DATA **store_lock(THD *thd, // required
THR_LOCK_DATA **to,
- enum thr_lock_type lock_type);
- int external_lock(THD *thd, int lock_type);
+ enum thr_lock_type lock_type) mrn_override;
+ int external_lock(THD *thd, int lock_type) mrn_override;
- int rnd_init(bool scan); // required
- int rnd_end();
+ int rnd_init(bool scan) mrn_override; // required
+ int rnd_end() mrn_override;
#ifndef MRN_HANDLER_HAVE_HA_RND_NEXT
int rnd_next(uchar *buf); // required
#endif
#ifndef MRN_HANDLER_HAVE_HA_RND_POS
int rnd_pos(uchar *buf, uchar *pos); // required
#endif
- void position(const uchar *record); // required
- int extra(enum ha_extra_function operation);
- int extra_opt(enum ha_extra_function operation, ulong cache_size);
+ void position(const uchar *record) mrn_override; // required
+ int extra(enum ha_extra_function operation) mrn_override;
+ int extra_opt(enum ha_extra_function operation, ulong cache_size) mrn_override;
- int delete_table(const char *name);
- int write_row(uchar *buf);
- int update_row(const uchar *old_data, const uchar *new_data);
- int delete_row(const uchar *buf);
+ int delete_table(const char *name) mrn_override;
+ int write_row(uchar *buf) mrn_override;
+ int update_row(const uchar *old_data, const uchar *new_data) mrn_override;
+ int delete_row(const uchar *buf) mrn_override;
- uint max_supported_record_length() const;
- uint max_supported_keys() const;
- uint max_supported_key_parts() const;
- uint max_supported_key_length() const;
- uint max_supported_key_part_length() const;
+ uint max_supported_record_length() const mrn_override;
+ uint max_supported_keys() const mrn_override;
+ uint max_supported_key_parts() const mrn_override;
+ uint max_supported_key_length() const mrn_override;
+ uint max_supported_key_part_length() const mrn_override;
- ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
- int index_init(uint idx, bool sorted);
- int index_end();
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) mrn_override;
+ int index_init(uint idx, bool sorted) mrn_override;
+ int index_end() mrn_override;
#ifndef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP
int index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map,
@@ -485,35 +485,35 @@ public:
#ifndef MRN_HANDLER_HAVE_HA_INDEX_LAST
int index_last(uchar *buf);
#endif
- int index_next_same(uchar *buf, const uchar *key, uint keylen);
+ int index_next_same(uchar *buf, const uchar *key, uint keylen) mrn_override;
- int ft_init();
- FT_INFO *ft_init_ext(uint flags, uint inx, String *key);
- int ft_read(uchar *buf);
+ int ft_init() mrn_override;
+ FT_INFO *ft_init_ext(uint flags, uint inx, String *key) mrn_override;
+ int ft_read(uchar *buf) mrn_override;
- const Item *cond_push(const Item *cond);
- void cond_pop();
+ const Item *cond_push(const Item *cond) mrn_override;
+ void cond_pop() mrn_override;
- bool get_error_message(int error, String *buf);
+ bool get_error_message(int error, String *buf) mrn_override;
- int reset();
+ int reset() mrn_override;
- handler *clone(const char *name, MEM_ROOT *mem_root);
- uint8 table_cache_type();
+ handler *clone(const char *name, MEM_ROOT *mem_root) mrn_override;
+ uint8 table_cache_type() mrn_override;
#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param,
uint n_ranges, uint *bufsz,
- uint *flags, Cost_estimate *cost);
+ uint *flags, Cost_estimate *cost) mrn_override;
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
#ifdef MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS
uint key_parts,
#endif
- uint *bufsz, uint *flags, Cost_estimate *cost);
+ uint *bufsz, uint *flags, Cost_estimate *cost) mrn_override;
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode,
- HANDLER_BUFFER *buf);
- int multi_range_read_next(range_id_t *range_info);
+ HANDLER_BUFFER *buf) mrn_override;
+ int multi_range_read_next(range_id_t *range_info) mrn_override;
#else // MRN_HANDLER_HAVE_MULTI_RANGE_READ
int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
KEY_MULTI_RANGE *ranges,
@@ -523,38 +523,38 @@ public:
int read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
#endif // MRN_HANDLER_HAVE_MULTI_RANGE_READ
#ifdef MRN_HANDLER_START_BULK_INSERT_HAS_FLAGS
- void start_bulk_insert(ha_rows rows, uint flags);
+ void start_bulk_insert(ha_rows rows, uint flags) mrn_override;
#else
void start_bulk_insert(ha_rows rows);
#endif
- int end_bulk_insert();
- int delete_all_rows();
- int truncate();
- double scan_time();
- double read_time(uint index, uint ranges, ha_rows rows);
+ int end_bulk_insert() mrn_override;
+ int delete_all_rows() mrn_override;
+ int truncate() mrn_override;
+ double scan_time() mrn_override;
+ double read_time(uint index, uint ranges, ha_rows rows) mrn_override;
#ifdef MRN_HANDLER_HAVE_KEYS_TO_USE_FOR_SCANNING
- const key_map *keys_to_use_for_scanning();
+ const key_map *keys_to_use_for_scanning() mrn_override;
#endif
- ha_rows estimate_rows_upper_bound();
- void update_create_info(HA_CREATE_INFO* create_info);
- int rename_table(const char *from, const char *to);
- bool is_crashed() const;
- bool auto_repair(int error) const;
+ ha_rows estimate_rows_upper_bound() mrn_override;
+ void update_create_info(HA_CREATE_INFO* create_info) mrn_override;
+ int rename_table(const char *from, const char *to) mrn_override;
+ bool is_crashed() const mrn_override;
+ bool auto_repair(int error) const mrn_override;
bool auto_repair() const;
- int disable_indexes(uint mode);
- int enable_indexes(uint mode);
- int check(THD* thd, HA_CHECK_OPT* check_opt);
- int repair(THD* thd, HA_CHECK_OPT* check_opt);
- bool check_and_repair(THD *thd);
- int analyze(THD* thd, HA_CHECK_OPT* check_opt);
- int optimize(THD* thd, HA_CHECK_OPT* check_opt);
- bool is_fatal_error(int error_num, uint flags=0);
+ int disable_indexes(uint mode) mrn_override;
+ int enable_indexes(uint mode) mrn_override;
+ int check(THD* thd, HA_CHECK_OPT* check_opt) mrn_override;
+ int repair(THD* thd, HA_CHECK_OPT* check_opt) mrn_override;
+ bool check_and_repair(THD *thd) mrn_override;
+ int analyze(THD* thd, HA_CHECK_OPT* check_opt) mrn_override;
+ int optimize(THD* thd, HA_CHECK_OPT* check_opt) mrn_override;
+ bool is_fatal_error(int error_num, uint flags=0) mrn_override;
bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
- uint table_changes);
+ uint table_changes) mrn_override;
#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER
enum_alter_inplace_result
check_if_supported_inplace_alter(TABLE *altered_table,
- Alter_inplace_info *ha_alter_info);
+ Alter_inplace_info *ha_alter_info) mrn_override;
#else
alter_table_operations alter_table_flags(alter_table_operations flags);
# ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX
@@ -570,78 +570,78 @@ public:
int update_auto_increment();
void set_next_insert_id(ulonglong id);
void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values,
- ulonglong *first_value, ulonglong *nb_reserved_values);
+ ulonglong *first_value, ulonglong *nb_reserved_values) mrn_override;
void restore_auto_increment(ulonglong prev_insert_id);
- void release_auto_increment();
- int check_for_upgrade(HA_CHECK_OPT *check_opt);
+ void release_auto_increment() mrn_override;
+ int check_for_upgrade(HA_CHECK_OPT *check_opt) mrn_override;
#ifdef MRN_HANDLER_HAVE_RESET_AUTO_INCREMENT
- int reset_auto_increment(ulonglong value);
+ int reset_auto_increment(ulonglong value) mrn_override;
#endif
- bool was_semi_consistent_read();
- void try_semi_consistent_read(bool yes);
- void unlock_row();
- int start_stmt(THD *thd, thr_lock_type lock_type);
+ bool was_semi_consistent_read() mrn_override;
+ void try_semi_consistent_read(bool yes) mrn_override;
+ void unlock_row() mrn_override;
+ int start_stmt(THD *thd, thr_lock_type lock_type) mrn_override;
protected:
#ifdef MRN_HANDLER_RECORDS_RETURN_ERROR
int records(ha_rows *num_rows);
#else
- ha_rows records();
+ ha_rows records() mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_RND_NEXT
- int rnd_next(uchar *buf);
+ int rnd_next(uchar *buf) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_RND_POS
- int rnd_pos(uchar *buf, uchar *pos);
+ int rnd_pos(uchar *buf, uchar *pos) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_INDEX_READ_MAP
int index_read_map(uchar *buf, const uchar *key,
key_part_map keypart_map,
- enum ha_rkey_function find_flag);
+ enum ha_rkey_function find_flag) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_INDEX_NEXT
- int index_next(uchar *buf);
+ int index_next(uchar *buf) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_INDEX_PREV
- int index_prev(uchar *buf);
+ int index_prev(uchar *buf) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_INDEX_FIRST
- int index_first(uchar *buf);
+ int index_first(uchar *buf) mrn_override;
#endif
#ifdef MRN_HANDLER_HAVE_HA_INDEX_LAST
- int index_last(uchar *buf);
+ int index_last(uchar *buf) mrn_override;
#endif
- void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg);
- bool primary_key_is_clustered();
- bool is_fk_defined_on_table_or_index(uint index);
- char *get_foreign_key_create_info();
+ void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share_arg) mrn_override;
+ bool primary_key_is_clustered() mrn_override;
+ bool is_fk_defined_on_table_or_index(uint index) mrn_override;
+ char *get_foreign_key_create_info() mrn_override;
#ifdef MRN_HANDLER_HAVE_GET_TABLESPACE_NAME
char *get_tablespace_name(THD *thd, char *name, uint name_len);
#endif
- bool can_switch_engines();
- int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
- int get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
- uint referenced_by_foreign_key();
- void init_table_handle_for_HANDLER();
- void free_foreign_key_create_info(char* str);
+ bool can_switch_engines() mrn_override;
+ int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) mrn_override;
+ int get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) mrn_override;
+ uint referenced_by_foreign_key() mrn_override;
+ void init_table_handle_for_HANDLER() mrn_override;
+ void free_foreign_key_create_info(char* str) mrn_override;
#ifdef MRN_HAVE_HA_REBIND_PSI
- void unbind_psi();
- void rebind_psi();
+ void unbind_psi() mrn_override;
+ void rebind_psi() mrn_override;
#endif
my_bool register_query_cache_table(THD *thd,
const char *table_key,
uint key_length,
qc_engine_callback *engine_callback,
- ulonglong *engine_data);
+ ulonglong *engine_data) mrn_override;
#ifdef MRN_HANDLER_HAVE_CHECK_IF_SUPPORTED_INPLACE_ALTER
bool prepare_inplace_alter_table(TABLE *altered_table,
- Alter_inplace_info *ha_alter_info);
+ Alter_inplace_info *ha_alter_info) mrn_override;
bool inplace_alter_table(TABLE *altered_table,
- Alter_inplace_info *ha_alter_info);
+ Alter_inplace_info *ha_alter_info) mrn_override;
bool commit_inplace_alter_table(TABLE *altered_table,
Alter_inplace_info *ha_alter_info,
- bool commit);
- void notify_table_changed();
+ bool commit) mrn_override;
+ void notify_table_changed() mrn_override;
#endif
private:
@@ -692,7 +692,7 @@ private:
int generic_geo_open_cursor(const uchar *key, enum ha_rkey_function find_flag);
#ifdef MRN_HANDLER_HAVE_HA_CLOSE
- int close();
+ int close() mrn_override;
#endif
bool is_dry_write();
bool is_enable_optimization();
diff --git a/storage/mroonga/vendor/groonga/lib/hash.c b/storage/mroonga/vendor/groonga/lib/hash.c
index 8fe180481c9..3fb372ee222 100644
--- a/storage/mroonga/vendor/groonga/lib/hash.c
+++ b/storage/mroonga/vendor/groonga/lib/hash.c
@@ -89,12 +89,6 @@ grn_tiny_array_at_inline(grn_tiny_array *array, grn_id id)
return id ? grn_tiny_array_put(array, id) : NULL;
}
-inline static void *
-grn_tiny_array_next(grn_tiny_array *array)
-{
- return grn_tiny_array_put(array, array->max + 1);
-}
-
void
grn_tiny_array_init(grn_ctx *ctx, grn_tiny_array *array,
uint16_t element_size, uint16_t flags)
@@ -204,15 +198,6 @@ grn_tiny_bitmap_put_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) {
/* Requirements: bit_id != GRN_ID_NIL. */
/* Return value: 1/0 on success, -1 on failure. */
-inline static int
-grn_tiny_bitmap_get(grn_tiny_bitmap *bitmap, grn_id bit_id)
-{
- uint8_t * const ptr = grn_tiny_bitmap_get_byte(bitmap, bit_id);
- return ptr ? ((*ptr >> (bit_id & 7)) & 1) : -1;
-}
-
-/* Requirements: bit_id != GRN_ID_NIL. */
-/* Return value: 1/0 on success, -1 on failure. */
/* Note: A bitmap is extended if needed. */
inline static int
grn_tiny_bitmap_put(grn_tiny_bitmap *bitmap, grn_id bit_id)
@@ -309,18 +294,6 @@ grn_io_array_bit_off(grn_ctx *ctx, grn_io *io,
return ptr;
}
-inline static void *
-grn_io_array_bit_flip(grn_ctx *ctx, grn_io *io,
- uint32_t segment_id, uint32_t offset)
-{
- uint8_t * const ptr = (uint8_t *)grn_io_array_at_inline(
- ctx, io, segment_id, (offset >> 3) + 1, GRN_TABLE_ADD);
- if (ptr) {
- *ptr ^= 1 << (offset & 7);
- }
- return ptr;
-}
-
/* grn_table_queue */
static void
@@ -1738,13 +1711,6 @@ get_value(grn_ctx *ctx, grn_hash *hash, entry_str *n)
return grn_hash_entry_get_value(ctx, hash, (grn_hash_entry *)n);
}
-inline static grn_rc
-put_key(grn_ctx *ctx, grn_hash *hash, entry_str *n, uint32_t h,
- const char *key, unsigned int len)
-{
- return grn_hash_entry_put_key(ctx, hash, (grn_hash_entry *)n, h, key, len);
-}
-
inline static int
match_key(grn_ctx *ctx, grn_hash *hash, entry_str *ee, uint32_t h,
const char *key, unsigned int len)
diff --git a/storage/mroonga/vendor/groonga/lib/ii.c b/storage/mroonga/vendor/groonga/lib/ii.c
index 58c789616d9..cd5559e6958 100644
--- a/storage/mroonga/vendor/groonga/lib/ii.c
+++ b/storage/mroonga/vendor/groonga/lib/ii.c
@@ -2194,23 +2194,6 @@ buffer_close(grn_ctx *ctx, grn_ii *ii, uint32_t pseg)
return GRN_SUCCESS;
}
-inline static uint32_t
-buffer_open_if_capable(grn_ctx *ctx, grn_ii *ii, int32_t seg, int size, buffer **b)
-{
- uint32_t pseg, pos = SEG2POS(seg, 0);
- if ((pseg = buffer_open(ctx, ii, pos, NULL, b)) != GRN_II_PSEG_NOT_ASSIGNED) {
- uint16_t nterms = (*b)->header.nterms - (*b)->header.nterms_void;
- if (!((nterms < 4096 ||
- (ii->header->total_chunk_size >> ((nterms >> 8) - 6))
- > (*b)->header.chunk_size) &&
- ((*b)->header.buffer_free >= size + sizeof(buffer_term)))) {
- buffer_close(ctx, ii, pseg);
- return GRN_II_PSEG_NOT_ASSIGNED;
- }
- }
- return pseg;
-}
-
typedef struct {
uint32_t rid;
uint32_t sid;
diff --git a/storage/mroonga/vendor/groonga/lib/pat.c b/storage/mroonga/vendor/groonga/lib/pat.c
index e2f98fba0d2..642173e2fdc 100644
--- a/storage/mroonga/vendor/groonga/lib/pat.c
+++ b/storage/mroonga/vendor/groonga/lib/pat.c
@@ -142,20 +142,6 @@ pat_get(grn_ctx *ctx, grn_pat *pat, grn_id id)
return res;
}
-inline static pat_node *
-pat_node_new(grn_ctx *ctx, grn_pat *pat, grn_id *id)
-{
- uint32_t n = pat->header->curr_rec + 1;
- pat_node *res;
- if (n > GRN_ID_MAX) { return NULL; }
- if ((res = pat_get(ctx, pat, n))) {
- pat->header->curr_rec = n;
- pat->header->n_entries++;
- }
- if (id) { *id = n; }
- return res;
-}
-
/* sis operation */
inline static sis_node *
diff --git a/storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c b/storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c
index dc64e802fbb..ddd69714b1e 100644
--- a/storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c
+++ b/storage/mroonga/vendor/groonga/lib/ts/ts_expr_node.c
@@ -187,55 +187,6 @@ grn_ts_ref_zero(void)
return (grn_ts_ref){ 0, 0.0 };
}
-/* grn_ts_bool_vector_zero() returns a zero. */
-inline static grn_ts_bool_vector
-grn_ts_bool_vector_zero(void)
-{
- return (grn_ts_bool_vector){ NULL, 0 };
-}
-
-/* grn_ts_int_vector_zero() returns a zero. */
-inline static grn_ts_int_vector
-grn_ts_int_vector_zero(void)
-{
- return (grn_ts_int_vector){ NULL, 0 };
-}
-
-/* grn_ts_float_vector_zero() returns a zero. */
-inline static grn_ts_float_vector
-grn_ts_float_vector_zero(void)
-{
- return (grn_ts_float_vector){ NULL, 0 };
-}
-
-/* grn_ts_time_vector_zero() returns a zero. */
-inline static grn_ts_time_vector
-grn_ts_time_vector_zero(void)
-{
- return (grn_ts_time_vector){ NULL, 0 };
-}
-
-/* grn_ts_text_vector_zero() returns a zero. */
-inline static grn_ts_text_vector
-grn_ts_text_vector_zero(void)
-{
- return (grn_ts_text_vector){ NULL, 0 };
-}
-
-/* grn_ts_geo_vector_zero() returns a zero. */
-inline static grn_ts_geo_vector
-grn_ts_geo_vector_zero(void)
-{
- return (grn_ts_geo_vector){ NULL, 0 };
-}
-
-/* grn_ts_ref_vector_zero() returns a zero. */
-inline static grn_ts_ref_vector
-grn_ts_ref_vector_zero(void)
-{
- return (grn_ts_ref_vector){ NULL, 0 };
-}
-
/* grn_ts_data_type_to_kind() returns a kind associated with a type. */
static grn_ts_data_kind
grn_ts_data_type_to_kind(grn_ts_data_type type)