[Commits] 4b71faecf7a: MDEV-19129: Build Failure on OSX

Varun varunraiko1803 at gmail.com
Tue Apr 2 21:42:45 EEST 2019


revision-id: 4b71faecf7add3af87ceb84bd738716d4954e828 (mariadb-10.2.22-128-g4b71faecf7a)
parent(s): 5633f83ca42ac6f035cf2c18ae11b3b7639b1f7e
author: Varun Gupta
committer: Varun Gupta
timestamp: 2019-04-03 00:10:45 +0530
message:

MDEV-19129: Build Failure on OSX

Fixing part #1, added flag Wno-error=deprecated-declarations to convert errors to warnings, fixed rest of the warnings

---
 cmake/maintainer.cmake             | 4 ++++
 include/my_global.h                | 2 +-
 mysys/my_sync.c                    | 2 ++
 plugin/server_audit/server_audit.c | 2 ++
 sql/sql_parse.cc                   | 3 ++-
 storage/connect/ha_connect.cc      | 7 ++++---
 storage/rocksdb/ha_rocksdb.cc      | 1 -
 storage/spider/spd_table.cc        | 2 +-
 8 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index caba370c4ae..f058f0861de 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -35,6 +35,10 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
   SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized)
 ENDIF()
 
+IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "10.0.0")
+  SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=deprecated-declarations)
+ENDIF()
+
 IF(MYSQL_MAINTAINER_MODE MATCHES "OFF")
   RETURN()
 ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
diff --git a/include/my_global.h b/include/my_global.h
index 719464933b8..c56105199dc 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -535,7 +535,7 @@ C_MODE_START
 #ifdef HAVE_SIGHANDLER_T
 #define sig_return sighandler_t
 #else
-typedef void (*sig_return)(void); /* Returns type from signal */
+typedef void (*sig_return)(int); /* Returns type from signal */
 #endif
 C_MODE_END
 #if defined(__GNUC__) && !defined(_lint)
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index d1e239692f1..61a5fa170a5 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -133,7 +133,9 @@ int my_sync(File fd, myf my_flags)
 } /* my_sync */
 
 
+#ifdef NEED_EXPLICIT_SYNC_DIR
 static const char cur_dir_name[]= {FN_CURLIB, 0};
+#endif
 
 /*
   Force directory information to disk.
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 0995327a86d..0d25d8bec06 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -2130,6 +2130,7 @@ struct mysql_event_general_v8
 
 static void auditing_v8(MYSQL_THD thd, struct mysql_event_general_v8 *ev_v8)
 {
+#ifdef __linux__
 #ifdef DBUG_OFF
   #ifdef __x86_64__
   static const int cmd_off= 4200;
@@ -2151,6 +2152,7 @@ static void auditing_v8(MYSQL_THD thd, struct mysql_event_general_v8 *ev_v8)
   static const int db_len_off= 68;
   #endif /*x86_64*/
 #endif /*DBUG_OFF*/
+#endif
 
   struct mysql_event_general event;
 
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a80bf004916..57951a3d031 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1296,7 +1296,8 @@ bool do_command(THD *thd)
       mysql_mutex_lock(&thd->LOCK_thd_data);
       if (thd->wsrep_conflict_state == MUST_ABORT)
       {
-        DBUG_PRINT("wsrep",("aborted for wsrep rollback: %lu", thd->real_id));
+        DBUG_PRINT("wsrep",("aborted for wsrep rollback: %lu",
+                    (unsigned long)thd->real_id));
         wsrep_client_rollback(thd);
       }
       mysql_mutex_unlock(&thd->LOCK_thd_data);
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 859dc859a09..6724eda4521 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s)
 {
   char *sv;
 
-  if (IsPartitioned() && s && partname && *partname) {
+  if (IsPartitioned() && s && *partname) {
     sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
     sprintf(sv, s, partname);
     PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
@@ -3061,6 +3061,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
 					const char *p;
 					char *s = (ishav) ? havg : body;
 					uint	j, k, n;
+          const char *str= "1970-01-01 00:00:00";
 
           // Append the value to the filter
           switch (args[i]->field_type()) {
@@ -3071,7 +3072,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
                 strncat(s, res->ptr(), res->length());
 
                 if (res->length() < 19)
-                  strcat(s, "1970-01-01 00:00:00" + res->length());
+                  strcat(s, str + res->length());
 
                 strcat(s, "'}");
                 break;
@@ -3101,7 +3102,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
                     strncat(s, res->ptr(), res->length());
 
                     if (res->length() < 19)
-                      strcat(s, "1970-01-01 00:00:00" + res->length());
+                      strcat(s, str + res->length());
 
                     strcat(s, "'}");
                     break;
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index 022511320a6..8364dd118a7 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -268,7 +268,6 @@ static void rocksdb_flush_all_memtables() {
 namespace // anonymous namespace = not visible outside this source file
 {
 
-const ulong TABLE_HASH_SIZE = 32;
 typedef Hash_set<Rdb_table_handler> Rdb_table_set;
 
 struct Rdb_open_tables_map {
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index b4d69af12c4..70edc8c7c09 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -6308,7 +6308,7 @@ int spider_panic(
 int spider_db_init(
   void *p
 ) {
-  int error_num, roop_count;
+  int error_num= 0, roop_count;
   uint dbton_id = 0;
   handlerton *spider_hton = (handlerton *)p;
   DBUG_ENTER("spider_db_init");


More information about the commits mailing list