Commit 61a362c9 authored by Nikita Malyavin's avatar Nikita Malyavin

fixup MDEV-17556: fix mroonga

parent cd1e5d65
...@@ -5910,7 +5910,7 @@ int ha_mroonga::wrapper_write_row_index(uchar *buf) ...@@ -5910,7 +5910,7 @@ int ha_mroonga::wrapper_write_row_index(uchar *buf)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
for (i = 0; i < n_keys; i++) { for (i = 0; i < n_keys; i++) {
...@@ -5985,7 +5985,7 @@ int ha_mroonga::storage_write_row(uchar *buf) ...@@ -5985,7 +5985,7 @@ int ha_mroonga::storage_write_row(uchar *buf)
DBUG_RETURN(error); DBUG_RETURN(error);
} }
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
for (i = 0; i < n_columns; i++) { for (i = 0; i < n_columns; i++) {
Field *field = table->field[i]; Field *field = table->field[i];
...@@ -6266,7 +6266,7 @@ int ha_mroonga::storage_write_row_multiple_column_indexes(uchar *buf, ...@@ -6266,7 +6266,7 @@ int ha_mroonga::storage_write_row_multiple_column_indexes(uchar *buf,
int error = 0; int error = 0;
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
for (i = 0; i < n_keys; i++) { for (i = 0; i < n_keys; i++) {
...@@ -6558,7 +6558,7 @@ int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data) ...@@ -6558,7 +6558,7 @@ int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
for (i = 0; i < n_keys; i++) { for (i = 0; i < n_keys; i++) {
...@@ -6678,7 +6678,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) ...@@ -6678,7 +6678,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
grn_obj new_value; grn_obj new_value;
GRN_VOID_INIT(&new_value); GRN_VOID_INIT(&new_value);
{ {
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
generic_store_bulk(field, &new_value); generic_store_bulk(field, &new_value);
} }
grn_obj casted_value; grn_obj casted_value;
...@@ -6707,7 +6707,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) ...@@ -6707,7 +6707,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
storage_store_fields_for_prep_update(old_data, new_data, record_id); storage_store_fields_for_prep_update(old_data, new_data, record_id);
{ {
mrn::Lock lock(&(share->record_mutex), have_unique_index()); mrn::Lock lock(&(share->record_mutex), have_unique_index());
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
if ((error = storage_prepare_delete_row_unique_indexes(old_data, if ((error = storage_prepare_delete_row_unique_indexes(old_data,
record_id))) { record_id))) {
DBUG_RETURN(error); DBUG_RETURN(error);
...@@ -6732,7 +6732,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) ...@@ -6732,7 +6732,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
#endif #endif
if (bitmap_is_set(table->write_set, field->field_index)) { if (bitmap_is_set(table->write_set, field->field_index)) {
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
DBUG_PRINT("info", ("mroonga: update column %d(%d)",i,field->field_index)); DBUG_PRINT("info", ("mroonga: update column %d(%d)",i,field->field_index));
if (field->is_null()) continue; if (field->is_null()) continue;
...@@ -6809,7 +6809,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data) ...@@ -6809,7 +6809,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
if (table->found_next_number_field && if (table->found_next_number_field &&
!table->s->next_number_keypart && !table->s->next_number_keypart &&
new_data == table->record[0]) { new_data == table->record[0]) {
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
Field_num *field = (Field_num *) table->found_next_number_field; Field_num *field = (Field_num *) table->found_next_number_field;
if (field->unsigned_flag || field->val_int() > 0) { if (field->unsigned_flag || field->val_int() > 0) {
MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share; MRN_LONG_TERM_SHARE *long_term_share = share->long_term_share;
...@@ -6865,7 +6865,7 @@ int ha_mroonga::storage_update_row_index(const uchar *old_data, uchar *new_data) ...@@ -6865,7 +6865,7 @@ int ha_mroonga::storage_update_row_index(const uchar *old_data, uchar *new_data)
my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(old_data, table->record[0]); my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(old_data, table->record[0]);
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
mrn_change_encoding(ctx, NULL); mrn_change_encoding(ctx, NULL);
...@@ -7081,7 +7081,7 @@ int ha_mroonga::wrapper_delete_row_index(const uchar *buf) ...@@ -7081,7 +7081,7 @@ int ha_mroonga::wrapper_delete_row_index(const uchar *buf)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
for (i = 0; i < n_keys; i++) { for (i = 0; i < n_keys; i++) {
...@@ -7232,7 +7232,7 @@ int ha_mroonga::storage_delete_row_index(const uchar *buf) ...@@ -7232,7 +7232,7 @@ int ha_mroonga::storage_delete_row_index(const uchar *buf)
GRN_TEXT_INIT(&key, 0); GRN_TEXT_INIT(&key, 0);
GRN_TEXT_INIT(&encoded_key, 0); GRN_TEXT_INIT(&encoded_key, 0);
mrn::DebugColumnAccess debug_column_access(table, table->read_set); mrn::DebugColumnAccess debug_column_access(table, &table->read_set);
uint i; uint i;
uint n_keys = table->s->keys; uint n_keys = table->s->keys;
mrn_change_encoding(ctx, NULL); mrn_change_encoding(ctx, NULL);
...@@ -11420,7 +11420,7 @@ void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id) ...@@ -11420,7 +11420,7 @@ void ha_mroonga::storage_store_fields(uchar *buf, grn_id record_id)
} }
} }
mrn::DebugColumnAccess debug_column_access(table, table->write_set); mrn::DebugColumnAccess debug_column_access(table, &table->write_set);
DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index)); DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index));
field->move_field_offset(ptr_diff); field->move_field_offset(ptr_diff);
if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) {
...@@ -11485,7 +11485,7 @@ void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data, ...@@ -11485,7 +11485,7 @@ void ha_mroonga::storage_store_fields_for_prep_update(const uchar *old_data,
) )
#endif #endif
) { ) {
mrn::DebugColumnAccess debug_column_access(table, table->write_set); mrn::DebugColumnAccess debug_column_access(table, &table->write_set);
DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index)); DBUG_PRINT("info", ("mroonga: store column %d(%d)",i,field->field_index));
grn_obj value; grn_obj value;
GRN_OBJ_INIT(&value, GRN_BULK, 0, grn_obj_get_range(ctx, grn_columns[i])); GRN_OBJ_INIT(&value, GRN_BULK, 0, grn_obj_get_range(ctx, grn_columns[i]));
...@@ -11521,7 +11521,7 @@ void ha_mroonga::storage_store_fields_by_index(uchar *buf) ...@@ -11521,7 +11521,7 @@ void ha_mroonga::storage_store_fields_by_index(uchar *buf)
if (KEY_N_KEY_PARTS(key_info) == 1) { if (KEY_N_KEY_PARTS(key_info) == 1) {
my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(buf, table->record[0]); my_ptrdiff_t ptr_diff = PTR_BYTE_DIFF(buf, table->record[0]);
Field *field = key_info->key_part->field; Field *field = key_info->key_part->field;
mrn::DebugColumnAccess debug_column_access(table, table->write_set); mrn::DebugColumnAccess debug_column_access(table, &table->write_set);
field->move_field_offset(ptr_diff); field->move_field_offset(ptr_diff);
storage_store_field(field, (const char *)key, key_length); storage_store_field(field, (const char *)key, key_length);
field->move_field_offset(-ptr_diff); field->move_field_offset(-ptr_diff);
......
...@@ -20,17 +20,17 @@ ...@@ -20,17 +20,17 @@
#include "mrn_debug_column_access.hpp" #include "mrn_debug_column_access.hpp"
namespace mrn { namespace mrn {
DebugColumnAccess::DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap) DebugColumnAccess::DebugColumnAccess(TABLE *table, MY_BITMAP **bitmap)
: table_(table), : table_(table),
bitmap_(bitmap) { bitmap_(bitmap) {
#ifndef DBUG_OFF #ifndef DBUG_OFF
map_ = dbug_tmp_use_all_columns(table_, &bitmap_); map_ = dbug_tmp_use_all_columns(table_, bitmap_);
#endif #endif
} }
DebugColumnAccess::~DebugColumnAccess() { DebugColumnAccess::~DebugColumnAccess() {
#ifndef DBUG_OFF #ifndef DBUG_OFF
dbug_tmp_restore_column_map(&bitmap_, map_); dbug_tmp_restore_column_map(bitmap_, map_);
#endif #endif
} }
} }
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
namespace mrn { namespace mrn {
class DebugColumnAccess { class DebugColumnAccess {
TABLE *table_; TABLE *table_;
MY_BITMAP *bitmap_; MY_BITMAP **bitmap_;
#ifndef DBUG_OFF #ifndef DBUG_OFF
MY_BITMAP *map_; MY_BITMAP *map_;
#endif #endif
public: public:
DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap); DebugColumnAccess(TABLE *table, MY_BITMAP **bitmap);
~DebugColumnAccess(); ~DebugColumnAccess();
}; };
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment