summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
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 /libmysql/libmysql.c
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 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 78de4b8867f..66720e9d510 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2083,8 +2083,8 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
buff[4]= (char) stmt->flags;
int4store(buff+5, 1); /* iteration count */
- res= test(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
- (uchar*) packet, length, 1, stmt) ||
+ res= MY_TEST(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
+ (uchar*) packet, length, 1, stmt) ||
(*mysql->methods->read_query_result)(mysql));
stmt->affected_rows= mysql->affected_rows;
stmt->server_status= mysql->server_status;
@@ -2571,7 +2571,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
reinit_result_set_metadata(stmt);
prepare_to_fetch_result(stmt);
}
- DBUG_RETURN(test(stmt->last_errno));
+ DBUG_RETURN(MY_TEST(stmt->last_errno));
}
@@ -3187,14 +3187,14 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
{
double data= my_strntod(&my_charset_latin1, value, length, &endptr, &err);
float fdata= (float) data;
- *param->error= (fdata != data) | test(err);
+ *param->error= (fdata != data) | MY_TEST(err);
floatstore(buffer, fdata);
break;
}
case MYSQL_TYPE_DOUBLE:
{
double data= my_strntod(&my_charset_latin1, value, length, &endptr, &err);
- *param->error= test(err);
+ *param->error= MY_TEST(err);
doublestore(buffer, data);
break;
}
@@ -3204,7 +3204,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
MYSQL_TIME_STATUS status;
str_to_time(value, length, tm, 0, &status);
err= status.warnings;
- *param->error= test(err);
+ *param->error= MY_TEST(err);
break;
}
case MYSQL_TYPE_DATE:
@@ -3215,8 +3215,8 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
MYSQL_TIME_STATUS status;
(void) str_to_datetime(value, length, tm, 0, &status);
err= status.warnings;
- *param->error= test(err) && (param->buffer_type == MYSQL_TYPE_DATE &&
- tm->time_type != MYSQL_TIMESTAMP_DATE);
+ *param->error= MY_TEST(err) && (param->buffer_type == MYSQL_TYPE_DATE &&
+ tm->time_type != MYSQL_TIMESTAMP_DATE);
break;
}
case MYSQL_TYPE_TINY_BLOB:
@@ -3338,7 +3338,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
{
int error;
value= number_to_datetime(value, 0, (MYSQL_TIME *) buffer, 0, &error);
- *param->error= test(error);
+ *param->error= MY_TEST(error);
break;
}
default:
@@ -3686,7 +3686,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field,
uchar **row)
{
- my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
uchar data= **row;
*(uchar *)param->buffer= data;
*param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX8;
@@ -3696,7 +3696,7 @@ static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field,
static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field,
uchar **row)
{
- my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
ushort data= (ushort) sint2korr(*row);
shortstore(param->buffer, data);
*param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX16;
@@ -3707,7 +3707,7 @@ static void fetch_result_int32(MYSQL_BIND *param,
MYSQL_FIELD *field __attribute__((unused)),
uchar **row)
{
- my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
uint32 data= (uint32) sint4korr(*row);
longstore(param->buffer, data);
*param->error= param->is_unsigned != field_is_unsigned && data > INT_MAX32;
@@ -3718,7 +3718,7 @@ static void fetch_result_int64(MYSQL_BIND *param,
MYSQL_FIELD *field __attribute__((unused)),
uchar **row)
{
- my_bool field_is_unsigned= test(field->flags & UNSIGNED_FLAG);
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
ulonglong data= (ulonglong) sint8korr(*row);
*param->error= param->is_unsigned != field_is_unsigned && data > LONGLONG_MAX;
longlongstore(param->buffer, data);
@@ -4711,7 +4711,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
my_free(stmt->extension);
my_free(stmt);
- DBUG_RETURN(test(rc));
+ DBUG_RETURN(MY_TEST(rc));
}
/*