diff options
Diffstat (limited to 'plugin/feedback')
-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 |
3 files changed, 21 insertions, 14 deletions
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; } |