summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-05-18 16:40:16 +0300
committerMichael Widenius <monty@askmonty.org>2012-05-18 16:40:16 +0300
commit960f6600c86d8b94e29825a3a6bf72f92353e17f (patch)
tree6f268179143188043af75c49a44d700b4d71ef24
parentd4d3ca204f9d36b01be2c4dad15d0cc5b078c6e6 (diff)
downloadmariadb-git-960f6600c86d8b94e29825a3a6bf72f92353e17f.tar.gz
Fixed compile warnings
Fixed some mtr test problems dbug/tests.c: Fixed compiler warnings mysql-test/r/handlersocket.result: Fixed that plugin_license is written mysql-test/suite/innodb/t/innodb_bug60196.test: Force sorted results as it was sometimes different on windows mysql-test/suite/rpl/t/rpl_heartbeat_basic.test: Prolong test as this failed on windows mysql-test/t/handlersocket.test: Fixed that plugin_license is written plugin/handler_socket/handlersocket/handlersocket.cpp: Use maria_declare_plugin plugin/handler_socket/handlersocket/mysql_incl.hpp: Fixed compiler warning plugin/handler_socket/libhsclient/auto_addrinfo.hpp: Fixed compiler warning sql/handler.h: Fixed typo sql/sql_plugin.cc: Fixed bug that caused plugin library name twice in error message storage/maria/ma_checkpoint.c: Fixed compiler warning storage/maria/ma_loghandler.c: Fixed compiler warning unittest/mysys/base64-t.c: Fixed compiler warning unittest/mysys/bitmap-t.c: Fixed compiler warning unittest/mysys/my_malloc-t.c: Fixed compiler warning
-rw-r--r--dbug/tests.c3
-rw-r--r--mysql-test/r/handlersocket.result11
-rwxr-xr-xmysql-test/suite/innodb/t/innodb_bug60196.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.test2
-rw-r--r--mysql-test/t/handlersocket.test2
-rw-r--r--plugin/handler_socket/handlersocket/handlersocket.cpp10
-rw-r--r--plugin/handler_socket/handlersocket/mysql_incl.hpp3
-rw-r--r--plugin/handler_socket/libhsclient/auto_addrinfo.hpp5
-rw-r--r--sql/handler.h2
-rw-r--r--sql/sql_plugin.cc5
-rw-r--r--storage/maria/ma_checkpoint.c2
-rw-r--r--storage/maria/ma_loghandler.c2
-rw-r--r--unittest/mysys/base64-t.c2
-rw-r--r--unittest/mysys/bitmap-t.c2
-rw-r--r--unittest/mysys/my_malloc-t.c2
15 files changed, 32 insertions, 22 deletions
diff --git a/dbug/tests.c b/dbug/tests.c
index 657ed638a5a..22a445fdeca 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -36,7 +36,8 @@ int func1()
DBUG_RETURN(10);
}
-int main (int argc, char *argv[])
+int main (int argc __attribute__((unused)),
+ char *argv[] __attribute__((unused)))
{
#ifdef DBUG_OFF
return 1;
diff --git a/mysql-test/r/handlersocket.result b/mysql-test/r/handlersocket.result
index dcea3c186b6..a415b12f92d 100644
--- a/mysql-test/r/handlersocket.result
+++ b/mysql-test/r/handlersocket.result
@@ -1,13 +1,14 @@
install plugin handlersocket soname 'handlersocket.so';
-select plugin_name, plugin_version, plugin_status, plugin_type, plugin_library, plugin_library_version, plugin_author, plugin_description plugin_license, plugin_maturity, plugin_auth_version from information_schema.plugins where plugin_name = 'handlersocket';
+select plugin_name, plugin_version, plugin_status, plugin_type, plugin_library, plugin_library_version, plugin_author, plugin_description, plugin_license, plugin_maturity, plugin_auth_version from information_schema.plugins where plugin_name = 'handlersocket';
plugin_name handlersocket
plugin_version 1.0
plugin_status ACTIVE
plugin_type DAEMON
plugin_library handlersocket.so
-plugin_library_version 0.0
+plugin_library_version 1.3
plugin_author higuchi dot akira at dena dot jp
-plugin_license
-plugin_maturity Unknown
-plugin_auth_version Unknown
+plugin_description Direct access into InnoDB
+plugin_license BSD
+plugin_maturity Beta
+plugin_auth_version 1.0
uninstall plugin handlersocket;
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test
index fcef3196845..423b6d3403e 100755
--- a/mysql-test/suite/innodb/t/innodb_bug60196.test
+++ b/mysql-test/suite/innodb/t/innodb_bug60196.test
@@ -77,6 +77,7 @@ SELECT * FROM Bug_60196;
INSERT INTO Bug_60196 VALUES (2, 1);
INSERT INTO Bug_60196 VALUES (2, 2);
INSERT INTO Bug_60196 VALUES (2, 3);
+--sorted_result
SELECT * FROM Bug_60196;
--echo
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
index 78489449ab8..e736eb1ba12 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
@@ -324,7 +324,7 @@ call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received w
let $slave_errno= ER_DUP_ENTRY
--source include/wait_for_slave_sql_error.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
-sleep 2;
+sleep 4;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
--echo Heartbeat events are received while sql thread stopped (1 means 'yes'): $result
diff --git a/mysql-test/t/handlersocket.test b/mysql-test/t/handlersocket.test
index 6a7b65797c5..10cb9728fb7 100644
--- a/mysql-test/t/handlersocket.test
+++ b/mysql-test/t/handlersocket.test
@@ -5,6 +5,6 @@ if (`select length('$HANDLERSOCKET_SO') = 0`) {
}
install plugin handlersocket soname 'handlersocket.so';
---query_vertical select plugin_name, plugin_version, plugin_status, plugin_type, plugin_library, plugin_library_version, plugin_author, plugin_description plugin_license, plugin_maturity, plugin_auth_version from information_schema.plugins where plugin_name = 'handlersocket'
+--query_vertical select plugin_name, plugin_version, plugin_status, plugin_type, plugin_library, plugin_library_version, plugin_author, plugin_description, plugin_license, plugin_maturity, plugin_auth_version from information_schema.plugins where plugin_name = 'handlersocket'
uninstall plugin handlersocket;
diff --git a/plugin/handler_socket/handlersocket/handlersocket.cpp b/plugin/handler_socket/handlersocket/handlersocket.cpp
index 7b60eaa28d3..2595d24a85c 100644
--- a/plugin/handler_socket/handlersocket/handlersocket.cpp
+++ b/plugin/handler_socket/handlersocket/handlersocket.cpp
@@ -197,20 +197,20 @@ static SHOW_VAR daemon_handlersocket_status_variables[] = {
};
-mysql_declare_plugin(handlersocket)
+maria_declare_plugin(handlersocket)
{
MYSQL_DAEMON_PLUGIN,
&daemon_handlersocket_plugin,
"handlersocket",
"higuchi dot akira at dena dot jp",
- "",
+ "Direct access into InnoDB",
PLUGIN_LICENSE_BSD,
daemon_handlersocket_init,
daemon_handlersocket_deinit,
0x0100 /* 1.0 */,
daemon_handlersocket_status_variables,
daemon_handlersocket_system_variables,
- 0
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
}
-mysql_declare_plugin_end;
-
+maria_declare_plugin_end;
diff --git a/plugin/handler_socket/handlersocket/mysql_incl.hpp b/plugin/handler_socket/handlersocket/mysql_incl.hpp
index ac937e4e74d..0fb4fceb143 100644
--- a/plugin/handler_socket/handlersocket/mysql_incl.hpp
+++ b/plugin/handler_socket/handlersocket/mysql_incl.hpp
@@ -36,6 +36,9 @@
#include <sql_base.h>
// FIXME FIXME FIXME
#define safeFree(X) my_free(X)
+#undef pthread_cond_timedwait
+#undef pthread_mutex_lock
+#undef pthread_mutex_unlock
#define pthread_cond_timedwait mysql_cond_timedwait
#define pthread_mutex_lock mysql_mutex_lock
#define pthread_mutex_unlock mysql_mutex_unlock
diff --git a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
index 6a807a6fcc7..aee22a1d0f6 100644
--- a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
+++ b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp
@@ -13,7 +13,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
-
+#include <string.h>
#include "util.hpp"
typedef SOCKET_SIZE_TYPE size_socket;
@@ -34,8 +34,9 @@ struct auto_addrinfo : private noncopyable {
const addrinfo *get() const { return addr; }
int resolve(const char *node, const char *service, int flags = 0,
int family = AF_UNSPEC, int socktype = SOCK_STREAM, int protocol = 0) {
+ addrinfo hints;
reset();
- addrinfo hints = { };
+ memset(&hints, 0, sizeof(hints));
hints.ai_flags = flags;
hints.ai_family = family;
hints.ai_socktype = socktype;
diff --git a/sql/handler.h b/sql/handler.h
index f118f1d3c5b..142139dbabc 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1063,7 +1063,7 @@ inline LEX_STRING *hton_name(const handlerton *hton)
#define HTON_NO_FLAGS 0
#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
#define HTON_ALTER_NOT_SUPPORTED (1 << 1) //Engine does not support alter
-#define HTON_CAN_RECREATE (1 << 2) //Delete all is used fro truncate
+#define HTON_CAN_RECREATE (1 << 2) //Delete all is used for truncate
#define HTON_HIDDEN (1 << 3) //Engine does not appear in lists
#define HTON_NOT_USER_SELECTABLE (1 << 5)
#define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index a7d7f464fca..ff43c7abd55 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -739,15 +739,14 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
}
bzero(&plugin_dl, sizeof(plugin_dl));
/* Compile dll path */
- dlpathlen=
- strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS) -
- dlpath;
+ strxnmov(dlpath, sizeof(dlpath) - 1, opt_plugin_dir, "/", dl->str, NullS);
(void) unpack_filename(dlpath, dlpath);
plugin_dl.ref_count= 1;
/* Open new dll handle */
if (!(plugin_dl.handle= dlopen(dlpath, RTLD_NOW)))
{
const char *errmsg=dlerror();
+ dlpathlen= strlen(dlpath);
if (!strncmp(dlpath, errmsg, dlpathlen))
{ // if errmsg starts from dlpath, trim this prefix.
errmsg+=dlpathlen;
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index 2f5ba72a40e..30124b2205d 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -763,6 +763,8 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
PAGECACHE_FLUSH_FILTER filter;
DBUG_ENTER("collect_tables");
+ LINT_INIT(state_copies_horizon);
+
/* let's make a list of distinct shares */
mysql_mutex_lock(&THR_LOCK_maria);
for (nb= 0, pos= maria_open_list; pos; pos= pos->next)
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 801efd3f07c..341bbc6088f 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -7474,6 +7474,8 @@ static void translog_force_current_buffer_to_finish()
uint16 left= TRANSLOG_PAGE_SIZE - log_descriptor.bc.current_page_fill;
uint16 current_page_fill, write_counter, previous_offset;
DBUG_ENTER("translog_force_current_buffer_to_finish");
+ LINT_INIT(current_page_fill);
+
DBUG_PRINT("enter", ("Buffer #%u 0x%lx "
"Buffer addr: (%lu,0x%lx) "
"Page addr: (%lu,0x%lx) "
diff --git a/unittest/mysys/base64-t.c b/unittest/mysys/base64-t.c
index a8a5d166a1a..ed19c4de851 100644
--- a/unittest/mysys/base64-t.c
+++ b/unittest/mysys/base64-t.c
@@ -24,7 +24,7 @@
#define BASE64_ROWS 4 /* Number of ok(..) */
int
-main(int argc,char *argv[])
+main(int argc __attribute__((unused)),char *argv[])
{
int i, cmp;
size_t j, k, l, dst_len, needed_length;
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index bcfb9835c10..0666f4eaa15 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -520,7 +520,7 @@ error:
return TRUE;
}
-int main(int argc,char *argv[])
+int main(int argc __attribute__((unused)),char *argv[])
{
int i;
int const min_size = 1;
diff --git a/unittest/mysys/my_malloc-t.c b/unittest/mysys/my_malloc-t.c
index 40d9492b039..52d73434150 100644
--- a/unittest/mysys/my_malloc-t.c
+++ b/unittest/mysys/my_malloc-t.c
@@ -17,7 +17,7 @@
#include <my_sys.h>
#include "tap.h"
-int main(int argc,char *argv[])
+int main(int argc __attribute__((unused)),char *argv[])
{
void *p;
MY_INIT(argv[0]);