Commit 3ddbc987 authored by pem@mysql.comhem.se's avatar pem@mysql.comhem.se

Corrected faulty #if tests in udf_example.cc which made udf_test crash the server on some

platforms.
parent 7c3ee999
...@@ -681,7 +681,7 @@ my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) ...@@ -681,7 +681,7 @@ my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} }
initid->max_length=11; initid->max_length=11;
initid->maybe_null=1; initid->maybe_null=1;
#if !defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW);
#endif #endif
return 0; return 0;
...@@ -689,7 +689,7 @@ my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) ...@@ -689,7 +689,7 @@ my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
void lookup_deinit(UDF_INIT *initid) void lookup_deinit(UDF_INIT *initid)
{ {
#if !defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname); (void) pthread_mutex_destroy(&LOCK_hostname);
#endif #endif
} }
...@@ -756,7 +756,7 @@ my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) ...@@ -756,7 +756,7 @@ my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
} }
initid->max_length=32; initid->max_length=32;
initid->maybe_null=1; initid->maybe_null=1;
#if !defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_hostname,MY_MUTEX_INIT_SLOW);
#endif #endif
return 0; return 0;
...@@ -764,7 +764,7 @@ my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message) ...@@ -764,7 +764,7 @@ my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
void reverse_lookup_deinit(UDF_INIT *initid) void reverse_lookup_deinit(UDF_INIT *initid)
{ {
#if !defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST) #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname); (void) pthread_mutex_destroy(&LOCK_hostname);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment