summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-02-19 14:05:15 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-02-19 14:05:15 +0400
commitd12c7adf715677b118104d4e5adf6f978c27b4ee (patch)
tree04cdbaf4509cbe485cb992e271ab8d711a867011 /storage
parentfd1437dfe532ed78ce2a1c8e05a989fcbf79832e (diff)
downloadmariadb-git-d12c7adf715677b118104d4e5adf6f978c27b4ee.tar.gz
MDEV-5314 - Compiling fails on OSX using clang
This is port of fix for MySQL BUG#17647863. revno: 5572 revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj committer: Jon Olav Hauglid <jon.hauglid@oracle.com> timestamp: Thu 2013-10-31 00:22:43 +0100 message: Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM Rename test() macro to MY_TEST() to avoid conflict with libc++.
Diffstat (limited to 'storage')
-rw-r--r--storage/federated/ha_federated.cc4
-rw-r--r--storage/federatedx/ha_federatedx.cc4
-rw-r--r--storage/heap/ha_heap.cc4
-rw-r--r--storage/heap/hp_hash.c6
-rw-r--r--storage/maria/ha_maria.cc22
-rw-r--r--storage/maria/ha_maria.h2
-rw-r--r--storage/maria/ma_blockrec.c2
-rw-r--r--storage/maria/ma_check.c21
-rw-r--r--storage/maria/ma_create.c9
-rw-r--r--storage/maria/ma_dynrec.c10
-rw-r--r--storage/maria/ma_extra.c6
-rw-r--r--storage/maria/ma_ft_boolean_search.c2
-rw-r--r--storage/maria/ma_locking.c2
-rw-r--r--storage/maria/ma_loghandler.c16
-rw-r--r--storage/maria/ma_open.c4
-rw-r--r--storage/maria/ma_packrec.c6
-rw-r--r--storage/maria/ma_pagecache.c2
-rw-r--r--storage/maria/ma_pagecrc.c2
-rw-r--r--storage/maria/ma_range.c2
-rw-r--r--storage/maria/ma_recovery.c2
-rw-r--r--storage/maria/ma_test1.c2
-rw-r--r--storage/maria/maria_chk.c7
-rw-r--r--storage/maria/unittest/ma_pagecache_single.c56
-rw-r--r--storage/maria/unittest/ma_test_loghandler-t.c2
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multigroup-t.c2
-rw-r--r--storage/myisam/ft_boolean_search.c2
-rw-r--r--storage/myisam/ha_myisam.cc20
-rw-r--r--storage/myisam/mi_check.c14
-rw-r--r--storage/myisam/mi_checksum.c2
-rw-r--r--storage/myisam/mi_create.c7
-rw-r--r--storage/myisam/mi_delete.c4
-rw-r--r--storage/myisam/mi_dynrec.c10
-rw-r--r--storage/myisam/mi_extra.c4
-rw-r--r--storage/myisam/mi_locking.c2
-rw-r--r--storage/myisam/mi_open.c6
-rw-r--r--storage/myisam/mi_search.c4
-rw-r--r--storage/myisam/mi_test1.c7
-rw-r--r--storage/myisam/myisamchk.c7
-rw-r--r--storage/spider/ha_spider.cc32
-rw-r--r--storage/tokudb/ha_tokudb.cc26
-rw-r--r--storage/tokudb/ha_tokudb_admin.cc4
-rw-r--r--storage/tokudb/ha_tokudb_alter_56.cc12
-rw-r--r--storage/tokudb/ha_tokudb_update.cc6
43 files changed, 186 insertions, 180 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 644f6c2a04e..43e9e7b598c 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1466,7 +1466,7 @@ prepare_for_next_key_part:
ptr was incremented by 1. Since store_length still counts null-byte,
we need to subtract 1 from store_length.
*/
- ptr+= store_length - test(key_part->null_bit);
+ ptr+= store_length - MY_TEST(key_part->null_bit);
if (tmp.append(STRING_WITH_LEN(" AND ")))
goto err;
@@ -2129,7 +2129,7 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
this? Because we only are updating one record, and LIMIT enforces
this.
*/
- bool has_a_primary_key= test(table->s->primary_key != MAX_KEY);
+ bool has_a_primary_key= MY_TEST(table->s->primary_key != MAX_KEY);
/*
buffers for following strings
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index f8ec026be66..a4bea0b2cad 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1386,7 +1386,7 @@ prepare_for_next_key_part:
ptr was incremented by 1. Since store_length still counts null-byte,
we need to subtract 1 from store_length.
*/
- ptr+= store_length - test(key_part->null_bit);
+ ptr+= store_length - MY_TEST(key_part->null_bit);
if (tmp.append(STRING_WITH_LEN(" AND ")))
goto err;
@@ -2286,7 +2286,7 @@ int ha_federatedx::update_row(const uchar *old_data, uchar *new_data)
this? Because we only are updating one record, and LIMIT enforces
this.
*/
- bool has_a_primary_key= test(table->s->primary_key != MAX_KEY);
+ bool has_a_primary_key= MY_TEST(table->s->primary_key != MAX_KEY);
/*
buffers for following strings
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index b9ff9d28159..73dce174a09 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -90,7 +90,7 @@ ha_heap::ha_heap(handlerton *hton, TABLE_SHARE *table_arg)
int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
- internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE);
+ internal_table= MY_TEST(test_if_locked & HA_OPEN_INTERNAL_TABLE);
if (internal_table || (!(file= heap_open(name, mode)) && my_errno == ENOENT))
{
HP_CREATE_INFO create_info;
@@ -106,7 +106,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
if (rc)
goto end;
- implicit_emptied= test(created_new_share);
+ implicit_emptied= MY_TEST(created_new_share);
if (internal_table)
file= heap_open_from_share(internal_share, mode);
else
diff --git a/storage/heap/hp_hash.c b/storage/heap/hp_hash.c
index 2abed55459c..f96cf866138 100644
--- a/storage/heap/hp_hash.c
+++ b/storage/heap/hp_hash.c
@@ -640,7 +640,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const uchar *rec, const uchar *key)
{
if (seg->null_bit)
{
- int found_null=test(rec[seg->null_pos] & seg->null_bit);
+ int found_null= MY_TEST(rec[seg->null_pos] & seg->null_bit);
if (found_null != (int) *key++)
return 1;
if (found_null)
@@ -737,7 +737,7 @@ void hp_make_key(HP_KEYDEF *keydef, uchar *key, const uchar *rec)
uint char_length= seg->length;
uchar *pos= (uchar*) rec + seg->start;
if (seg->null_bit)
- *key++= test(rec[seg->null_pos] & seg->null_bit);
+ *key++= MY_TEST(rec[seg->null_pos] & seg->null_bit);
if (cs->mbmaxlen > 1)
{
char_length= my_charpos(cs, pos, pos + seg->length,
@@ -776,7 +776,7 @@ uint hp_rb_make_key(HP_KEYDEF *keydef, uchar *key,
uint char_length;
if (seg->null_bit)
{
- if (!(*key++= 1 - test(rec[seg->null_pos] & seg->null_bit)))
+ if (!(*key++= 1 - MY_TEST(rec[seg->null_pos] & seg->null_bit)))
continue;
}
if (seg->flag & HA_SWAP_KEY)
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 5c410151456..081e90f89f7 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -724,8 +724,8 @@ int maria_check_definition(MARIA_KEYDEF *t1_keyinfo,
{
DBUG_PRINT("error", ("Key %d has different definition", i));
DBUG_PRINT("error", ("t1_fulltext= %d, t2_fulltext=%d",
- test(t1_keyinfo[i].flag & HA_FULLTEXT),
- test(t2_keyinfo[i].flag & HA_FULLTEXT)));
+ MY_TEST(t1_keyinfo[i].flag & HA_FULLTEXT),
+ MY_TEST(t2_keyinfo[i].flag & HA_FULLTEXT)));
DBUG_RETURN(1);
}
if (t1_keyinfo[i].flag & HA_SPATIAL && t2_keyinfo[i].flag & HA_SPATIAL)
@@ -735,8 +735,8 @@ int maria_check_definition(MARIA_KEYDEF *t1_keyinfo,
{
DBUG_PRINT("error", ("Key %d has different definition", i));
DBUG_PRINT("error", ("t1_spatial= %d, t2_spatial=%d",
- test(t1_keyinfo[i].flag & HA_SPATIAL),
- test(t2_keyinfo[i].flag & HA_SPATIAL)));
+ MY_TEST(t1_keyinfo[i].flag & HA_SPATIAL),
+ MY_TEST(t2_keyinfo[i].flag & HA_SPATIAL)));
DBUG_RETURN(1);
}
if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs ||
@@ -1334,7 +1334,7 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt)
share->pack.header_length, 1, MYF(MY_WME))))
{
error= maria_chk_data_link(&param, file,
- test(param.testflag & T_EXTEND));
+ MY_TEST(param.testflag & T_EXTEND));
end_io_cache(&(param.read_cache));
}
param.testflag= old_testflag;
@@ -1627,7 +1627,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
thd_proc_info(thd, buf);
param->testflag|= T_REP_PARALLEL;
error= maria_repair_parallel(param, file, fixed_name,
- test(param->testflag & T_QUICK));
+ MY_TEST(param->testflag & T_QUICK));
/* to reset proc_info, as it was pointing to local buffer */
thd_proc_info(thd, "Repair done");
}
@@ -1636,7 +1636,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
thd_proc_info(thd, "Repair by sorting");
param->testflag|= T_REP_BY_SORT;
error= maria_repair_by_sort(param, file, fixed_name,
- test(param->testflag & T_QUICK));
+ MY_TEST(param->testflag & T_QUICK));
}
if (error && file->create_unique_index_by_sort &&
share->state.dupp_key != MAX_KEY)
@@ -1648,7 +1648,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
thd_proc_info(thd, "Repair with keycache");
param->testflag &= ~(T_REP_BY_SORT | T_REP_PARALLEL);
error= maria_repair(param, file, fixed_name,
- test(param->testflag & T_QUICK));
+ MY_TEST(param->testflag & T_QUICK));
}
param->testflag= save_testflag | (param->testflag & T_RETRY_WITHOUT_QUICK);
optimize_done= 1;
@@ -1656,7 +1656,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
set full_repair_done if we re-wrote all rows and all keys
(and thus removed all transid's from the table
*/
- full_repair_done= !test(param->testflag & T_QUICK);
+ full_repair_done= !MY_TEST(param->testflag & T_QUICK);
}
if (!error)
{
@@ -2124,7 +2124,7 @@ void ha_maria::start_bulk_insert(ha_rows rows, uint flags)
}
else
{
- my_bool all_keys= test(flags & HA_CREATE_UNIQUE_INDEX_BY_SORT);
+ my_bool all_keys= MY_TEST(flags & HA_CREATE_UNIQUE_INDEX_BY_SORT);
maria_disable_indexes_for_rebuild(file, rows, all_keys);
}
if (share->now_transactional)
@@ -3300,7 +3300,7 @@ static int maria_rollback(handlerton *hton __attribute__ ((unused)),
bool maria_flush_logs(handlerton *hton)
{
- return test(translog_purge_at_flush());
+ return MY_TEST(translog_purge_at_flush());
}
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 7d12f1637b4..2b99c31ec5d 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -146,7 +146,7 @@ public:
bool auto_repair(int error) const
{
/* Always auto-repair moved tables (error == HA_ERR_OLD_FILE) */
- return ((test(maria_recover_options & HA_RECOVER_ANY) &&
+ return ((MY_TEST(maria_recover_options & HA_RECOVER_ANY) &&
error == HA_ERR_CRASHED_ON_USAGE) ||
error == HA_ERR_OLD_FILE);
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 7f8fd699e5d..c6371287063 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -2367,7 +2367,7 @@ static my_bool extent_to_bitmap_blocks(MARIA_HA *info,
DBUG_PRINT("error", ("page: %lu page_count: %u tail: %u length: %ld data_length: %ld",
(ulong) block->page,
(block->page_count & ~TAIL_BIT),
- (uint) test(block->page_count & TAIL_BIT),
+ (uint) MY_TEST(block->page_count & TAIL_BIT),
(ulong) ((block->page + (page_count & ~TAIL_BIT)) *
share->block_size),
(ulong) share->state.state.data_file_length));
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index e21690a6b53..4ac267ffb8a 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -1454,7 +1454,7 @@ static int check_dynamic_record(HA_CHECK *param, MARIA_HA *info, int extend,
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{
if (_ma_rec_check(info,record, info->rec_buff,block_info.rec_len,
- test(share->calc_checksum), checksum))
+ MY_TEST(share->calc_checksum), checksum))
{
_ma_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff));
@@ -2385,7 +2385,7 @@ static int initialize_variables_for_repair(HA_CHECK *param,
sort_param->sort_info= sort_info;
sort_param->fix_datafile= ! rep_quick;
- sort_param->calc_checksum= test(param->testflag & T_CALC_CHECKSUM);
+ sort_param->calc_checksum= MY_TEST(param->testflag & T_CALC_CHECKSUM);
sort_info->info= sort_info->new_info= info;
sort_info->param= param;
set_data_file_type(sort_info, info->s);
@@ -2395,8 +2395,9 @@ static int initialize_variables_for_repair(HA_CHECK *param,
info->rec_cache.file= info->dfile.file;
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- if (protect_against_repair_crash(info, param, !test(param->testflag &
- T_CREATE_MISSING_KEYS)))
+ if (protect_against_repair_crash(info, param,
+ !MY_TEST(param->testflag &
+ T_CREATE_MISSING_KEYS)))
return 1;
/* calculate max_records */
@@ -3836,7 +3837,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
if (keyseg[i].flag & HA_SPACE_PACK)
sort_param.key_length+=get_pack_length(keyseg[i].length);
if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
- sort_param.key_length+=2 + test(keyseg[i].length >= 127);
+ sort_param.key_length+= 2 + MY_TEST(keyseg[i].length >= 127);
if (keyseg[i].flag & HA_NULL_PART)
sort_param.key_length++;
}
@@ -4405,7 +4406,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
if (keyseg->flag & HA_SPACE_PACK)
sort_param[i].key_length+=get_pack_length(keyseg->length);
if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
- sort_param[i].key_length+=2 + test(keyseg->length >= 127);
+ sort_param[i].key_length+= 2 + MY_TEST(keyseg->length >= 127);
if (keyseg->flag & HA_NULL_PART)
sort_param[i].key_length++;
}
@@ -4424,7 +4425,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
sort_info.total_keys=i;
sort_param[0].master= 1;
sort_param[0].fix_datafile= ! rep_quick;
- sort_param[0].calc_checksum= test(param->testflag & T_CALC_CHECKSUM);
+ sort_param[0].calc_checksum= MY_TEST(param->testflag & T_CALC_CHECKSUM);
if (!maria_ftparser_alloc_param(info))
goto err;
@@ -5225,7 +5226,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
sort_param->find_length,
(param->testflag & T_QUICK) &&
sort_param->calc_checksum &&
- test(share->calc_checksum), checksum))
+ MY_TEST(share->calc_checksum), checksum))
{
_ma_check_print_info(param,"Found wrong packed record at %s",
llstr(sort_param->start_recpos,llbuff));
@@ -5413,7 +5414,7 @@ int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param)
do
{
- block_length=reclength+ 3 + test(reclength >= (65520-3));
+ block_length= reclength + 3 + MY_TEST(reclength >= (65520 - 3));
if (block_length < share->base.min_block_length)
block_length=share->base.min_block_length;
info->update|=HA_STATE_WRITE_AT_END;
@@ -6412,7 +6413,7 @@ static ha_checksum maria_byte_checksum(const uchar *buf, uint length)
const uchar *end=buf+length;
for (crc=0; buf != end; buf++)
crc=((crc << 1) + *buf) +
- test(crc & (((ha_checksum) 1) << (8*sizeof(ha_checksum)-1)));
+ MY_TEST(crc & (((ha_checksum) 1) << (8 * sizeof(ha_checksum) - 1)));
return crc;
}
diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c
index 023dbd5bb49..1176b2037b5 100644
--- a/storage/maria/ma_create.c
+++ b/storage/maria/ma_create.c
@@ -209,7 +209,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
options|= HA_OPTION_NULL_FIELDS; /* Use ma_checksum() */
/* We must test for 257 as length includes pack-length */
- if (test(column->length >= 257))
+ if (MY_TEST(column->length >= 257))
{
long_varchar_count++;
max_field_lengths++;
@@ -308,7 +308,8 @@ int maria_create(const char *name, enum data_file_type datafile_type,
pack_bytes= (packed + 7) / 8;
if (pack_reclength != INT_MAX32)
pack_reclength+= reclength+pack_bytes +
- test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_OPTION_PACK_RECORD));
+ MY_TEST(test_all_bits(options, HA_OPTION_CHECKSUM |
+ HA_OPTION_PACK_RECORD));
min_pack_length+= pack_bytes;
/* Calculate min possible row length for rows-in-block */
extra_header_size= MAX_FIXED_HEADER_SIZE;
@@ -730,7 +731,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
share.base.records=ci->max_rows;
share.base.reloc= ci->reloc_rows;
share.base.reclength=real_reclength;
- share.base.pack_reclength=reclength+ test(options & HA_OPTION_CHECKSUM);
+ share.base.pack_reclength= reclength + MY_TEST(options & HA_OPTION_CHECKSUM);
share.base.max_pack_length=pack_reclength;
share.base.min_pack_length=min_pack_length;
share.base.pack_bytes= pack_bytes;
@@ -1033,7 +1034,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
remember if the data file was created or not, to know if Recovery can
do it or not, in the future
*/
- log_data[0]= test(flags & HA_DONT_TOUCH_DATA);
+ log_data[0]= MY_TEST(flags & HA_DONT_TOUCH_DATA);
int2store(log_data + 1, kfile_size_before_extension);
int2store(log_data + 1 + 2, share.base.keystart);
log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (uchar *)name;
diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c
index 4bb51d0dcf3..b0280f5278b 100644
--- a/storage/maria/ma_dynrec.c
+++ b/storage/maria/ma_dynrec.c
@@ -406,7 +406,7 @@ static int _ma_find_writepos(MARIA_HA *info,
{
/* No deleted blocks; Allocate a new block */
*filepos=info->state->data_file_length;
- if ((tmp=reclength+3 + test(reclength >= (65520-3))) <
+ if ((tmp= reclength + 3 + MY_TEST(reclength >= (65520 - 3))) <
info->s->base.min_block_length)
tmp= info->s->base.min_block_length;
else
@@ -849,7 +849,7 @@ static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
if (length < reclength)
{
uint tmp=MY_ALIGN(reclength - length + 3 +
- test(reclength >= 65520L),MARIA_DYN_ALIGN_SIZE);
+ MY_TEST(reclength >= 65520L), MARIA_DYN_ALIGN_SIZE);
/* Don't create a block bigger than MARIA_MAX_BLOCK_LENGTH */
tmp= MY_MIN(length+tmp, MARIA_MAX_BLOCK_LENGTH)-length;
/* Check if we can extend this block */
@@ -1014,7 +1014,7 @@ uint _ma_rec_pack(MARIA_HA *info, register uchar *to,
pos++;
}
new_length=(uint) (end-pos);
- if (new_length +1 + test(column->length > 255 && new_length > 127)
+ if (new_length + 1 + MY_TEST(column->length > 255 && new_length > 127)
< length)
{
if (column->length > 255 && new_length > 127)
@@ -1138,7 +1138,7 @@ my_bool _ma_rec_check(MARIA_HA *info,const uchar *record, uchar *rec_buff,
pos++;
}
new_length=(uint) (end-pos);
- if (new_length +1 + test(column->length > 255 && new_length > 127)
+ if (new_length + 1 + MY_TEST(column->length > 255 && new_length > 127)
< length)
{
if (!(flag & bit))
@@ -1191,7 +1191,7 @@ my_bool _ma_rec_check(MARIA_HA *info,const uchar *record, uchar *rec_buff,
to+= length;
}
if (packed_length != (uint) (to - rec_buff) +
- test(info->s->calc_checksum) || (bit != 1 && (flag & ~(bit - 1))))
+ MY_TEST(info->s->calc_checksum) || (bit != 1 && (flag & ~(bit - 1))))
goto err;
if (with_checksum && ((uchar) checksum != (uchar) *to))
{
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index 66e7b4033c7..fd21d2863f8 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -58,7 +58,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
{
reinit_io_cache(&info->rec_cache,READ_CACHE,0,
(pbool) (info->lock_type != F_UNLCK),
- (pbool) test(info->update & HA_STATE_ROW_CHANGED)
+ (pbool) MY_TEST(info->update & HA_STATE_ROW_CHANGED)
);
}
info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND |
@@ -122,7 +122,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
{
reinit_io_cache(&info->rec_cache, READ_CACHE, info->cur_row.nextpos,
(pbool) (info->lock_type != F_UNLCK),
- (pbool) test(info->update & HA_STATE_ROW_CHANGED));
+ (pbool) MY_TEST(info->update & HA_STATE_ROW_CHANGED));
info->update&= ~HA_STATE_ROW_CHANGED;
if (share->non_transactional_concurrent_insert)
info->rec_cache.end_of_file= info->state->data_file_length;
@@ -316,7 +316,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
/* Fall trough */
case HA_EXTRA_PREPARE_FOR_RENAME:
{
- my_bool do_flush= test(function != HA_EXTRA_PREPARE_FOR_DROP);
+ my_bool do_flush= MY_TEST(function != HA_EXTRA_PREPARE_FOR_DROP);
my_bool save_global_changed;
enum flush_type type;
/*
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index e69c90c671c..af2ad6f1ba9 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -523,7 +523,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
{
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
ftbe->up->ythresh - ftbe->up->yweaks >
- (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */
+ (uint) MY_TEST(ftbe->flags & FTB_FLAG_YES)) /* 1 */
{
FTB_EXPR *top_ftbe=ftbe->up;
ftbw->docid[0]=HA_OFFSET_ERROR;
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index 0ec0244bcbd..dd679f53533 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -535,7 +535,7 @@ int _ma_decrement_open_count(MARIA_HA *info, my_bool lock_tables)
if (!lock_error && !my_disable_locking && lock_tables)
lock_error=maria_lock_database(info,old_lock);
}
- DBUG_RETURN(test(lock_error || write_error));
+ DBUG_RETURN(MY_TEST(lock_error || write_error));
}
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index ae58be55105..39103dfcd97 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1562,7 +1562,7 @@ static my_bool translog_close_log_file(TRANSLOG_FILE *file)
}
rc|= mysql_file_close(file->handler.file, MYF(MY_WME));
my_free(file);
- return test(rc);
+ return MY_TEST(rc);
}
@@ -8232,9 +8232,9 @@ my_bool translog_is_file(uint file_no)
{
MY_STAT stat_buff;
char path[FN_REFLEN];
- return (test(mysql_file_stat(key_file_translog,
- translog_filename_by_fileno(file_no, path),
- &stat_buff, MYF(0))));
+ return (MY_TEST(mysql_file_stat(key_file_translog,
+ translog_filename_by_fileno(file_no, path),
+ &stat_buff, MYF(0))));
}
@@ -8529,8 +8529,8 @@ my_bool translog_purge(TRANSLOG_ADDRESS low)
{
char path[FN_REFLEN], *file_name;
file_name= translog_filename_by_fileno(i, path);
- rc= test(mysql_file_delete(key_file_translog,
- file_name, MYF(MY_WME)));
+ rc= MY_TEST(mysql_file_delete(key_file_translog,
+ file_name, MYF(MY_WME)));
}
}
if (unlikely(rc == 1))
@@ -8592,8 +8592,8 @@ my_bool translog_purge_at_flush()
char path[FN_REFLEN], *file_name;
DBUG_PRINT("info", ("purge file %lu\n", (ulong) i));
file_name= translog_filename_by_fileno(i, path);
- rc= test(mysql_file_delete(key_file_translog,
- file_name, MYF(MY_WME)));
+ rc= MY_TEST(mysql_file_delete(key_file_translog,
+ file_name, MYF(MY_WME)));
}
mysql_mutex_unlock(&log_descriptor.purger_lock);
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index a1d4e215118..e06084cef07 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -273,7 +273,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
int kfile,open_mode,save_errno;
uint i,j,len,errpos,head_length,base_pos,keys, realpath_err,
key_parts,unique_key_parts,fulltext_keys,uniques;
- uint internal_table= test(open_flags & HA_OPEN_INTERNAL_TABLE);
+ uint internal_table= MY_TEST(open_flags & HA_OPEN_INTERNAL_TABLE);
size_t info_length;
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
@@ -731,7 +731,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
share->base.is_nulls_extended +
share->base.null_bytes +
share->base.pack_bytes +
- test(share->options & HA_OPTION_CHECKSUM));
+ MY_TEST(share->options & HA_OPTION_CHECKSUM));
share->kfile.file= kfile;
if (open_flags & HA_OPEN_COPY)
diff --git a/storage/maria/ma_packrec.c b/storage/maria/ma_packrec.c
index 9b06c0d4f78..a541a657ed2 100644
--- a/storage/maria/ma_packrec.c
+++ b/storage/maria/ma_packrec.c
@@ -146,9 +146,9 @@ my_bool _ma_once_init_pack_row(MARIA_SHARE *share, File dfile)
share->options|= HA_OPTION_READ_ONLY_DATA;
return (_ma_read_pack_info(share, dfile,
(pbool)
- test(!(share->options &
- (HA_OPTION_PACK_RECORD |
- HA_OPTION_TEMP_COMPRESS_RECORD)))));
+ MY_TEST(!(share->options &
+ (HA_OPTION_PACK_RECORD |
+ HA_OPTION_TEMP_COMPRESS_RECORD)))));
}
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 4a3c3efd3fb..8e8ecf945f0 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -482,7 +482,7 @@ error:
DBUG_PRINT("info",
("info_check_lock: thread: 0x%lx block 0x%lx: info: %d wrt: %d,"
"to lock: %s, to pin: %s",
- (ulong)thread, (ulong)block, test(info),
+ (ulong) thread, (ulong) block, MY_TEST(info),
(info ? info->write_lock : 0),
page_cache_page_lock_str[lock],
page_cache_page_pin_str[pin]));
diff --git a/storage/maria/ma_pagecrc.c b/storage/maria/ma_pagecrc.c
index a79f34016c1..d3522fa4e88 100644
--- a/storage/maria/ma_pagecrc.c
+++ b/storage/maria/ma_pagecrc.c
@@ -88,7 +88,7 @@ static my_bool maria_page_crc_check(uchar *page,
}
new_crc= maria_page_crc((uint32) page_no, page, data_length);
DBUG_ASSERT(new_crc != no_crc_val);
- res= test(new_crc != crc);
+ res= MY_TEST(new_crc != crc);
if (res)
{
/*
diff --git a/storage/maria/ma_range.c b/storage/maria/ma_range.c
index 475665e17c3..7747df6415a 100644
--- a/storage/maria/ma_range.c
+++ b/storage/maria/ma_range.c
@@ -276,7 +276,7 @@ static double _ma_search_pos(MARIA_HA *info, MARIA_KEY *key,
}
DBUG_PRINT("info",("keynr: %d offset: %g max_keynr: %d nod: %d flag: %d",
keynr,offset,max_keynr,page.node,flag));
- DBUG_RETURN((keynr+offset)/(max_keynr+test(page.node)));
+ DBUG_RETURN((keynr + offset) / (max_keynr + MY_TEST(page.node)));
err:
DBUG_PRINT("exit",("Error: %d",my_errno));
DBUG_RETURN (-1.0);
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index 33d97a186dd..59e0630be8c 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -1176,7 +1176,7 @@ prototype_redo_exec_hook(REDO_REPAIR_TABLE)
DBUG_ASSERT(maria_tmpdir);
info->s->state.key_map= uint8korr(rec->header + FILEID_STORE_SIZE + 8);
- quick_repair= test(param.testflag & T_QUICK);
+ quick_repair= MY_TEST(param.testflag & T_QUICK);
if (param.testflag & T_REP_PARALLEL)
{
diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c
index 001717932f9..595b87ef4d0 100644
--- a/storage/maria/ma_test1.c
+++ b/storage/maria/ma_test1.c
@@ -195,7 +195,7 @@ static int run_test(const char *filename)
else
uniques=0;
- offset_to_key= test(null_fields);
+ offset_to_key= MY_TEST(null_fields);
if (key_field == FIELD_BLOB || key_field == FIELD_VARCHAR)
offset_to_key+= 2;
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index a9af6e69154..623d3c6c92e 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -973,7 +973,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
{
int error,lock_type,recreate;
uint warning_printed_by_chk_status;
- my_bool rep_quick= test(param->testflag & (T_QUICK | T_FORCE_UNIQUENESS));
+ my_bool rep_quick= MY_TEST(param->testflag & (T_QUICK | T_FORCE_UNIQUENESS));
MARIA_HA *info;
File datafile;
char llbuff[22],llbuff2[22];
@@ -1366,7 +1366,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
if ((info->s->data_file_type != STATIC_RECORD) ||
(param->testflag & (T_EXTEND | T_MEDIUM)))
error|=maria_chk_data_link(param, info,
- test(param->testflag & T_EXTEND));
+ MY_TEST(param->testflag & T_EXTEND));
end_io_cache(&param->read_cache);
}
if (!error)
@@ -1391,7 +1391,8 @@ static int maria_chk(HA_CHECK *param, char *filename)
if ((param->testflag & T_AUTO_INC) ||
((param->testflag & T_REP_ANY) && info->s->base.auto_key))
_ma_update_auto_increment_key(param, info,
- (my_bool) !test(param->testflag & T_AUTO_INC));
+ (my_bool)
+ !MY_TEST(param->testflag & T_AUTO_INC));
if (info->update & HA_STATE_CHANGED && ! (param->testflag & T_READONLY))
{
diff --git a/storage/maria/unittest/ma_pagecache_single.c b/storage/maria/unittest/ma_pagecache_single.c
index d7da87a3821..0031582589e 100644
--- a/storage/maria/unittest/ma_pagecache_single.c
+++ b/storage/maria/unittest/ma_pagecache_single.c
@@ -166,15 +166,15 @@ int simple_read_write_test()
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED,
0);
- ok((res= test(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
+ ok((res= MY_TEST(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
"Simple write-read page ");
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
{
diag("Got error during flushing pagecache\n");
exit(1);
}
- ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_read_write_test_file))),
+ ok((res&= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_read_write_test_file))),
"Simple write-read page file");
if (res)
reset_file(&file1, file1_name);
@@ -225,7 +225,7 @@ int simple_read_change_write_read_test()
PAGECACHE_PLAIN_PAGE,
PAGECACHE_LOCK_LEFT_UNLOCKED,
0);
- ok((res= test(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
+ ok((res= MY_TEST(memcmp(buffr, buffw, TEST_PAGE_SIZE) == 0)),
"Simple read-change-write-read page ");
DBUG_ASSERT(pagecache.blocks_changed == 1);
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
@@ -234,8 +234,8 @@ int simple_read_change_write_read_test()
exit(1);
}
DBUG_ASSERT(pagecache.blocks_changed == 0);
- ok((res2= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_read_change_write_read_test_file))),
+ ok((res2= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_read_change_write_read_test_file))),
"Simple read-change-write-read page file");
if (res && res2)
reset_file(&file1, file1_name);
@@ -299,8 +299,8 @@ int simple_pin_test()
res= 0;
goto err;
}
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE*2,
- simple_pin_test_file1))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE * 2,
+ TEST_PAGE_SIZE * 2, simple_pin_test_file1))),
"Simple pin page file with pin");
pagecache_unlock(&pagecache,
&file1,
@@ -314,8 +314,8 @@ int simple_pin_test()
res= 0;
goto err;
}
- ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE,
- simple_pin_test_file2))),
+ ok((res&= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE * 2,
+ TEST_PAGE_SIZE, simple_pin_test_file2))),
"Simple pin page result file");
if (res)
reset_file(&file1, file1_name);
@@ -378,8 +378,8 @@ int simple_pin_test2()
res= 0;
goto err;
}
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE*2,
- simple_pin_test_file1))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE * 2,
+ TEST_PAGE_SIZE * 2, simple_pin_test_file1))),
"Simple pin page file with pin 2");
/* Test that a normal flush goes through */
@@ -401,8 +401,8 @@ int simple_pin_test2()
res= 0;
goto err;
}
- ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE*2, TEST_PAGE_SIZE,
- simple_pin_test_file2))),
+ ok((res&= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE * 2,
+ TEST_PAGE_SIZE, simple_pin_test_file2))),
"Simple pin page result file 2");
if (res)
reset_file(&file1, file1_name);
@@ -451,8 +451,8 @@ int simple_pin_no_lock_test()
res= 0;
goto err;
}
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_pin_no_lock_test_file1))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_pin_no_lock_test_file1))),
"Simple pin (no lock) page file with pin 2");
pagecache_unlock(&pagecache,
&file1,
@@ -466,8 +466,8 @@ int simple_pin_no_lock_test()
res= 0;
goto err;
}
- ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_pin_no_lock_test_file2))),
+ ok((res&= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_pin_no_lock_test_file2))),
"Simple pin (no lock) page result file 2");
bfill(buffw, TEST_PAGE_SIZE, '\6');
@@ -486,8 +486,8 @@ int simple_pin_no_lock_test()
res= 0;
goto err;
}
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_pin_no_lock_test_file2))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_pin_no_lock_test_file2))),
"Simple pin (no lock) page file with pin 3");
pagecache_unpin_by_link(&pagecache, link, 0);
if (flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE))
@@ -496,8 +496,8 @@ int simple_pin_no_lock_test()
res= 0;
goto err;
}
- ok((res&= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_pin_no_lock_test_file3))),
+ ok((res&= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_pin_no_lock_test_file3))),
"Simple pin (no lock) page result file 3");
if (res)
reset_file(&file1, file1_name);
@@ -536,8 +536,8 @@ int simple_delete_forget_test()
pagecache_delete(&pagecache, &file1, 0,
PAGECACHE_LOCK_WRITE, 0);
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_delete_forget_test_file))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_delete_forget_test_file))),
"Simple delete-forget page file");
if (res)
reset_file(&file1, file1_name);
@@ -583,8 +583,8 @@ int simple_delete_flush_test()
exit(1);
}
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
- ok((res= test(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
- simple_delete_flush_test_file))),
+ ok((res= MY_TEST(test_file(file1, file1_name, TEST_PAGE_SIZE, TEST_PAGE_SIZE,
+ simple_delete_flush_test_file))),
"Simple delete flush (link) page file");
if (res)
reset_file(&file1, file1_name);
@@ -665,8 +665,8 @@ int simple_big_test()
ok(1, "Simple big file random read");
flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
- ok((res= test(test_file(file1, file1_name, PCACHE_SIZE*2, TEST_PAGE_SIZE,
- desc))),
+ ok((res= MY_TEST(test_file(file1, file1_name, PCACHE_SIZE * 2, TEST_PAGE_SIZE,
+ desc))),
"Simple big file");
if (res)
reset_file(&file1, file1_name);
diff --git a/storage/maria/unittest/ma_test_loghandler-t.c b/storage/maria/unittest/ma_test_loghandler-t.c
index ccaa6f7dc8e..abf2078ce8f 100644
--- a/storage/maria/unittest/ma_test_loghandler-t.c
+++ b/storage/maria/unittest/ma_test_loghandler-t.c
@@ -661,7 +661,7 @@ err:
if (maria_log_remove(maria_data_root))
exit(1);
- return(test(exit_status()));
+ return(MY_TEST(exit_status()));
}
#include "../ma_check_standalone.h"
diff --git a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
index 56329a18d7d..c8e63cb26ab 100644
--- a/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multigroup-t.c
@@ -758,7 +758,7 @@ err:
if (maria_log_remove(maria_data_root))
exit(1);
- return (test(exit_status()));
+ return (MY_TEST(exit_status()));
}
#include "../ma_check_standalone.h"
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 70a7037a446..6befe3b2d7a 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -533,7 +533,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
{
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
ftbe->up->ythresh - ftbe->up->yweaks >
- (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */
+ (uint) MY_TEST(ftbe->flags & FTB_FLAG_YES)) /* 1 */
{
FTB_EXPR *top_ftbe=ftbe->up;
ftbw->docid[0]=HA_OFFSET_ERROR;
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 0178e2abfa9..18f0c3b7f60 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -480,8 +480,8 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
{
DBUG_PRINT("error", ("Key %d has different definition", i));
DBUG_PRINT("error", ("t1_fulltext= %d, t2_fulltext=%d",
- test(t1_keyinfo[i].flag & HA_FULLTEXT),
- test(t2_keyinfo[i].flag & HA_FULLTEXT)));
+ MY_TEST(t1_keyinfo[i].flag & HA_FULLTEXT),
+ MY_TEST(t2_keyinfo[i].flag & HA_FULLTEXT)));
DBUG_RETURN(1);
}
if (t1_keyinfo[i].flag & HA_SPATIAL && t2_keyinfo[i].flag & HA_SPATIAL)
@@ -491,8 +491,8 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
{
DBUG_PRINT("error", ("Key %d has different definition", i));
DBUG_PRINT("error", ("t1_spatial= %d, t2_spatial=%d",
- test(t1_keyinfo[i].flag & HA_SPATIAL),
- test(t2_keyinfo[i].flag & HA_SPATIAL)));
+ MY_TEST(t1_keyinfo[i].flag & HA_SPATIAL),
+ MY_TEST(t2_keyinfo[i].flag & HA_SPATIAL)));
DBUG_RETURN(1);
}
if ((!mysql_40_compat &&
@@ -913,7 +913,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
my_default_record_cache_size, READ_CACHE,
share->pack.header_length, 1, MYF(MY_WME))))
{
- error= chk_data_link(&param, file, test(param.testflag & T_EXTEND));
+ error= chk_data_link(&param, file, MY_TEST(param.testflag & T_EXTEND));
end_io_cache(&(param.read_cache));
}
param.testflag= old_testflag;
@@ -1109,7 +1109,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK &param, bool do_optimize)
share->state.key_map);
ulonglong testflag= param.testflag;
#ifdef HAVE_MMAP
- bool remap= test(share->file_map);
+ bool remap= MY_TEST(share->file_map);
/*
mi_repair*() functions family use file I/O even if memory
mapping is available.
@@ -1131,14 +1131,14 @@ int ha_myisam::repair(THD *thd, HA_CHECK &param, bool do_optimize)
/* TODO: respect myisam_repair_threads variable */
thd_proc_info(thd, "Parallel repair");
error = mi_repair_parallel(&param, file, fixed_name,
- test(param.testflag & T_QUICK));
+ MY_TEST(param.testflag & T_QUICK));
}
else
{
thd_proc_info(thd, "Repair by sorting");
DEBUG_SYNC(thd, "myisam_before_repair_by_sort");
error = mi_repair_by_sort(&param, file, fixed_name,
- test(param.testflag & T_QUICK));
+ MY_TEST(param.testflag & T_QUICK));
}
if (error && file->create_unique_index_by_sort &&
share->state.dupp_key != MAX_KEY)
@@ -1150,7 +1150,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK &param, bool do_optimize)
thd_proc_info(thd, "Repair with keycache");
param.testflag &= ~T_REP_BY_SORT;
error= mi_repair(&param, file, fixed_name,
- test(param.testflag & T_QUICK));
+ MY_TEST(param.testflag & T_QUICK));
}
param.testflag= testflag | (param.testflag & T_RETRY_WITHOUT_QUICK);
#ifdef HAVE_MMAP
@@ -1562,7 +1562,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows, uint flags)
}
else
{
- my_bool all_keys= test(flags & HA_CREATE_UNIQUE_INDEX_BY_SORT);
+ my_bool all_keys= MY_TEST(flags & HA_CREATE_UNIQUE_INDEX_BY_SORT);
mi_disable_indexes_for_rebuild(file, rows, all_keys);
}
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index a44a6236293..b3c9355cb8b 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1147,7 +1147,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{
if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len,
- test(info->s->calc_checksum)))
+ MY_TEST(info->s->calc_checksum)))
{
mi_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff));
@@ -2364,7 +2364,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
if (keyseg[i].flag & HA_SPACE_PACK)
sort_param.key_length+=get_pack_length(keyseg[i].length);
if (keyseg[i].flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
- sort_param.key_length+=2 + test(keyseg[i].length >= 127);
+ sort_param.key_length+= 2 + MY_TEST(keyseg[i].length >= 127);
if (keyseg[i].flag & HA_NULL_PART)
sort_param.key_length++;
}
@@ -2866,7 +2866,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
if (keyseg->flag & HA_SPACE_PACK)
sort_param[i].key_length+=get_pack_length(keyseg->length);
if (keyseg->flag & (HA_BLOB_PART | HA_VAR_LENGTH_PART))
- sort_param[i].key_length+=2 + test(keyseg->length >= 127);
+ sort_param[i].key_length+= 2 + MY_TEST(keyseg->length >= 127);
if (keyseg->flag & HA_NULL_PART)
sort_param[i].key_length++;
}
@@ -2884,7 +2884,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
sort_info.total_keys=i;
sort_param[0].master= 1;
sort_param[0].fix_datafile= (my_bool)(! rep_quick);
- sort_param[0].calc_checksum= test(param->testflag & T_CALC_CHECKSUM);
+ sort_param[0].calc_checksum= MY_TEST(param->testflag & T_CALC_CHECKSUM);
if (!ftparser_alloc_param(info))
goto err;
@@ -3573,7 +3573,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
sort_param->find_length,
(param->testflag & T_QUICK) &&
sort_param->calc_checksum &&
- test(info->s->calc_checksum)))
+ MY_TEST(info->s->calc_checksum)))
{
mi_check_print_info(param,"Found wrong packed record at %s",
llstr(sort_param->start_recpos,llbuff));
@@ -3734,7 +3734,7 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
do
{
- block_length=reclength+ 3 + test(reclength >= (65520-3));
+ block_length= reclength + 3 + MY_TEST(reclength >= (65520 - 3));
if (block_length < share->base.min_block_length)
block_length=share->base.min_block_length;
info->update|=HA_STATE_WRITE_AT_END;
@@ -4661,7 +4661,7 @@ static ha_checksum mi_byte_checksum(const uchar *buf, uint length)
const uchar *end=buf+length;
for (crc=0; buf != end; buf++)
crc=((crc << 1) + *((uchar*) buf)) +
- test(crc & (((ha_checksum) 1) << (8*sizeof(ha_checksum)-1)));
+ MY_TEST(crc & (((ha_checksum) 1) << (8 * sizeof(ha_checksum) - 1)));
return crc;
}
diff --git a/storage/myisam/mi_checksum.c b/storage/myisam/mi_checksum.c
index e0a8672760d..01adae3edac 100644
--- a/storage/myisam/mi_checksum.c
+++ b/storage/myisam/mi_checksum.c
@@ -23,7 +23,7 @@ ha_checksum mi_checksum(MI_INFO *info, const uchar *buf)
const uchar *record= buf;
MI_COLUMNDEF *column= info->s->rec;
MI_COLUMNDEF *column_end= column+ info->s->base.fields;
- my_bool skip_null_bits= test(info->s->options & HA_OPTION_NULL_FIELDS);
+ my_bool skip_null_bits= MY_TEST(info->s->options & HA_OPTION_NULL_FIELDS);
for ( ; column != column_end ; buf+= column++->length)
{
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 4de218864de..88b9da6f8a9 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -138,7 +138,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
pack_reclength++;
min_pack_length++;
/* We must test for 257 as length includes pack-length */
- if (test(rec->length >= 257))
+ if (MY_TEST(rec->length >= 257))
{
long_varchar_count++;
pack_reclength+= 2; /* May be packed on 3 bytes */
@@ -205,7 +205,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
pack_bytes= (packed+7)/8;
if (pack_reclength != INT_MAX32)
pack_reclength+= reclength+packed +
- test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_OPTION_PACK_RECORD));
+ MY_TEST(test_all_bits(options, HA_OPTION_CHECKSUM |
+ HA_OPTION_PACK_RECORD));
min_pack_length+= pack_bytes;
if (!ci->data_file_length && ci->max_rows)
@@ -557,7 +558,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share.base.records=ci->max_rows;
share.base.reloc= ci->reloc_rows;
share.base.reclength=real_reclength;
- share.base.pack_reclength=reclength+ test(options & HA_OPTION_CHECKSUM);
+ share.base.pack_reclength= reclength + MY_TEST(options & HA_OPTION_CHECKSUM);
share.base.max_pack_length=pack_reclength;
share.base.min_pack_length=min_pack_length;
share.base.pack_bits= pack_bytes;
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 907d8e291f6..3fffa55341b 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -353,8 +353,8 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
DBUG_RETURN(-1);
}
/* Page will be update later if we return 1 */
- DBUG_RETURN(test(length <= (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
- (uint) keyinfo->underflow_block_length)));
+ DBUG_RETURN(MY_TEST(length <= (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
+ (uint) keyinfo->underflow_block_length)));
}
save_flag=1;
ret_value=del(info,keyinfo,key,anc_buff,leaf_page,leaf_buff,keypos,
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 021809ed892..5241d72014c 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -416,7 +416,7 @@ static int _mi_find_writepos(MI_INFO *info,
{
/* No deleted blocks; Allocate a new block */
*filepos=info->state->data_file_length;
- if ((tmp=reclength+3 + test(reclength >= (65520-3))) <
+ if ((tmp= reclength + 3 + MY_TEST(reclength >= (65520 - 3))) <
info->s->base.min_block_length)
tmp= info->s->base.min_block_length;
else
@@ -864,7 +864,7 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, uchar *record,
if (length < reclength)
{
uint tmp=MY_ALIGN(reclength - length + 3 +
- test(reclength >= 65520L),MI_DYN_ALIGN_SIZE);
+ MY_TEST(reclength >= 65520L), MI_DYN_ALIGN_SIZE);
/* Don't create a block bigger than MI_MAX_BLOCK_LENGTH */
tmp= MY_MIN(length+tmp, MI_MAX_BLOCK_LENGTH)-length;
/* Check if we can extend this block */
@@ -1025,7 +1025,7 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to,
pos++;
}
new_length=(uint) (end-pos);
- if (new_length +1 + test(rec->length > 255 && new_length > 127)
+ if (new_length + 1 + MY_TEST(rec->length > 255 && new_length > 127)
< length)
{
if (rec->length > 255 && new_length > 127)
@@ -1145,7 +1145,7 @@ my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff,
pos++;
}
new_length=(uint) (end-pos);
- if (new_length +1 + test(rec->length > 255 && new_length > 127)
+ if (new_length + 1 + MY_TEST(rec->length > 255 && new_length > 127)
< length)
{
if (!(flag & bit))
@@ -1197,7 +1197,7 @@ my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff,
else
to+= length;
}
- if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
+ if (packed_length != (uint) (to - rec_buff) + MY_TEST(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1))))
goto err;
if (with_checksum && ((uchar) info->checksum != (uchar) *to))
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index f57fba5c2c5..a47c1987e38 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -56,7 +56,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
reinit_io_cache(&info->rec_cache,READ_CACHE,0,
(pbool) (info->lock_type != F_UNLCK),
- (pbool) test(info->update & HA_STATE_ROW_CHANGED)
+ (pbool) MY_TEST(info->update & HA_STATE_ROW_CHANGED)
);
}
info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND |
@@ -117,7 +117,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
reinit_io_cache(&info->rec_cache,READ_CACHE,info->nextpos,
(pbool) (info->lock_type != F_UNLCK),
- (pbool) test(info->update & HA_STATE_ROW_CHANGED));
+ (pbool) MY_TEST(info->update & HA_STATE_ROW_CHANGED));
info->update&= ~HA_STATE_ROW_CHANGED;
if (share->concurrent_insert)
info->rec_cache.end_of_file=info->state->data_file_length;
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index 663a226d850..531b800c63e 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -646,7 +646,7 @@ int _mi_decrement_open_count(MI_INFO *info)
if (!lock_error && !my_disable_locking)
lock_error=mi_lock_database(info,old_lock);
}
- return test(lock_error || write_error);
+ return MY_TEST(lock_error || write_error);
}
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index f8213b1a3a5..c6af5195f82 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -523,9 +523,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
info.s=share;
if (_mi_read_pack_info(&info,
(pbool)
- test(!(share->options &
- (HA_OPTION_PACK_RECORD |
- HA_OPTION_TEMP_COMPRESS_RECORD)))))
+ MY_TEST(!(share->options &
+ (HA_OPTION_PACK_RECORD |
+ HA_OPTION_TEMP_COMPRESS_RECORD)))))
goto err;
}
else if (share->options & HA_OPTION_PACK_RECORD)
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 01fa10de7a3..3ce112f7906 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -83,7 +83,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
}
if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff,
- test(!(nextflag & SEARCH_SAVE_BUFF)))))
+ MY_TEST(!(nextflag & SEARCH_SAVE_BUFF)))))
goto err;
DBUG_DUMP("page", buff, mi_getint(buff));
@@ -129,7 +129,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
uchar *old_buff=buff;
if (!(buff=_mi_fetch_keypage(info,keyinfo,pos,DFLT_INIT_HITS,info->buff,
- test(!(nextflag & SEARCH_SAVE_BUFF)))))
+ MY_TEST(!(nextflag & SEARCH_SAVE_BUFF)))))
goto err;
keypos=buff+(keypos-old_buff);
maxpos=buff+(maxpos-old_buff);
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index 9e4e1c46891..87cea2e5566 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -268,14 +268,14 @@ static int run_test(const char *filename)
if (verbose || (flags[j] >= 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
printf("key: '%.*s' mi_rkey: %3d errno: %3d\n",
- (int) key_length,key+test(null_fields),error,my_errno);
+ (int) key_length, key + MY_TEST(null_fields), error, my_errno);
}
else
{
error=mi_delete(file,read_record);
if (verbose || error)
printf("key: '%.*s' mi_delete: %3d errno: %3d\n",
- (int) key_length, key+test(null_fields), error, my_errno);
+ (int) key_length, key + MY_TEST(null_fields), error, my_errno);
if (! error)
{
deleted++;
@@ -296,7 +296,8 @@ static int run_test(const char *filename)
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
{
printf("key: '%.*s' mi_rkey: %3d errno: %3d record: %s\n",
- (int) key_length,key+test(null_fields),error,my_errno,record+1);
+ (int) key_length, key + MY_TEST(null_fields), error, my_errno,
+ record + 1);
}
}
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 7ad35c92e6f..0cd01398cbc 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -814,7 +814,7 @@ static void get_options(register int *argc,register char ***argv)
static int myisamchk(HA_CHECK *param, char * filename)
{
int error,lock_type,recreate;
- int rep_quick= test(param->testflag & (T_QUICK | T_FORCE_UNIQUENESS));
+ int rep_quick= MY_TEST(param->testflag & (T_QUICK | T_FORCE_UNIQUENESS));
MI_INFO *info;
File datafile;
char llbuff[22],llbuff2[22];
@@ -1128,7 +1128,8 @@ static int myisamchk(HA_CHECK *param, char * filename)
if ((info->s->options & (HA_OPTION_PACK_RECORD |
HA_OPTION_COMPRESS_RECORD)) ||
(param->testflag & (T_EXTEND | T_MEDIUM)))
- error|=chk_data_link(param, info, test(param->testflag & T_EXTEND));
+ error|= chk_data_link(param, info,
+ MY_TEST(param->testflag & T_EXTEND));
error|=flush_blocks(param, share->key_cache, share->kfile,
&share->dirty_part_map);
(void) end_io_cache(&param->read_cache);
@@ -1152,7 +1153,7 @@ static int myisamchk(HA_CHECK *param, char * filename)
if ((param->testflag & T_AUTO_INC) ||
((param->testflag & T_REP_ANY) && info->s->base.auto_key))
update_auto_increment_key(param, info,
- (my_bool) !test(param->testflag & T_AUTO_INC));
+ (my_bool) !MY_TEST(param->testflag & T_AUTO_INC));
if (!(param->testflag & T_DESCRIPT))
{
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 134ae372c8a..9b871f59a38 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -4393,12 +4393,12 @@ int ha_spider::read_multi_range_first_internal(
#ifdef HA_MRR_USE_DEFAULT_IMPL
(error_num = spider_db_append_key_where(
&mrr_cur_range.start_key,
- test(mrr_cur_range.range_flag & EQ_RANGE) ?
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ?
NULL : &mrr_cur_range.end_key, this))
#else
(error_num = spider_db_append_key_where(
&multi_range_curr->start_key,
- test(multi_range_curr->range_flag & EQ_RANGE) ?
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ?
NULL : &multi_range_curr->end_key, this))
#endif
)
@@ -4834,9 +4834,9 @@ int ha_spider::read_multi_range_first_internal(
!(sql_kinds & SPIDER_SQL_KIND_HS) &&
#endif
#ifdef HA_MRR_USE_DEFAULT_IMPL
- test(mrr_cur_range.range_flag & EQ_RANGE)
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE)
#else
- test(multi_range_curr->range_flag & EQ_RANGE)
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE)
#endif
) {
if (
@@ -4951,11 +4951,11 @@ int ha_spider::read_multi_range_first_internal(
{
if (
#ifdef HA_MRR_USE_DEFAULT_IMPL
- !test(mrr_cur_range.range_flag & EQ_RANGE) ||
+ !MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ||
result_list.tmp_table_join_key_part_map !=
mrr_cur_range.start_key.keypart_map
#else
- !test(multi_range_curr->range_flag & EQ_RANGE) ||
+ !MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ||
result_list.tmp_table_join_key_part_map !=
multi_range_curr->start_key.keypart_map
#endif
@@ -5119,12 +5119,12 @@ int ha_spider::read_multi_range_first_internal(
#ifdef HA_MRR_USE_DEFAULT_IMPL
(error_num = spider_db_append_key_where(
&mrr_cur_range.start_key,
- test(mrr_cur_range.range_flag & EQ_RANGE) ?
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ?
NULL : &mrr_cur_range.end_key, this))
#else
(error_num = spider_db_append_key_where(
&multi_range_curr->start_key,
- test(multi_range_curr->range_flag & EQ_RANGE) ?
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ?
NULL : &multi_range_curr->end_key, this))
#endif
)
@@ -5739,12 +5739,12 @@ int ha_spider::read_multi_range_next(
#ifdef HA_MRR_USE_DEFAULT_IMPL
(error_num = spider_db_append_key_where(
&mrr_cur_range.start_key,
- test(mrr_cur_range.range_flag & EQ_RANGE) ?
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ?
NULL : &mrr_cur_range.end_key, this))
#else
(error_num = spider_db_append_key_where(
&multi_range_curr->start_key,
- test(multi_range_curr->range_flag & EQ_RANGE) ?
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ?
NULL : &multi_range_curr->end_key, this))
#endif
)
@@ -6193,9 +6193,9 @@ int ha_spider::read_multi_range_next(
!(sql_kinds & SPIDER_SQL_KIND_HS) &&
#endif
#ifdef HA_MRR_USE_DEFAULT_IMPL
- test(mrr_cur_range.range_flag & EQ_RANGE)
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE)
#else
- test(multi_range_curr->range_flag & EQ_RANGE)
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE)
#endif
) {
if (
@@ -6311,11 +6311,11 @@ int ha_spider::read_multi_range_next(
{
if (
#ifdef HA_MRR_USE_DEFAULT_IMPL
- !test(mrr_cur_range.range_flag & EQ_RANGE) ||
+ !MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ||
result_list.tmp_table_join_key_part_map !=
mrr_cur_range.start_key.keypart_map
#else
- !test(multi_range_curr->range_flag & EQ_RANGE) ||
+ !MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ||
result_list.tmp_table_join_key_part_map !=
multi_range_curr->start_key.keypart_map
#endif
@@ -6478,12 +6478,12 @@ int ha_spider::read_multi_range_next(
#ifdef HA_MRR_USE_DEFAULT_IMPL
(error_num = spider_db_append_key_where(
&mrr_cur_range.start_key,
- test(mrr_cur_range.range_flag & EQ_RANGE) ?
+ MY_TEST(mrr_cur_range.range_flag & EQ_RANGE) ?
NULL : &mrr_cur_range.end_key, this))
#else
(error_num = spider_db_append_key_where(
&multi_range_curr->start_key,
- test(multi_range_curr->range_flag & EQ_RANGE) ?
+ MY_TEST(multi_range_curr->range_flag & EQ_RANGE) ?
NULL : &multi_range_curr->end_key, this))
#endif
)
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index cbcab362e8e..3cb00036098 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -1629,7 +1629,7 @@ static int initialize_key_and_col_info(TABLE_SHARE* table_share, TABLE* table, K
}
- for (uint i = 0; i < table_share->keys + test(hidden_primary_key); i++) {
+ for (uint i = 0; i < table_share->keys + MY_TEST(hidden_primary_key); i++) {
//
// do the cluster/primary key filtering calculations
//
@@ -1672,7 +1672,7 @@ exit:
}
bool ha_tokudb::can_replace_into_be_fast(TABLE_SHARE* table_share, KEY_AND_COL_INFO* kc_info, uint pk) {
- uint curr_num_DBs = table_share->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table_share->keys + MY_TEST(hidden_primary_key);
bool ret_val;
if (curr_num_DBs == 1) {
ret_val = true;
@@ -1860,7 +1860,7 @@ int ha_tokudb::initialize_share(
share->try_table_lock = false;
}
- share->num_DBs = table_share->keys + test(hidden_primary_key);
+ share->num_DBs = table_share->keys + MY_TEST(hidden_primary_key);
error = 0;
exit:
@@ -2935,7 +2935,7 @@ DBT *ha_tokudb::pack_key(
{
TOKUDB_DBUG_ENTER("ha_tokudb::pack_key");
#if TOKU_INCLUDE_EXTENDED_KEYS
- if (keynr != primary_key && !test(hidden_primary_key)) {
+ if (keynr != primary_key && !MY_TEST(hidden_primary_key)) {
DBUG_RETURN(pack_ext_key(key, keynr, buff, key_ptr, key_length, inf_byte));
}
#endif
@@ -3360,7 +3360,7 @@ void ha_tokudb::start_bulk_insert(ha_rows rows, uint flags) {
abort_loader = false;
rw_rdlock(&share->num_DBs_lock);
- uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
num_DBs_locked_in_bulk = true;
lock_count = 0;
@@ -3875,7 +3875,7 @@ void ha_tokudb::set_main_dict_put_flags(
)
{
uint32_t old_prelock_flags = 0;
- uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
bool in_hot_index = share->num_DBs > curr_num_DBs;
bool using_ignore_flag_opt = do_ignore_flag_optimization(
thd, table, share->replace_into_fast);
@@ -3919,7 +3919,7 @@ int ha_tokudb::insert_row_to_main_dictionary(uchar* record, DBT* pk_key, DBT* pk
int error = 0;
uint32_t put_flags = mult_put_flags[primary_key];
THD *thd = ha_thd();
- uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
assert(curr_num_DBs == 1);
@@ -4129,7 +4129,7 @@ int ha_tokudb::write_row(uchar * record) {
// for #4633
// if we have a duplicate key error, let's check the primary key to see
// if there is a duplicate there. If so, set last_dup_key to the pk
- if (error == DB_KEYEXIST && !test(hidden_primary_key) && last_dup_key != primary_key) {
+ if (error == DB_KEYEXIST && !MY_TEST(hidden_primary_key) && last_dup_key != primary_key) {
int r = share->file->getf_set(
share->file,
txn,
@@ -5954,7 +5954,7 @@ int ha_tokudb::info(uint flag) {
TOKUDB_DBUG_ENTER("ha_tokudb::info %p %d %lld", this, flag, (long long) share->rows);
int error;
DB_TXN* txn = NULL;
- uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
DB_BTREE_STAT64 dict_stats;
for (uint i=0; i < table->s->keys; i++)
@@ -6461,7 +6461,7 @@ THR_LOCK_DATA **ha_tokudb::store_lock(THD * thd, THR_LOCK_DATA ** to, enum thr_l
// if creating a hot index
if (thd_sql_command(thd)== SQLCOM_CREATE_INDEX && get_create_index_online(thd)) {
rw_rdlock(&share->num_DBs_lock);
- if (share->num_DBs == (table->s->keys + test(hidden_primary_key))) {
+ if (share->num_DBs == (table->s->keys + MY_TEST(hidden_primary_key))) {
lock_type = TL_WRITE_ALLOW_WRITE;
}
lock.type = lock_type;
@@ -7690,7 +7690,7 @@ int ha_tokudb::tokudb_add_index(
//
// number of DB files we have open currently, before add_index is executed
//
- uint curr_num_DBs = table_arg->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table_arg->s->keys + MY_TEST(hidden_primary_key);
//
// get the row type to use for the indexes we're adding
@@ -8030,7 +8030,7 @@ To add indexes, make sure no transactions touch the table.", share->table_name);
// Closes added indexes in case of error in error path of add_index and alter_table_phase2
//
void ha_tokudb::restore_add_index(TABLE* table_arg, uint num_of_keys, bool incremented_numDBs, bool modified_DBs) {
- uint curr_num_DBs = table_arg->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table_arg->s->keys + MY_TEST(hidden_primary_key);
uint curr_index = 0;
//
@@ -8251,7 +8251,7 @@ int ha_tokudb::delete_all_rows_internal() {
error = txn_begin(db_env, 0, &txn, 0, ha_thd());
if (error) { goto cleanup; }
- curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint i = 0; i < curr_num_DBs; i++) {
error = share->key_file[i]->pre_acquire_fileops_lock(
share->key_file[i],
diff --git a/storage/tokudb/ha_tokudb_admin.cc b/storage/tokudb/ha_tokudb_admin.cc
index 4b6aaed551d..5139bb713ce 100644
--- a/storage/tokudb/ha_tokudb_admin.cc
+++ b/storage/tokudb/ha_tokudb_admin.cc
@@ -200,7 +200,7 @@ int ha_tokudb::optimize(THD * thd, HA_CHECK_OPT * check_opt) {
while (ha_tokudb_optimize_wait) sleep(1); // debug
int error;
- uint curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
#ifdef HA_TOKUDB_HAS_THD_PROGRESS
// each DB is its own stage. as HOT goes through each db, we'll
@@ -289,7 +289,7 @@ int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) {
if (r != 0)
result = HA_ADMIN_INTERNAL_ERROR;
if (result == HA_ADMIN_OK) {
- uint32_t num_DBs = table_share->keys + test(hidden_primary_key);
+ uint32_t num_DBs = table_share->keys + MY_TEST(hidden_primary_key);
snprintf(write_status_msg, sizeof write_status_msg, "%s primary=%d num=%d", share->table_name, primary_key, num_DBs);
if (tokudb_debug & TOKUDB_DEBUG_CHECK) {
ha_tokudb_check_info(thd, table, write_status_msg);
diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc
index a337b9be93a..77b05f1412d 100644
--- a/storage/tokudb/ha_tokudb_alter_56.cc
+++ b/storage/tokudb/ha_tokudb_alter_56.cc
@@ -471,7 +471,7 @@ bool ha_tokudb::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha
// Set the new compression
enum toku_compression_method method = row_type_to_compression_method((srv_row_format_t)create_info->option_struct->row_format);
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint32_t i = 0; i < curr_num_DBs; i++) {
db = share->key_file[i];
error = db->change_compression_method(db, method);
@@ -594,7 +594,7 @@ int ha_tokudb::alter_table_add_or_drop_column(TABLE *altered_table, Alter_inplac
uint32_t max_column_extra_size;
uint32_t num_column_extra;
uint32_t num_columns = 0;
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
uint32_t columns[table->s->fields + altered_table->s->fields]; // set size such that we know it is big enough for both cases
memset(columns, 0, sizeof(columns));
@@ -721,7 +721,7 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i
restore_drop_indexes(table, index_drop_offsets, ha_alter_info->index_drop_count);
}
if (ctx->compression_changed) {
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint32_t i = 0; i < curr_num_DBs; i++) {
DB *db = share->key_file[i];
int error = db->change_compression_method(db, ctx->orig_compression_method);
@@ -746,7 +746,7 @@ int ha_tokudb::alter_table_expand_varchar_offsets(TABLE *altered_table, Alter_in
int error = 0;
tokudb_alter_ctx *ctx = static_cast<tokudb_alter_ctx *>(ha_alter_info->handler_ctx);
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint32_t i = 0; i < curr_num_DBs; i++) {
// change to a new descriptor
DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor);
@@ -928,7 +928,7 @@ int ha_tokudb::alter_table_expand_one_column(TABLE *altered_table, Alter_inplace
assert(0);
}
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint32_t i = 0; i < curr_num_DBs; i++) {
// change to a new descriptor
DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor);
@@ -1007,7 +1007,7 @@ int ha_tokudb::alter_table_expand_blobs(TABLE *altered_table, Alter_inplace_info
int error = 0;
tokudb_alter_ctx *ctx = static_cast<tokudb_alter_ctx *>(ha_alter_info->handler_ctx);
- uint32_t curr_num_DBs = table->s->keys + test(hidden_primary_key);
+ uint32_t curr_num_DBs = table->s->keys + MY_TEST(hidden_primary_key);
for (uint32_t i = 0; i < curr_num_DBs; i++) {
// change to a new descriptor
DBT row_descriptor; memset(&row_descriptor, 0, sizeof row_descriptor);
diff --git a/storage/tokudb/ha_tokudb_update.cc b/storage/tokudb/ha_tokudb_update.cc
index 94d687da67c..1316c7a105d 100644
--- a/storage/tokudb/ha_tokudb_update.cc
+++ b/storage/tokudb/ha_tokudb_update.cc
@@ -549,7 +549,7 @@ static bool is_strict_mode(THD *thd) {
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
return thd->is_strict_mode();
#else
- return test(thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
+ return MY_TEST(thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
#endif
}
@@ -837,7 +837,7 @@ int ha_tokudb::send_update_message(List<Item> &update_fields, List<Item> &update
rw_rdlock(&share->num_DBs_lock);
- if (share->num_DBs > table->s->keys + test(hidden_primary_key)) { // hot index in progress
+ if (share->num_DBs > table->s->keys + MY_TEST(hidden_primary_key)) { // hot index in progress
error = ENOTSUP; // run on the slow path
} else {
// send the update message
@@ -990,7 +990,7 @@ int ha_tokudb::send_upsert_message(THD *thd, List<Item> &update_fields, List<Ite
rw_rdlock(&share->num_DBs_lock);
- if (share->num_DBs > table->s->keys + test(hidden_primary_key)) { // hot index in progress
+ if (share->num_DBs > table->s->keys + MY_TEST(hidden_primary_key)) { // hot index in progress
error = ENOTSUP; // run on the slow path
} else {
// send the upsert message