summaryrefslogtreecommitdiff
path: root/storage/maria
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/maria
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/maria')
-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
21 files changed, 91 insertions, 88 deletions
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"