diff options
author | Michael Widenius <monty@askmonty.org> | 2011-11-24 18:48:58 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-11-24 18:48:58 +0200 |
commit | 69204571425ed3221e94c7eb1e030c00089bca26 (patch) | |
tree | 3d9cfbc44a057883c7db6bce267c8ebfd5fa9313 /plugin | |
parent | e3e60a4102d6918e4231e402bef89b1a6b2a20cb (diff) | |
parent | d26aefb0775048128495eaab151ee4118f8f7afd (diff) | |
download | mariadb-git-69204571425ed3221e94c7eb1e030c00089bca26.tar.gz |
Merge with MariaDB 5.1
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/Makefile.am | 3 | ||||
-rw-r--r-- | plugin/daemon_example/Makefile.am | 2 | ||||
-rw-r--r-- | plugin/feedback/feedback.cc | 6 | ||||
-rw-r--r-- | plugin/feedback/url_http.cc | 12 | ||||
-rw-r--r-- | plugin/feedback/utils.cc | 17 | ||||
-rw-r--r-- | plugin/fulltext/plugin_example.c | 2 |
6 files changed, 25 insertions, 17 deletions
diff --git a/plugin/Makefile.am b/plugin/Makefile.am index e6d9ee4d823..9f58d3c7030 100644 --- a/plugin/Makefile.am +++ b/plugin/Makefile.am @@ -1,4 +1,5 @@ -# Copyright (C) 2005-2006 MySQL AB +# Copyright (c) 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am index 5905e3ef075..4a7409518b6 100644 --- a/plugin/daemon_example/Makefile.am +++ b/plugin/daemon_example/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006, 2010, Oracle and/or its affiliates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index 08464aec386..3ade31b80b4 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -346,7 +346,7 @@ mysql_declare_plugin(feedback) PLUGIN_LICENSE_GPL, feedback::init, feedback::free, - 0x0100, + 0x0101, NULL, feedback::settings, NULL @@ -363,10 +363,10 @@ maria_declare_plugin(feedback) PLUGIN_LICENSE_GPL, feedback::init, feedback::free, - 0x0100, + 0x0101, NULL, feedback::settings, - "1.0", + "1.1", MariaDB_PLUGIN_MATURITY_BETA } mysql_declare_plugin_end; diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc index de2877b0274..71b67a52807 100644 --- a/plugin/feedback/url_http.cc +++ b/plugin/feedback/url_http.cc @@ -155,7 +155,7 @@ int Url_http::send(const char* data, size_t data_length) { my_socket fd= INVALID_SOCKET; char buf[1024]; - uint len; + uint len= 0; addrinfo *addrs, *addr, filter= {0, AF_UNSPEC, SOCK_STREAM, 6, 0, 0, 0, 0}; int res= getaddrinfo(host.str, port.str, &filter, &addrs); @@ -198,7 +198,7 @@ int Url_http::send(const char* data, size_t data_length) } #ifdef HAVE_OPENSSL - struct st_VioSSLFd *ssl_fd; + struct st_VioSSLFd *UNINIT_VAR(ssl_fd); if (ssl) { buf[0]= 0; @@ -258,7 +258,13 @@ int Url_http::send(const char* data, size_t data_length) Extract the first string between <h1>...</h1> tags and put it as a server reply into the error log. */ - len= vio_read(vio, (uchar*)buf, sizeof(buf)-1); + for (;;) + { + size_t i= vio_read(vio, (uchar*)buf + len, sizeof(buf) - len - 1); + if ((int)i <= 0) + break; + len+= i; + } if (len && len < sizeof(buf)) { char *from; diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc index f32b527c052..48bbd72d530 100644 --- a/plugin/feedback/utils.cc +++ b/plugin/feedback/utils.cc @@ -188,24 +188,24 @@ int fill_plugin_version(THD *thd, TABLE_LIST *tables) */ static ulonglong my_getphysmem() { +#ifdef _WIN32 + MEMORYSTATUSEX memstatus; + memstatus.dwLength= sizeof(memstatus); + GlobalMemoryStatusEx(&memstatus); + return memstatus.ullTotalPhys; +#else ulonglong pages= 0; + #ifdef _SC_PHYS_PAGES pages= sysconf(_SC_PHYS_PAGES); -#else - return 0; #endif #ifdef _SC_PAGESIZE return pages * sysconf(_SC_PAGESIZE); -#endif -#ifdef _WIN32 - MEMORYSTATUSEX memstatus; - memstatus.dwLength= sizeof(memstatus); - GlobalMemoryStatusEx(&memstatus); - return memstatus.ullTotalPhys; #else return pages * my_getpagesize(); #endif +#endif } /* get the number of (online) CPUs */ @@ -356,6 +356,7 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables) INSERT1("Cpu_count", (my_getncpus(), UNSIGNED)); #endif INSERT1("Mem_total", (my_getphysmem(), UNSIGNED)); + INSERT1("Now", (thd->query_start(), UNSIGNED)); return 0; } diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c index aebdc007d92..cc84cb6161b 100644 --- a/plugin/fulltext/plugin_example.c +++ b/plugin/fulltext/plugin_example.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2011, Oracle and/or its affiliates This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by |