mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failed
The assertion failed in handler::ha_reset upon SELECT under READ UNCOMMITTED from table with index on virtual column. This was the debug-only failure, though the problem is mush wider: * MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw bitmap. * read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP * The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE * The pointers to the stored MY_BITMAPs, like orig_read_set etc, and sometimes all_set and tmp_set, are assigned to the pointers. * Sometimes tmp_use_all_columns is used to substitute the raw bitmap directly with all_set.bitmap * Sometimes even bitmaps are directly modified, like in TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called. The last three bullets in the list, when used together (which is mostly always) make the program flow cumbersome and impossible to follow, notwithstanding the errors they cause, like this MDEV-17556, where tmp_set pointer was assigned to read_set, write_set and vcol_set, then its bitmap was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call, and then bitmap_clear_all(&tmp_set) was applied to all this. To untangle this knot, the rule should be applied: * Never substitute bitmaps! This patch is about this. orig_*, all_set bitmaps are never substituted already. This patch changes the following function prototypes: * tmp_use_all_columns, dbug_tmp_use_all_columns to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map* * tmp_restore_column_map, dbug_tmp_restore_column_maps to accept MY_BITMAP* instead of my_bitmap_map* These functions now will substitute read_set/write_set/vcol_set directly, and won't touch underlying bitmaps.
This commit is contained in:
@@ -47,7 +47,7 @@ static int table_to_string(TABLE *table, String *result)
|
||||
|
||||
res= table->file->ha_rnd_init(1);
|
||||
|
||||
dbug_tmp_use_all_columns(table, table->read_set);
|
||||
dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
while(!res && !table->file->ha_rnd_next(table->record[0]))
|
||||
{
|
||||
|
@@ -11166,7 +11166,7 @@ key_map Field::get_possible_keys()
|
||||
|
||||
bool Field::validate_value_in_record_with_warn(THD *thd, const uchar *record)
|
||||
{
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
bool rc;
|
||||
if ((rc= validate_value_in_record(thd, record)))
|
||||
{
|
||||
@@ -11178,7 +11178,7 @@ bool Field::validate_value_in_record_with_warn(THD *thd, const uchar *record)
|
||||
ER_THD(thd, ER_INVALID_DEFAULT_VALUE_FOR_FIELD),
|
||||
ErrConvString(&tmp).ptr(), field_name);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -4124,7 +4124,7 @@ int ha_partition::write_row(uchar * buf)
|
||||
int error;
|
||||
longlong func_value;
|
||||
bool have_auto_increment= table->next_number_field && buf == table->record[0];
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP *old_map;
|
||||
THD *thd= ha_thd();
|
||||
sql_mode_t saved_sql_mode= thd->variables.sql_mode;
|
||||
bool saved_auto_inc_field_not_null= table->auto_increment_field_not_null;
|
||||
@@ -4173,9 +4173,9 @@ int ha_partition::write_row(uchar * buf)
|
||||
}
|
||||
}
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
error= m_part_info->get_partition_id(m_part_info, &part_id, &func_value);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
if (unlikely(error))
|
||||
{
|
||||
m_part_info->err_value= func_value;
|
||||
|
@@ -1486,7 +1486,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
|
||||
TABLE *table= field->table;
|
||||
THD *thd= table->in_use;
|
||||
enum_check_fields tmp= thd->count_cuted_fields;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
sql_mode_t sql_mode= thd->variables.sql_mode;
|
||||
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
|
||||
thd->variables.sql_mode|= MODE_INVALID_DATES;
|
||||
@@ -1495,7 +1495,7 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
|
||||
res= save_in_field(field, no_conversions);
|
||||
|
||||
thd->count_cuted_fields= tmp;
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
thd->variables.sql_mode= sql_mode;
|
||||
return res;
|
||||
}
|
||||
|
@@ -428,13 +428,13 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
|
||||
TABLE *table= field->table;
|
||||
sql_mode_t orig_sql_mode= thd->variables.sql_mode;
|
||||
enum_check_fields orig_count_cuted_fields= thd->count_cuted_fields;
|
||||
my_bitmap_map *old_maps[2] = { NULL, NULL };
|
||||
MY_BITMAP *old_maps[2] = { NULL, NULL };
|
||||
ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */
|
||||
|
||||
/* table->read_set may not be set if we come here from a CREATE TABLE */
|
||||
if (table && table->read_set)
|
||||
dbug_tmp_use_all_columns(table, old_maps,
|
||||
table->read_set, table->write_set);
|
||||
&table->read_set, &table->write_set);
|
||||
/* For comparison purposes allow invalid dates like 2000-01-32 */
|
||||
thd->variables.sql_mode= (orig_sql_mode & ~MODE_NO_ZERO_DATE) |
|
||||
MODE_INVALID_DATES;
|
||||
@@ -478,7 +478,7 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
|
||||
thd->variables.sql_mode= orig_sql_mode;
|
||||
thd->count_cuted_fields= orig_count_cuted_fields;
|
||||
if (table && table->read_set)
|
||||
dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_maps);
|
||||
dbug_tmp_restore_column_maps(&table->read_set, &table->write_set, old_maps);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -244,14 +244,13 @@ void key_restore(uchar *to_record, const uchar *from_key, KEY *key_info,
|
||||
else if (key_part->key_part_flag & HA_VAR_LENGTH_PART)
|
||||
{
|
||||
Field *field= key_part->field;
|
||||
my_bitmap_map *old_map;
|
||||
my_ptrdiff_t ptrdiff= to_record - field->table->record[0];
|
||||
field->move_field_offset(ptrdiff);
|
||||
key_length-= HA_KEY_BLOB_LENGTH;
|
||||
length= MY_MIN(key_length, key_part->length);
|
||||
old_map= dbug_tmp_use_all_columns(field->table, field->table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(field->table, &field->table->write_set);
|
||||
field->set_key_image(from_key, length);
|
||||
dbug_tmp_restore_column_map(field->table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&field->table->write_set, old_map);
|
||||
from_key+= HA_KEY_BLOB_LENGTH;
|
||||
field->move_field_offset(-ptrdiff);
|
||||
}
|
||||
@@ -419,7 +418,7 @@ void field_unpack(String *to, Field *field, const uchar *rec, uint max_length,
|
||||
|
||||
void key_unpack(String *to, TABLE *table, KEY *key)
|
||||
{
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
DBUG_ENTER("key_unpack");
|
||||
|
||||
to->length(0);
|
||||
@@ -441,7 +440,7 @@ void key_unpack(String *to, TABLE *table, KEY *key)
|
||||
field_unpack(to, key_part->field, table->record[0], key_part->length,
|
||||
MY_TEST(key_part->key_part_flag & HA_PART_KEY_SEG));
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
@@ -3249,7 +3249,6 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
|
||||
void store_key_image_to_rec(Field *field, uchar *ptr, uint len)
|
||||
{
|
||||
/* Do the same as print_key() does */
|
||||
my_bitmap_map *old_map;
|
||||
|
||||
if (field->real_maybe_null())
|
||||
{
|
||||
@@ -3261,10 +3260,10 @@ void store_key_image_to_rec(Field *field, uchar *ptr, uint len)
|
||||
field->set_notnull();
|
||||
ptr++;
|
||||
}
|
||||
old_map= dbug_tmp_use_all_columns(field->table,
|
||||
field->table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(field->table,
|
||||
&field->table->write_set);
|
||||
field->set_key_image(ptr, len);
|
||||
dbug_tmp_restore_column_map(field->table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&field->table->write_set, old_map);
|
||||
}
|
||||
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
@@ -3479,7 +3478,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
|
||||
PART_PRUNE_PARAM prune_param;
|
||||
MEM_ROOT alloc;
|
||||
RANGE_OPT_PARAM *range_par= &prune_param.range_param;
|
||||
my_bitmap_map *old_sets[2];
|
||||
MY_BITMAP *old_sets[2];
|
||||
|
||||
prune_param.part_info= part_info;
|
||||
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0,
|
||||
@@ -3495,7 +3494,7 @@ bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond)
|
||||
}
|
||||
|
||||
dbug_tmp_use_all_columns(table, old_sets,
|
||||
table->read_set, table->write_set);
|
||||
&table->read_set, &table->write_set);
|
||||
range_par->thd= thd;
|
||||
range_par->table= table;
|
||||
/* range_par->cond doesn't need initialization */
|
||||
@@ -3592,7 +3591,7 @@ all_used:
|
||||
retval= FALSE; // some partitions are used
|
||||
mark_all_partitions_as_used(prune_param.part_info);
|
||||
end:
|
||||
dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
|
||||
dbug_tmp_restore_column_maps(&table->read_set, &table->write_set, old_sets);
|
||||
thd->no_errors=0;
|
||||
thd->mem_root= range_par->old_root;
|
||||
free_root(&alloc,MYF(0)); // Return memory & allocator
|
||||
@@ -14816,8 +14815,8 @@ static void
|
||||
print_sel_arg_key(Field *field, const uchar *key, String *out)
|
||||
{
|
||||
TABLE *table= field->table;
|
||||
my_bitmap_map *old_sets[2];
|
||||
dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
|
||||
MY_BITMAP *old_sets[2];
|
||||
dbug_tmp_use_all_columns(table, old_sets, &table->read_set, &table->write_set);
|
||||
|
||||
if (field->real_maybe_null())
|
||||
{
|
||||
@@ -14837,7 +14836,7 @@ print_sel_arg_key(Field *field, const uchar *key, String *out)
|
||||
field->val_str(out);
|
||||
|
||||
end:
|
||||
dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
|
||||
dbug_tmp_restore_column_maps(&table->read_set, &table->write_set, old_sets);
|
||||
}
|
||||
|
||||
|
||||
@@ -14932,9 +14931,9 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
|
||||
const uchar *key_end= key+used_length;
|
||||
uint store_length;
|
||||
TABLE *table= key_part->field->table;
|
||||
my_bitmap_map *old_sets[2];
|
||||
MY_BITMAP *old_sets[2];
|
||||
|
||||
dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
|
||||
dbug_tmp_use_all_columns(table, old_sets, &table->read_set, &table->write_set);
|
||||
|
||||
for (; key < key_end; key+=store_length, key_part++)
|
||||
{
|
||||
@@ -14961,7 +14960,7 @@ print_key(KEY_PART *key_part, const uchar *key, uint used_length)
|
||||
if (key+store_length < key_end)
|
||||
fputc('/',DBUG_FILE);
|
||||
}
|
||||
dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
|
||||
dbug_tmp_restore_column_maps(&table->read_set, &table->write_set, old_sets);
|
||||
}
|
||||
|
||||
|
||||
@@ -14969,16 +14968,16 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg)
|
||||
{
|
||||
char buf[MAX_KEY/8+1];
|
||||
TABLE *table;
|
||||
my_bitmap_map *old_sets[2];
|
||||
MY_BITMAP *old_sets[2];
|
||||
DBUG_ENTER("print_quick");
|
||||
if (!quick)
|
||||
DBUG_VOID_RETURN;
|
||||
DBUG_LOCK_FILE;
|
||||
|
||||
table= quick->head;
|
||||
dbug_tmp_use_all_columns(table, old_sets, table->read_set, table->write_set);
|
||||
dbug_tmp_use_all_columns(table, old_sets, &table->read_set, &table->write_set);
|
||||
quick->dbug_dump(0, TRUE);
|
||||
dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
|
||||
dbug_tmp_restore_column_maps(&table->read_set, &table->write_set, old_sets);
|
||||
|
||||
fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
|
||||
|
||||
|
@@ -1642,13 +1642,13 @@ void partition_info::print_no_partition_found(TABLE *table_arg, myf errflag)
|
||||
buf_ptr= (char*)"from column_list";
|
||||
else
|
||||
{
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table_arg, table_arg->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table_arg, &table_arg->read_set);
|
||||
if (part_expr->null_value)
|
||||
buf_ptr= (char*)"NULL";
|
||||
else
|
||||
longlong10_to_str(err_value, buf,
|
||||
part_expr->unsigned_flag ? 10 : -10);
|
||||
dbug_tmp_restore_column_map(table_arg->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table_arg->read_set, old_map);
|
||||
}
|
||||
my_error(ER_NO_PARTITION_FOR_GIVEN_VALUE, errflag, buf_ptr);
|
||||
}
|
||||
|
@@ -1250,15 +1250,15 @@ bool Protocol_text::store(Field *field)
|
||||
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
|
||||
#ifndef DBUG_OFF
|
||||
TABLE *table= field->table;
|
||||
my_bitmap_map *old_map= 0;
|
||||
MY_BITMAP *old_map= 0;
|
||||
if (table->file)
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
#endif
|
||||
|
||||
field->val_str(&str);
|
||||
#ifndef DBUG_OFF
|
||||
if (old_map)
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
#endif
|
||||
|
||||
return store_string_aux(str.ptr(), str.length(), str.charset(), tocs);
|
||||
|
@@ -600,7 +600,6 @@ mysql_ha_fix_cond_and_key(SQL_HANDLER *handler,
|
||||
}
|
||||
for (keypart_map= key_len=0 ; (item=it_ke++) ; key_part++)
|
||||
{
|
||||
my_bitmap_map *old_map;
|
||||
/* note that 'item' can be changed by fix_fields() call */
|
||||
if ((!item->fixed &&
|
||||
item->fix_fields(thd, it_ke.ref())) ||
|
||||
@@ -613,9 +612,9 @@ mysql_ha_fix_cond_and_key(SQL_HANDLER *handler,
|
||||
}
|
||||
if (!in_prepare)
|
||||
{
|
||||
old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
(void) item->save_in_field(key_part->field, 1);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
}
|
||||
key_len+= key_part->store_length;
|
||||
keypart_map= (keypart_map << 1) | 1;
|
||||
|
@@ -22463,7 +22463,7 @@ cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref)
|
||||
{
|
||||
enum enum_check_fields save_count_cuted_fields= thd->count_cuted_fields;
|
||||
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
bool result= 0;
|
||||
|
||||
for (store_key **copy=ref->key_copy ; *copy ; copy++)
|
||||
@@ -22475,7 +22475,7 @@ cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref)
|
||||
}
|
||||
}
|
||||
thd->count_cuted_fields= save_count_cuted_fields;
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -1842,8 +1842,8 @@ class store_key_field: public store_key
|
||||
enum store_key_result copy_inner()
|
||||
{
|
||||
TABLE *table= copy_field.to_field->table;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table,
|
||||
table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
|
||||
&table->write_set);
|
||||
|
||||
/*
|
||||
It looks like the next statement is needed only for a simplified
|
||||
@@ -1854,7 +1854,7 @@ class store_key_field: public store_key
|
||||
bzero(copy_field.to_ptr,copy_field.to_length);
|
||||
|
||||
copy_field.do_copy(©_field);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
null_key= to_field->is_null();
|
||||
return err != 0 ? STORE_KEY_FATAL : STORE_KEY_OK;
|
||||
}
|
||||
@@ -1889,8 +1889,8 @@ public:
|
||||
enum store_key_result copy_inner()
|
||||
{
|
||||
TABLE *table= to_field->table;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table,
|
||||
table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
|
||||
&table->write_set);
|
||||
int res= FALSE;
|
||||
|
||||
/*
|
||||
@@ -1911,7 +1911,7 @@ public:
|
||||
*/
|
||||
if (!res && table->in_use->is_error())
|
||||
res= 1; /* STORE_KEY_FATAL */
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
null_key= to_field->is_null() || item->null_value;
|
||||
return ((err != 0 || res < 0 || res > 2) ? STORE_KEY_FATAL :
|
||||
(store_key_result) res);
|
||||
@@ -1947,8 +1947,8 @@ protected:
|
||||
{
|
||||
inited=1;
|
||||
TABLE *table= to_field->table;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table,
|
||||
table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
|
||||
&table->write_set);
|
||||
if ((res= item->save_in_field(to_field, 1)))
|
||||
{
|
||||
if (!err)
|
||||
@@ -1960,7 +1960,7 @@ protected:
|
||||
*/
|
||||
if (!err && to_field->table->in_use->is_error())
|
||||
err= 1; /* STORE_KEY_FATAL */
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
}
|
||||
null_key= to_field->is_null() || item->null_value;
|
||||
return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err);
|
||||
|
@@ -1925,7 +1925,6 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
bool check_options= !(sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS) &&
|
||||
!create_info_arg;
|
||||
handlerton *hton;
|
||||
my_bitmap_map *old_map;
|
||||
int error= 0;
|
||||
DBUG_ENTER("show_create_table");
|
||||
DBUG_PRINT("enter",("table: %s", table->s->table_name.str));
|
||||
@@ -1987,7 +1986,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
We have to restore the read_set if we are called from insert in case
|
||||
of row based replication.
|
||||
*/
|
||||
old_map= tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
for (ptr=table->field ; (field= *ptr); ptr++)
|
||||
{
|
||||
@@ -2352,7 +2351,7 @@ int show_create_table(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
tmp_restore_column_map(table->read_set, old_map);
|
||||
tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
@@ -1044,9 +1044,8 @@ public:
|
||||
{
|
||||
char buff[MAX_FIELD_WIDTH];
|
||||
String val(buff, sizeof(buff), &my_charset_bin);
|
||||
my_bitmap_map *old_map;
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(stat_table, stat_table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(stat_table, &stat_table->read_set);
|
||||
|
||||
for (uint i= COLUMN_STAT_MIN_VALUE; i <= COLUMN_STAT_HISTOGRAM; i++)
|
||||
{
|
||||
@@ -1105,7 +1104,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
dbug_tmp_restore_column_map(stat_table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&stat_table->read_set, old_map);
|
||||
}
|
||||
|
||||
|
||||
|
38
sql/table.h
38
sql/table.h
@@ -2770,25 +2770,25 @@ typedef struct st_open_table_list{
|
||||
} OPEN_TABLE_LIST;
|
||||
|
||||
|
||||
static inline my_bitmap_map *tmp_use_all_columns(TABLE *table,
|
||||
MY_BITMAP *bitmap)
|
||||
static inline MY_BITMAP *tmp_use_all_columns(TABLE *table,
|
||||
MY_BITMAP **bitmap)
|
||||
{
|
||||
my_bitmap_map *old= bitmap->bitmap;
|
||||
bitmap->bitmap= table->s->all_set.bitmap;
|
||||
MY_BITMAP *old= *bitmap;
|
||||
*bitmap= &table->s->all_set;
|
||||
return old;
|
||||
}
|
||||
|
||||
|
||||
static inline void tmp_restore_column_map(MY_BITMAP *bitmap,
|
||||
my_bitmap_map *old)
|
||||
static inline void tmp_restore_column_map(MY_BITMAP **bitmap,
|
||||
MY_BITMAP *old)
|
||||
{
|
||||
bitmap->bitmap= old;
|
||||
*bitmap= old;
|
||||
}
|
||||
|
||||
/* The following is only needed for debugging */
|
||||
|
||||
static inline my_bitmap_map *dbug_tmp_use_all_columns(TABLE *table,
|
||||
MY_BITMAP *bitmap)
|
||||
static inline MY_BITMAP *dbug_tmp_use_all_columns(TABLE *table,
|
||||
MY_BITMAP **bitmap)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
return tmp_use_all_columns(table, bitmap);
|
||||
@@ -2797,8 +2797,8 @@ static inline my_bitmap_map *dbug_tmp_use_all_columns(TABLE *table,
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
|
||||
my_bitmap_map *old)
|
||||
static inline void dbug_tmp_restore_column_map(MY_BITMAP **bitmap,
|
||||
MY_BITMAP *old)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
tmp_restore_column_map(bitmap, old);
|
||||
@@ -2811,22 +2811,22 @@ static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap,
|
||||
Provide for the possiblity of the read set being the same as the write set
|
||||
*/
|
||||
static inline void dbug_tmp_use_all_columns(TABLE *table,
|
||||
my_bitmap_map **save,
|
||||
MY_BITMAP *read_set,
|
||||
MY_BITMAP *write_set)
|
||||
MY_BITMAP **save,
|
||||
MY_BITMAP **read_set,
|
||||
MY_BITMAP **write_set)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
save[0]= read_set->bitmap;
|
||||
save[1]= write_set->bitmap;
|
||||
save[0]= *read_set;
|
||||
save[1]= *write_set;
|
||||
(void) tmp_use_all_columns(table, read_set);
|
||||
(void) tmp_use_all_columns(table, write_set);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static inline void dbug_tmp_restore_column_maps(MY_BITMAP *read_set,
|
||||
MY_BITMAP *write_set,
|
||||
my_bitmap_map **old)
|
||||
static inline void dbug_tmp_restore_column_maps(MY_BITMAP **read_set,
|
||||
MY_BITMAP **write_set,
|
||||
MY_BITMAP **old)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
tmp_restore_column_map(read_set, old[0]);
|
||||
|
@@ -1546,7 +1546,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
share->rows_recorded= 0;
|
||||
stats.auto_increment_value= 1;
|
||||
share->archive_write.auto_increment= 0;
|
||||
my_bitmap_map *org_bitmap= tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *org_bitmap= tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
while (!(rc= get_row(&archive, table->record[0])))
|
||||
{
|
||||
@@ -1567,7 +1567,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
}
|
||||
}
|
||||
|
||||
tmp_restore_column_map(table->read_set, org_bitmap);
|
||||
tmp_restore_column_map(&table->read_set, org_bitmap);
|
||||
share->rows_recorded= (ha_rows)writer.rows;
|
||||
}
|
||||
|
||||
|
@@ -1641,18 +1641,18 @@ int ha_cassandra::index_read_map(uchar *buf, const uchar *key,
|
||||
|
||||
char *cass_key;
|
||||
int cass_key_len;
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP *old_map;
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
if (rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len))
|
||||
{
|
||||
/* We get here when making lookups like uuid_column='not-an-uuid' */
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(HA_ERR_KEY_NOT_FOUND);
|
||||
}
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
bool found;
|
||||
if (se->get_slice(cass_key, cass_key_len, &found))
|
||||
@@ -1726,8 +1726,8 @@ int ha_cassandra::read_cassandra_columns(bool unpack_pk)
|
||||
cassandra_to_mariadb() calls will use field->store(...) methods, which
|
||||
require that the column is in the table->write_set
|
||||
*/
|
||||
my_bitmap_map *old_map;
|
||||
old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map;
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
/* Start with all fields being NULL */
|
||||
for (field= table->field + 1; *field; field++)
|
||||
@@ -1848,7 +1848,7 @@ int ha_cassandra::read_cassandra_columns(bool unpack_pk)
|
||||
}
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1933,7 +1933,7 @@ void ha_cassandra::free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals,
|
||||
|
||||
int ha_cassandra::write_row(uchar *buf)
|
||||
{
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP *old_map;
|
||||
int ires;
|
||||
DBUG_ENTER("ha_cassandra::write_row");
|
||||
|
||||
@@ -1943,7 +1943,7 @@ int ha_cassandra::write_row(uchar *buf)
|
||||
if (!doing_insert_batch)
|
||||
se->clear_insert_buffer();
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
insert_lineno++;
|
||||
|
||||
@@ -1954,7 +1954,7 @@ int ha_cassandra::write_row(uchar *buf)
|
||||
{
|
||||
my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
|
||||
rowkey_converter->field->field_name, insert_lineno);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
|
||||
}
|
||||
se->start_row_insert(cass_key, cass_key_len);
|
||||
@@ -1977,7 +1977,7 @@ int ha_cassandra::write_row(uchar *buf)
|
||||
free_dynamic_row(&vals, &names);
|
||||
if (rc)
|
||||
{
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(rc);
|
||||
}
|
||||
}
|
||||
@@ -1988,7 +1988,7 @@ int ha_cassandra::write_row(uchar *buf)
|
||||
{
|
||||
my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
|
||||
field_converters[i]->field->field_name, insert_lineno);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
|
||||
}
|
||||
se->add_insert_column(field_converters[i]->field->field_name, 0,
|
||||
@@ -1996,7 +1996,7 @@ int ha_cassandra::write_row(uchar *buf)
|
||||
}
|
||||
}
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
bool res;
|
||||
|
||||
@@ -2263,8 +2263,8 @@ bool ha_cassandra::mrr_start_read()
|
||||
{
|
||||
uint key_len;
|
||||
|
||||
my_bitmap_map *old_map;
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map;
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
se->new_lookup_keys();
|
||||
|
||||
@@ -2288,7 +2288,7 @@ bool ha_cassandra::mrr_start_read()
|
||||
break;
|
||||
}
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
return se->multiget_slice();
|
||||
}
|
||||
@@ -2366,7 +2366,7 @@ int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
|
||||
LEX_STRING *oldnames, *names;
|
||||
uint oldcount, count;
|
||||
String oldvalcol, valcol;
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP *old_map;
|
||||
int res;
|
||||
DBUG_ENTER("ha_cassandra::update_row");
|
||||
/* Currently, it is guaranteed that new_data == table->record[0] */
|
||||
@@ -2374,7 +2374,7 @@ int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
|
||||
/* For now, just rewrite the full record */
|
||||
se->clear_insert_buffer();
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
|
||||
char *old_key;
|
||||
int old_key_len;
|
||||
@@ -2387,7 +2387,7 @@ int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
|
||||
{
|
||||
my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
|
||||
rowkey_converter->field->field_name, insert_lineno);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
@@ -2450,7 +2450,7 @@ int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
|
||||
{
|
||||
my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0),
|
||||
field_converters[i]->field->field_name, insert_lineno);
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
|
||||
}
|
||||
se->add_insert_column(field_converters[i]->field->field_name, 0,
|
||||
@@ -2477,7 +2477,7 @@ int ha_cassandra::update_row(const uchar *old_data, uchar *new_data)
|
||||
}
|
||||
}
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
res= se->do_insert();
|
||||
|
||||
|
@@ -2159,7 +2159,6 @@ int ha_connect::MakeRecord(char *buf)
|
||||
int rc= 0;
|
||||
Field* *field;
|
||||
Field *fp;
|
||||
my_bitmap_map *org_bitmap;
|
||||
CHARSET_INFO *charset= tdbp->data_charset();
|
||||
//MY_BITMAP readmap;
|
||||
MY_BITMAP *map;
|
||||
@@ -2174,7 +2173,7 @@ int ha_connect::MakeRecord(char *buf)
|
||||
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
|
||||
|
||||
// Avoid asserts in field::store() for columns that are not updated
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
// This is for variable_length rows
|
||||
memset(buf, 0, table->s->null_bytes);
|
||||
@@ -2201,7 +2200,7 @@ int ha_connect::MakeRecord(char *buf)
|
||||
continue;
|
||||
|
||||
htrc("Column %s not found\n", fp->field_name);
|
||||
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->write_set, org_bitmap);
|
||||
DBUG_RETURN(HA_ERR_WRONG_IN_RECORD);
|
||||
} // endif colp
|
||||
|
||||
@@ -2284,7 +2283,7 @@ int ha_connect::MakeRecord(char *buf)
|
||||
memcpy(buf, table->record[0], table->s->stored_rec_length);
|
||||
|
||||
// This is copied from ha_tina and is necessary to avoid asserts
|
||||
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->write_set, org_bitmap);
|
||||
DBUG_RETURN(rc);
|
||||
} // end of MakeRecord
|
||||
|
||||
@@ -2304,7 +2303,7 @@ int ha_connect::ScanRecord(PGLOBAL g, const uchar *)
|
||||
//PTDBASE tp= (PTDBASE)tdbp;
|
||||
String attribute(attr_buffer, sizeof(attr_buffer),
|
||||
table->s->table_charset);
|
||||
my_bitmap_map *bmap= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *bmap= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
const CHARSET_INFO *charset= tdbp->data_charset();
|
||||
String data_charset_value(data_buffer, sizeof(data_buffer), charset);
|
||||
|
||||
@@ -2426,7 +2425,7 @@ int ha_connect::ScanRecord(PGLOBAL g, const uchar *)
|
||||
} // endfor field
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->read_set, bmap);
|
||||
dbug_tmp_restore_column_map(&table->read_set, bmap);
|
||||
return rc;
|
||||
} // end of ScanRecord
|
||||
|
||||
@@ -2474,7 +2473,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
|
||||
OPVAL op;
|
||||
Field *fp;
|
||||
const key_range *ranges[2];
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP *old_map;
|
||||
KEY *kfp;
|
||||
KEY_PART_INFO *kpart;
|
||||
|
||||
@@ -2491,7 +2490,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
|
||||
both= ranges[0] && ranges[1];
|
||||
|
||||
kfp= &table->key_info[active_index];
|
||||
old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
for (i= 0; i <= 1; i++) {
|
||||
if (ranges[i] == NULL)
|
||||
@@ -2586,11 +2585,11 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q,
|
||||
if ((oom= qry->IsTruncated()))
|
||||
strcpy(g->Message, "Out of memory");
|
||||
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return oom;
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return true;
|
||||
} // end of MakeKeyWhere
|
||||
|
||||
|
@@ -528,7 +528,7 @@ int ha_tina::encode_quote(uchar *buf)
|
||||
String attribute(attribute_buffer, sizeof(attribute_buffer),
|
||||
&my_charset_bin);
|
||||
bool ietf_quotes= table_share->option_struct->ietf_quotes;
|
||||
my_bitmap_map *org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
buffer.length(0);
|
||||
|
||||
for (Field **field=table->field ; *field ; field++)
|
||||
@@ -606,7 +606,7 @@ int ha_tina::encode_quote(uchar *buf)
|
||||
|
||||
//buffer.replace(buffer.length(), 0, "\n", 1);
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->read_set, org_bitmap);
|
||||
return (buffer.length());
|
||||
}
|
||||
|
||||
@@ -659,7 +659,6 @@ int ha_tina::find_current_row(uchar *buf)
|
||||
{
|
||||
my_off_t end_offset, curr_offset= current_position;
|
||||
int eoln_len;
|
||||
my_bitmap_map *org_bitmap;
|
||||
int error;
|
||||
bool read_all;
|
||||
bool ietf_quotes= table_share->option_struct->ietf_quotes;
|
||||
@@ -679,7 +678,7 @@ int ha_tina::find_current_row(uchar *buf)
|
||||
/* We must read all columns in case a table is opened for update */
|
||||
read_all= !bitmap_is_clear_all(table->write_set);
|
||||
/* Avoid asserts in ::store() for columns that are not going to be updated */
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
error= HA_ERR_CRASHED_ON_USAGE;
|
||||
|
||||
memset(buf, 0, table->s->null_bytes);
|
||||
@@ -857,7 +856,7 @@ int ha_tina::find_current_row(uchar *buf)
|
||||
error= 0;
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->write_set, org_bitmap);
|
||||
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
@@ -936,7 +936,7 @@ uint ha_federated::convert_row_to_internal_format(uchar *record,
|
||||
{
|
||||
ulong *lengths;
|
||||
Field **field;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
DBUG_ENTER("ha_federated::convert_row_to_internal_format");
|
||||
|
||||
lengths= mysql_fetch_lengths(result);
|
||||
@@ -965,7 +965,7 @@ uint ha_federated::convert_row_to_internal_format(uchar *record,
|
||||
}
|
||||
(*field)->move_field_offset(-old_ptr);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -1293,14 +1293,13 @@ bool ha_federated::create_where_from_key(String *to,
|
||||
char tmpbuff[FEDERATED_QUERY_BUFFER_SIZE];
|
||||
String tmp(tmpbuff, sizeof(tmpbuff), system_charset_info);
|
||||
const key_range *ranges[2]= { start_key, end_key };
|
||||
my_bitmap_map *old_map;
|
||||
DBUG_ENTER("ha_federated::create_where_from_key");
|
||||
|
||||
tmp.length(0);
|
||||
if (start_key == NULL && end_key == NULL)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
for (uint i= 0; i <= 1; i++)
|
||||
{
|
||||
bool needs_quotes;
|
||||
@@ -1477,7 +1476,7 @@ prepare_for_next_key_part:
|
||||
tmp.c_ptr_quick()));
|
||||
}
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
|
||||
if (both_not_null)
|
||||
if (tmp.append(STRING_WITH_LEN(") ")))
|
||||
@@ -1492,7 +1491,7 @@ prepare_for_next_key_part:
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
@@ -1841,7 +1840,7 @@ int ha_federated::write_row(uchar *buf)
|
||||
String insert_field_value_string(insert_field_value_buffer,
|
||||
sizeof(insert_field_value_buffer),
|
||||
&my_charset_bin);
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
DBUG_ENTER("ha_federated::write_row");
|
||||
|
||||
values_string.length(0);
|
||||
@@ -1895,7 +1894,7 @@ int ha_federated::write_row(uchar *buf)
|
||||
values_string.append(STRING_WITH_LEN(", "));
|
||||
}
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
/*
|
||||
if there were no fields, we don't want to add a closing paren
|
||||
@@ -2203,7 +2202,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
|
||||
else
|
||||
{
|
||||
/* otherwise = */
|
||||
my_bitmap_map *old_map= tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= tmp_use_all_columns(table, &table->read_set);
|
||||
bool needs_quote= (*field)->str_needs_quotes();
|
||||
(*field)->val_str(&field_value);
|
||||
if (needs_quote)
|
||||
@@ -2212,7 +2211,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
|
||||
if (needs_quote)
|
||||
update_string.append(value_quote_char);
|
||||
field_value.length(0);
|
||||
tmp_restore_column_map(table->read_set, old_map);
|
||||
tmp_restore_column_map(&table->read_set, old_map);
|
||||
}
|
||||
update_string.append(STRING_WITH_LEN(", "));
|
||||
}
|
||||
|
@@ -859,7 +859,7 @@ uint ha_federatedx::convert_row_to_internal_format(uchar *record,
|
||||
ulong *lengths;
|
||||
Field **field;
|
||||
int column= 0;
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
DBUG_ENTER("ha_federatedx::convert_row_to_internal_format");
|
||||
|
||||
lengths= io->fetch_lengths(result);
|
||||
@@ -885,7 +885,7 @@ uint ha_federatedx::convert_row_to_internal_format(uchar *record,
|
||||
}
|
||||
(*field)->move_field_offset(-old_ptr);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -1213,14 +1213,13 @@ bool ha_federatedx::create_where_from_key(String *to,
|
||||
char tmpbuff[FEDERATEDX_QUERY_BUFFER_SIZE];
|
||||
String tmp(tmpbuff, sizeof(tmpbuff), system_charset_info);
|
||||
const key_range *ranges[2]= { start_key, end_key };
|
||||
my_bitmap_map *old_map;
|
||||
DBUG_ENTER("ha_federatedx::create_where_from_key");
|
||||
|
||||
tmp.length(0);
|
||||
if (start_key == NULL && end_key == NULL)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
for (uint i= 0; i <= 1; i++)
|
||||
{
|
||||
bool needs_quotes;
|
||||
@@ -1396,7 +1395,7 @@ prepare_for_next_key_part:
|
||||
tmp.c_ptr_quick()));
|
||||
}
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
|
||||
if (both_not_null)
|
||||
if (tmp.append(STRING_WITH_LEN(") ")))
|
||||
@@ -1411,7 +1410,7 @@ prepare_for_next_key_part:
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
@@ -1978,7 +1977,7 @@ int ha_federatedx::write_row(uchar *buf)
|
||||
String insert_field_value_string(insert_field_value_buffer,
|
||||
sizeof(insert_field_value_buffer),
|
||||
&my_charset_bin);
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
DBUG_ENTER("ha_federatedx::write_row");
|
||||
|
||||
values_string.length(0);
|
||||
@@ -2032,7 +2031,7 @@ int ha_federatedx::write_row(uchar *buf)
|
||||
values_string.append(STRING_WITH_LEN(", "));
|
||||
}
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
/*
|
||||
if there were no fields, we don't want to add a closing paren
|
||||
@@ -2354,7 +2353,7 @@ int ha_federatedx::update_row(const uchar *old_data, uchar *new_data)
|
||||
else
|
||||
{
|
||||
/* otherwise = */
|
||||
my_bitmap_map *old_map= tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= tmp_use_all_columns(table, &table->read_set);
|
||||
bool needs_quote= (*field)->str_needs_quotes();
|
||||
(*field)->val_str(&field_value);
|
||||
if (needs_quote)
|
||||
@@ -2363,7 +2362,7 @@ int ha_federatedx::update_row(const uchar *old_data, uchar *new_data)
|
||||
if (needs_quote)
|
||||
update_string.append(value_quote_char);
|
||||
field_value.length(0);
|
||||
tmp_restore_column_map(table->read_set, old_map);
|
||||
tmp_restore_column_map(&table->read_set, old_map);
|
||||
}
|
||||
update_string.append(STRING_WITH_LEN(", "));
|
||||
}
|
||||
|
@@ -21994,11 +21994,11 @@ innobase_get_computed_value(
|
||||
|
||||
field = dtuple_get_nth_v_field(row, col->v_pos);
|
||||
|
||||
my_bitmap_map* old_write_set = dbug_tmp_use_all_columns(mysql_table, mysql_table->write_set);
|
||||
my_bitmap_map* old_read_set = dbug_tmp_use_all_columns(mysql_table, mysql_table->read_set);
|
||||
MY_BITMAP *old_write_set = dbug_tmp_use_all_columns(mysql_table, &mysql_table->write_set);
|
||||
MY_BITMAP *old_read_set = dbug_tmp_use_all_columns(mysql_table, &mysql_table->read_set);
|
||||
ret = mysql_table->update_virtual_field(mysql_table->field[col->m_col.ind]);
|
||||
dbug_tmp_restore_column_map(mysql_table->read_set, old_read_set);
|
||||
dbug_tmp_restore_column_map(mysql_table->write_set, old_write_set);
|
||||
dbug_tmp_restore_column_map(&mysql_table->read_set, old_read_set);
|
||||
dbug_tmp_restore_column_map(&mysql_table->write_set, old_write_set);
|
||||
|
||||
if (ret != 0) {
|
||||
DBUG_RETURN(NULL);
|
||||
|
@@ -1944,9 +1944,9 @@ innobase_row_to_mysql(
|
||||
}
|
||||
}
|
||||
if (table->vfield) {
|
||||
my_bitmap_map* old_vcol_set = tmp_use_all_columns(table, table->vcol_set);
|
||||
MY_BITMAP *old_vcol_set = tmp_use_all_columns(table, &table->vcol_set);
|
||||
table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_READ);
|
||||
tmp_restore_column_map(table->vcol_set, old_vcol_set);
|
||||
tmp_restore_column_map(&table->vcol_set, old_vcol_set);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,13 +24,13 @@ namespace mrn {
|
||||
: table_(table),
|
||||
bitmap_(bitmap) {
|
||||
#ifndef DBUG_OFF
|
||||
map_ = dbug_tmp_use_all_columns(table_, bitmap_);
|
||||
map_ = dbug_tmp_use_all_columns(table_, &bitmap_);
|
||||
#endif
|
||||
}
|
||||
|
||||
DebugColumnAccess::~DebugColumnAccess() {
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(bitmap_, map_);
|
||||
dbug_tmp_restore_column_map(&bitmap_, map_);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ namespace mrn {
|
||||
TABLE *table_;
|
||||
MY_BITMAP *bitmap_;
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *map_;
|
||||
MY_BITMAP *map_;
|
||||
#endif
|
||||
public:
|
||||
DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap);
|
||||
|
@@ -907,7 +907,7 @@ int ha_oqgraph::index_read_idx(byte * buf, uint index, const byte * key,
|
||||
bmove_align(buf, table->s->default_values, table->s->reclength);
|
||||
key_restore(buf, (byte*) key, key_info, key_len);
|
||||
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
my_ptrdiff_t ptrdiff= buf - table->record[0];
|
||||
|
||||
if (ptrdiff)
|
||||
@@ -936,7 +936,7 @@ int ha_oqgraph::index_read_idx(byte * buf, uint index, const byte * key,
|
||||
field[1]->move_field_offset(-ptrdiff);
|
||||
field[2]->move_field_offset(-ptrdiff);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
return error_code(oqgraph::NO_MORE_DATA);
|
||||
}
|
||||
}
|
||||
@@ -961,7 +961,7 @@ int ha_oqgraph::index_read_idx(byte * buf, uint index, const byte * key,
|
||||
field[1]->move_field_offset(-ptrdiff);
|
||||
field[2]->move_field_offset(-ptrdiff);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
// Keep the latch around so we can use it in the query result later -
|
||||
// See fill_record().
|
||||
@@ -994,7 +994,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
|
||||
|
||||
bmove_align(record, table->s->default_values, table->s->reclength);
|
||||
|
||||
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
my_ptrdiff_t ptrdiff= record - table->record[0];
|
||||
|
||||
if (ptrdiff)
|
||||
@@ -1070,7 +1070,7 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
|
||||
field[4]->move_field_offset(-ptrdiff);
|
||||
field[5]->move_field_offset(-ptrdiff);
|
||||
}
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -188,17 +188,15 @@ ha_rows PFS_engine_table_share::get_row_count(void) const
|
||||
int PFS_engine_table_share::write_row(TABLE *table, unsigned char *buf,
|
||||
Field **fields) const
|
||||
{
|
||||
my_bitmap_map *org_bitmap;
|
||||
|
||||
if (m_write_row == NULL)
|
||||
{
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
}
|
||||
|
||||
/* We internally read from Fields to support the write interface */
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
int result= m_write_row(table, buf, fields);
|
||||
dbug_tmp_restore_column_map(table->read_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->read_set, org_bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -256,7 +254,6 @@ int PFS_engine_table::read_row(TABLE *table,
|
||||
unsigned char *buf,
|
||||
Field **fields)
|
||||
{
|
||||
my_bitmap_map *org_bitmap;
|
||||
Field *f;
|
||||
Field **fields_reset;
|
||||
|
||||
@@ -264,7 +261,7 @@ int PFS_engine_table::read_row(TABLE *table,
|
||||
bool read_all= !bitmap_is_clear_all(table->write_set);
|
||||
|
||||
/* We internally write to Fields to support the read interface */
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
/*
|
||||
Some callers of the storage engine interface do not honor the
|
||||
@@ -276,7 +273,7 @@ int PFS_engine_table::read_row(TABLE *table,
|
||||
f->reset();
|
||||
|
||||
int result= read_row_values(table, buf, fields, read_all);
|
||||
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->write_set, org_bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -294,12 +291,10 @@ int PFS_engine_table::update_row(TABLE *table,
|
||||
unsigned char *new_buf,
|
||||
Field **fields)
|
||||
{
|
||||
my_bitmap_map *org_bitmap;
|
||||
|
||||
/* We internally read from Fields to support the write interface */
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
int result= update_row_values(table, old_buf, new_buf, fields);
|
||||
dbug_tmp_restore_column_map(table->read_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->read_set, org_bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -308,12 +303,10 @@ int PFS_engine_table::delete_row(TABLE *table,
|
||||
const unsigned char *buf,
|
||||
Field **fields)
|
||||
{
|
||||
my_bitmap_map *org_bitmap;
|
||||
|
||||
/* We internally read from Fields to support the delete interface */
|
||||
org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *org_bitmap= dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
int result= delete_row_values(table, buf, fields);
|
||||
dbug_tmp_restore_column_map(table->read_set, org_bitmap);
|
||||
dbug_tmp_restore_column_map(&table->read_set, org_bitmap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@@ -6085,8 +6085,7 @@ ulonglong ha_rocksdb::load_auto_incr_value_from_index() {
|
||||
Field *field =
|
||||
table->key_info[table->s->next_number_index].key_part[0].field;
|
||||
ulonglong max_val = rdb_get_int_col_max_value(field);
|
||||
my_bitmap_map *const old_map =
|
||||
dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *const old_map = dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
last_val = field->val_int();
|
||||
if (last_val != max_val) {
|
||||
last_val++;
|
||||
@@ -6101,7 +6100,7 @@ ulonglong ha_rocksdb::load_auto_incr_value_from_index() {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
}
|
||||
|
||||
m_keyread_only = save_keyread_only;
|
||||
@@ -6138,15 +6137,15 @@ void ha_rocksdb::update_auto_incr_val_from_field() {
|
||||
field = table->key_info[table->s->next_number_index].key_part[0].field;
|
||||
max_val = rdb_get_int_col_max_value(field);
|
||||
|
||||
my_bitmap_map *const old_map =
|
||||
dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *const old_map =
|
||||
dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
new_val = field->val_int();
|
||||
// don't increment if we would wrap around
|
||||
if (new_val != max_val) {
|
||||
new_val++;
|
||||
}
|
||||
|
||||
dbug_tmp_restore_column_map(table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, old_map);
|
||||
|
||||
// Only update if positive value was set for auto_incr column.
|
||||
if (new_val <= max_val) {
|
||||
|
@@ -1488,12 +1488,12 @@ void Rdb_key_def::pack_with_make_sort_key(
|
||||
DBUG_ASSERT(*dst != nullptr);
|
||||
|
||||
const int max_len = fpi->m_max_image_len;
|
||||
my_bitmap_map *old_map;
|
||||
MY_BITMAP*old_map;
|
||||
|
||||
old_map= dbug_tmp_use_all_columns(field->table,
|
||||
field->table->read_set);
|
||||
&field->table->read_set);
|
||||
field->sort_string(*dst, max_len);
|
||||
dbug_tmp_restore_column_map(field->table->read_set, old_map);
|
||||
dbug_tmp_restore_column_map(&field->table->read_set, old_map);
|
||||
*dst += max_len;
|
||||
}
|
||||
|
||||
|
@@ -115,13 +115,13 @@ THR_LOCK_DATA **ha_seq::store_lock(THD *thd, THR_LOCK_DATA **to,
|
||||
|
||||
void ha_seq::set(unsigned char *buf)
|
||||
{
|
||||
my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map = dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
my_ptrdiff_t offset = (my_ptrdiff_t) (buf - table->record[0]);
|
||||
Field *field = table->field[0];
|
||||
field->move_field_offset(offset);
|
||||
field->store(cur, true);
|
||||
field->move_field_offset(-offset);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
}
|
||||
|
||||
int ha_seq::rnd_init(bool scan)
|
||||
|
@@ -3047,7 +3047,7 @@ int ha_sphinx::get_rec ( byte * buf, const byte *, uint )
|
||||
}
|
||||
|
||||
#if MYSQL_VERSION_ID>50100
|
||||
my_bitmap_map * org_bitmap = dbug_tmp_use_all_columns ( table, table->write_set );
|
||||
MY_BITMAP * org_bitmap = dbug_tmp_use_all_columns ( table, &table->write_set );
|
||||
#endif
|
||||
Field ** field = table->field;
|
||||
|
||||
@@ -3193,7 +3193,7 @@ int ha_sphinx::get_rec ( byte * buf, const byte *, uint )
|
||||
m_iCurrentPos++;
|
||||
|
||||
#if MYSQL_VERSION_ID > 50100
|
||||
dbug_tmp_restore_column_map ( table->write_set, org_bitmap );
|
||||
dbug_tmp_restore_column_map ( &table->write_set, org_bitmap );
|
||||
#endif
|
||||
|
||||
SPH_RET(0);
|
||||
|
@@ -9737,12 +9737,12 @@ int ha_spider::write_row(
|
||||
if (!table->auto_increment_field_not_null)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
table->next_number_field->store((longlong) 0, TRUE);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
force_auto_increment = FALSE;
|
||||
table->file->insert_id_for_cur_row = 0;
|
||||
@@ -9750,13 +9750,13 @@ int ha_spider::write_row(
|
||||
} else if (auto_increment_mode == 2)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
table->next_number_field->store((longlong) 0, TRUE);
|
||||
table->auto_increment_field_not_null = FALSE;
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
force_auto_increment = FALSE;
|
||||
table->file->insert_id_for_cur_row = 0;
|
||||
|
@@ -1624,7 +1624,7 @@ int spider_db_append_key_where_internal(
|
||||
DBUG_PRINT("info", ("spider end_key_part_map=%lu", end_key_part_map));
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map = dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *tmp_map = dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
#endif
|
||||
|
||||
if (sql_kind == SPIDER_SQL_KIND_HANDLER)
|
||||
@@ -2427,7 +2427,7 @@ end:
|
||||
if (sql_kind == SPIDER_SQL_KIND_SQL)
|
||||
dbton_hdl->set_order_pos(sql_type);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@@ -2928,15 +2928,15 @@ int spider_db_fetch_table(
|
||||
bitmap_is_set(table->write_set, (*field)->field_index)
|
||||
)) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", (*field)->field_name));
|
||||
if ((error_num =
|
||||
spider_db_fetch_row(share, *field, row, ptr_diff)))
|
||||
DBUG_RETURN(error_num);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
row->next();
|
||||
@@ -3099,15 +3099,15 @@ int spider_db_fetch_key(
|
||||
bitmap_is_set(table->write_set, field->field_index)
|
||||
)) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", field->field_name));
|
||||
if ((error_num =
|
||||
spider_db_fetch_row(share, field, row, ptr_diff)))
|
||||
DBUG_RETURN(error_num);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
row->next();
|
||||
@@ -3213,14 +3213,14 @@ int spider_db_fetch_minimum_columns(
|
||||
bitmap_is_set(table->write_set, (*field)->field_index)
|
||||
)) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", (*field)->field_name));
|
||||
if ((error_num = spider_db_fetch_row(share, *field, row, ptr_diff)))
|
||||
DBUG_RETURN(error_num);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
row->next();
|
||||
@@ -5128,15 +5128,15 @@ int spider_db_seek_tmp_table(
|
||||
bitmap_is_set(table->write_set, (*field)->field_index)
|
||||
)) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", (*field)->field_name));
|
||||
if ((error_num =
|
||||
spider_db_fetch_row(spider->share, *field, row, ptr_diff)))
|
||||
DBUG_RETURN(error_num);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
row->next();
|
||||
@@ -5215,15 +5215,15 @@ int spider_db_seek_tmp_key(
|
||||
bitmap_is_set(table->write_set, field->field_index)
|
||||
)) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", field->field_name));
|
||||
if ((error_num =
|
||||
spider_db_fetch_row(spider->share, field, row, ptr_diff)))
|
||||
DBUG_RETURN(error_num);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
row->next();
|
||||
@@ -5305,8 +5305,8 @@ int spider_db_seek_tmp_minimum_columns(
|
||||
bitmap_is_set(table->write_set, (*field)->field_index)));
|
||||
*/
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
DBUG_PRINT("info", ("spider bitmap is set %s", (*field)->field_name));
|
||||
if ((error_num =
|
||||
@@ -5314,7 +5314,7 @@ int spider_db_seek_tmp_minimum_columns(
|
||||
DBUG_RETURN(error_num);
|
||||
row->next();
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
else if (bitmap_is_set(table->read_set, (*field)->field_index))
|
||||
@@ -8680,8 +8680,8 @@ int spider_db_udf_fetch_table(
|
||||
DBUG_RETURN(HA_ERR_END_OF_FILE);
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
#endif
|
||||
for (
|
||||
roop_count = 0,
|
||||
@@ -8694,7 +8694,7 @@ int spider_db_udf_fetch_table(
|
||||
spider_db_udf_fetch_row(trx, *field, row)))
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
DBUG_RETURN(error_num);
|
||||
}
|
||||
@@ -8704,7 +8704,7 @@ int spider_db_udf_fetch_table(
|
||||
for (; roop_count < set_off; roop_count++, field++)
|
||||
(*field)->set_default();
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->write_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, tmp_map);
|
||||
#endif
|
||||
table->status = 0;
|
||||
DBUG_RETURN(0);
|
||||
|
@@ -6528,8 +6528,7 @@ int spider_mysql_handler::append_update_set(
|
||||
mysql_share->append_column_name(str, (*fields)->field_index);
|
||||
str->q_append(SPIDER_SQL_EQUAL_STR, SPIDER_SQL_EQUAL_LEN);
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map = dbug_tmp_use_all_columns(table,
|
||||
table->read_set);
|
||||
MY_BITMAP *tmp_map = dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
#endif
|
||||
if (
|
||||
spider_db_mysql_utility.
|
||||
@@ -6538,12 +6537,12 @@ int spider_mysql_handler::append_update_set(
|
||||
str->reserve(SPIDER_SQL_COMMA_LEN)
|
||||
) {
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
}
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
str->q_append(SPIDER_SQL_COMMA_STR, SPIDER_SQL_COMMA_LEN);
|
||||
@@ -9172,8 +9171,8 @@ int spider_mysql_handler::append_insert_values(
|
||||
bitmap_is_set(table->read_set, (*field)->field_index)
|
||||
) {
|
||||
#ifndef DBUG_OFF
|
||||
my_bitmap_map *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, table->read_set);
|
||||
MY_BITMAP *tmp_map =
|
||||
dbug_tmp_use_all_columns(table, &table->read_set);
|
||||
#endif
|
||||
add_value = TRUE;
|
||||
DBUG_PRINT("info",("spider is_null()=%s",
|
||||
@@ -9195,7 +9194,7 @@ int spider_mysql_handler::append_insert_values(
|
||||
if (str->reserve(SPIDER_SQL_NULL_LEN + SPIDER_SQL_COMMA_LEN))
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
str->length(0);
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
@@ -9209,7 +9208,7 @@ int spider_mysql_handler::append_insert_values(
|
||||
str->reserve(SPIDER_SQL_COMMA_LEN)
|
||||
) {
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
str->length(0);
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
@@ -9217,7 +9216,7 @@ int spider_mysql_handler::append_insert_values(
|
||||
}
|
||||
str->q_append(SPIDER_SQL_COMMA_STR, SPIDER_SQL_COMMA_LEN);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_tmp_restore_column_map(table->read_set, tmp_map);
|
||||
dbug_tmp_restore_column_map(&table->read_set, tmp_map);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -2313,7 +2313,7 @@ int ha_tokudb::pack_row_in_buff(
|
||||
int r = ENOSYS;
|
||||
memset((void *) row, 0, sizeof(*row));
|
||||
|
||||
my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map = dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
// Copy null bytes
|
||||
memcpy(row_buff, record, table_share->null_bytes);
|
||||
@@ -2362,7 +2362,7 @@ int ha_tokudb::pack_row_in_buff(
|
||||
row->size = (size_t) (var_field_data_ptr - row_buff);
|
||||
r = 0;
|
||||
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -2758,7 +2758,7 @@ DBT* ha_tokudb::create_dbt_key_from_key(
|
||||
{
|
||||
uint32_t size = 0;
|
||||
uchar* tmp_buff = buff;
|
||||
my_bitmap_map *old_map = dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP *old_map = dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
key->data = buff;
|
||||
|
||||
@@ -2797,7 +2797,7 @@ DBT* ha_tokudb::create_dbt_key_from_key(
|
||||
|
||||
key->size = size;
|
||||
DBUG_DUMP("key", (uchar *) key->data, key->size);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
return key;
|
||||
}
|
||||
|
||||
@@ -2890,7 +2890,7 @@ DBT* ha_tokudb::pack_key(
|
||||
KEY* key_info = &table->key_info[keynr];
|
||||
KEY_PART_INFO* key_part = key_info->key_part;
|
||||
KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts;
|
||||
my_bitmap_map* old_map = dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP* old_map = dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
memset((void *) key, 0, sizeof(*key));
|
||||
key->data = buff;
|
||||
@@ -2927,7 +2927,7 @@ DBT* ha_tokudb::pack_key(
|
||||
|
||||
key->size = (buff - (uchar *) key->data);
|
||||
DBUG_DUMP("key", (uchar *) key->data, key->size);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(key);
|
||||
}
|
||||
|
||||
@@ -2955,7 +2955,7 @@ DBT* ha_tokudb::pack_ext_key(
|
||||
KEY* key_info = &table->key_info[keynr];
|
||||
KEY_PART_INFO* key_part = key_info->key_part;
|
||||
KEY_PART_INFO* end = key_part + key_info->user_defined_key_parts;
|
||||
my_bitmap_map* old_map = dbug_tmp_use_all_columns(table, table->write_set);
|
||||
MY_BITMAP* old_map = dbug_tmp_use_all_columns(table, &table->write_set);
|
||||
|
||||
memset((void *) key, 0, sizeof(*key));
|
||||
key->data = buff;
|
||||
@@ -3034,7 +3034,7 @@ DBT* ha_tokudb::pack_ext_key(
|
||||
|
||||
key->size = (buff - (uchar *) key->data);
|
||||
DBUG_DUMP("key", (uchar *) key->data, key->size);
|
||||
dbug_tmp_restore_column_map(table->write_set, old_map);
|
||||
dbug_tmp_restore_column_map(&table->write_set, old_map);
|
||||
DBUG_RETURN(key);
|
||||
}
|
||||
#endif // defined(TOKU_INCLUDE_EXTENDED_KEYS) && TOKU_INCLUDE_EXTENDED_KEYS
|
||||
|
Reference in New Issue
Block a user