summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authormonty@mysql.com/narttu.mysql.fi <>2007-02-23 13:13:55 +0200
committermonty@mysql.com/narttu.mysql.fi <>2007-02-23 13:13:55 +0200
commitf0ae3ce9b97f45b717201764c6af6e4bd4176e5c (patch)
treeaa523ca58b5c098a79faefb22302aa717f4ae942 /extra
parenta5051aa4ebaf48fae5f7b6f52889c3c66a12dd23 (diff)
downloadmariadb-git-f0ae3ce9b97f45b717201764c6af6e4bd4176e5c.tar.gz
Fixed compiler warnings
Fixed compile-pentium64 scripts Fixed wrong estimate of update_with_key_prefix in sql-bench Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1 Fixed unsafe define of uint4korr() Fixed that --extern works with mysql-test-run.pl Small trivial cleanups This also fixes a bug in counting number of rows that are updated when we have many simultanous queries Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc Split handle_one_connection() into reusable sub functions. Split create_new_thread() into reusable sub functions. Added thread_scheduler; Preliminary interface code for future thread_handling code. Use 'my_thread_id' for internal thread id's Make thr_alarm_kill() to depend on thread_id instead of thread Make thr_abort_locks_for_thread() depend on thread_id instead of thread In store_globals(), set my_thread_var->id to be thd->thread_id. Use my_thread_var->id as basis for my_thread_name() The above changes makes the connection we have between THD and threads more soft. Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions Fixed compiler warnings Fixed core dumps when running with --debug Removed setting of signal masks (was never used) Made event code call pthread_exit() (portability fix) Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called. Made handling of thread_id and thd->variables.pseudo_thread_id uniform. Removed one common 'not freed memory' warning from mysqltest Fixed a couple of usage of not initialized warnings (unlikely cases) Suppress compiler warnings from bdb and (for the moment) warnings from ndb
Diffstat (limited to 'extra')
-rw-r--r--extra/charset2html.c2
-rw-r--r--extra/comp_err.c4
-rw-r--r--extra/yassl/include/lock.hpp2
-rw-r--r--extra/yassl/include/openssl/ssl.h9
-rw-r--r--extra/yassl/include/socket_wrapper.hpp8
-rw-r--r--extra/yassl/include/yassl.hpp2
-rw-r--r--extra/yassl/src/ssl.cpp8
-rw-r--r--extra/yassl/taocrypt/src/integer.cpp2
-rw-r--r--extra/yassl/testsuite/testsuite.cpp4
9 files changed, 27 insertions, 14 deletions
diff --git a/extra/charset2html.c b/extra/charset2html.c
index 8795c82bc34..8dcfa0c8990 100644
--- a/extra/charset2html.c
+++ b/extra/charset2html.c
@@ -153,7 +153,9 @@ int main(int argc, char **argv) {
my_init();
if (argc > argcnt && argv[argcnt][0] == '-' && argv[argcnt][1] == '#')
+ {
DBUG_PUSH(argv[argcnt++]+2);
+ }
if (argc > argcnt)
the_set = argv[argcnt++];
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 00aab96454e..a2e52b73f90 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -41,7 +41,9 @@ static char *NAMEFILE= (char*) "mysqld_ername.h";
static char *STATEFILE= (char*) "sql_state.h";
static char *TXTFILE= (char*) "../sql/share/errmsg.txt";
static char *DATADIRECTORY= (char*) "../sql/share/";
+#ifndef DBUG_OFF
static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
+#endif
/* Header for errmsg.sys files */
uchar file_head[]= { 254, 254, 2, 1 };
@@ -402,6 +404,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
int rcount= 0;
DBUG_ENTER("parse_input_file");
+ *top_error= 0;
+ *top_lang= 0;
if (!(file= my_fopen(file_name, O_RDONLY | O_SHARE, MYF(MY_WME))))
DBUG_RETURN(0);
diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp
index 0525943e45d..b961ec3e478 100644
--- a/extra/yassl/include/lock.hpp
+++ b/extra/yassl/include/lock.hpp
@@ -28,7 +28,7 @@ namespace yaSSL {
#ifdef MULTI_THREADED
- #ifdef _WIN32
+ #if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
class Mutex {
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 16110c52f43..5bc4a053d51 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -33,7 +33,6 @@
#include "opensslv.h" /* for version number */
#include "rsa.h"
-
#define YASSL_VERSION "1.5.8"
@@ -190,11 +189,17 @@ enum { /* ERR Constants */
EVP_R_BAD_DECRYPT = 2
};
+#if defined(_WIN32) || defined(_WIN64)
+ #include <winsock2.h>
+ typedef SOCKET socket_t;
+#else
+ typedef int socket_t;
+#endif
SSL_CTX* SSL_CTX_new(SSL_METHOD*);
SSL* SSL_new(SSL_CTX*);
-int SSL_set_fd (SSL*, int);
+int SSL_set_fd (SSL*, socket_t);
int SSL_connect(SSL*);
int SSL_write(SSL*, const void*, int);
int SSL_read(SSL*, void*, int);
diff --git a/extra/yassl/include/socket_wrapper.hpp b/extra/yassl/include/socket_wrapper.hpp
index 308704c2af0..5ac430c2318 100644
--- a/extra/yassl/include/socket_wrapper.hpp
+++ b/extra/yassl/include/socket_wrapper.hpp
@@ -28,7 +28,7 @@
#include <assert.h>
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_WIN64)
#include <winsock2.h>
#else
#include <sys/time.h>
@@ -38,16 +38,14 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
+#include "openssl/ssl.h" /* for socket_t */
namespace yaSSL {
typedef unsigned int uint;
-#ifdef _WIN32
- typedef SOCKET socket_t;
-#else
- typedef int socket_t;
+#if !defined( _WIN32) && !defined(_WIN64)
const socket_t INVALID_SOCKET = -1;
const int SD_RECEIVE = 0;
const int SD_SEND = 1;
diff --git a/extra/yassl/include/yassl.hpp b/extra/yassl/include/yassl.hpp
index 29e0a5d94ec..b8190c484f7 100644
--- a/extra/yassl/include/yassl.hpp
+++ b/extra/yassl/include/yassl.hpp
@@ -28,7 +28,7 @@
namespace yaSSL {
-#ifdef _WIN32
+#if defined(_WIN32) || defined(_WIN64)
typedef unsigned int SOCKET_T;
#else
typedef int SOCKET_T;
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 70198af79b4..c1d9ac81919 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -39,6 +39,7 @@
#include "coding.hpp" // HexDecoder
#include "helpers.hpp" // for placement new hack
#include <stdio.h>
+#include <assert.h>
#ifdef _WIN32
#include <windows.h> // FindFirstFile etc..
@@ -58,6 +59,9 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
return SSL_BAD_FILETYPE;
+ if (file == NULL || !file[0])
+ return SSL_BAD_FILE;
+
FILE* input = fopen(file, "rb");
if (!input)
return SSL_BAD_FILE;
@@ -229,7 +233,7 @@ void SSL_free(SSL* ssl)
}
-int SSL_set_fd(SSL* ssl, int fd)
+int SSL_set_fd(SSL* ssl, socket_t fd)
{
ssl->useSocket().set_fd(fd);
return SSL_SUCCESS;
@@ -950,7 +954,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
char* ERR_error_string(unsigned long errNumber, char* buffer)
{
- static char* msg = "Please supply a buffer for error string";
+ static char* msg = (char*) "Please supply a buffer for error string";
if (buffer) {
SetErrorString(YasslError(errNumber), buffer);
diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp
index 419783403ea..84255aa8544 100644
--- a/extra/yassl/taocrypt/src/integer.cpp
+++ b/extra/yassl/taocrypt/src/integer.cpp
@@ -3390,7 +3390,7 @@ void Integer::DivideByPowerOf2(Integer &r, Integer &q, const Integer &a,
CopyWords(r.reg_.get_buffer(), a.reg_.get_buffer(), wordCount);
SetWords(r.reg_+wordCount, 0, r.reg_.size()-wordCount);
if (n % WORD_BITS != 0)
- r.reg_[wordCount-1] %= (1 << (n % WORD_BITS));
+ r.reg_[wordCount-1] %= ((word) 1 << (n % WORD_BITS));
}
else
{
diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp
index 93b9b3d7026..06e75153341 100644
--- a/extra/yassl/testsuite/testsuite.cpp
+++ b/extra/yassl/testsuite/testsuite.cpp
@@ -86,8 +86,8 @@ int main(int argc, char** argv)
// input output compare
byte input[TaoCrypt::MD5::DIGEST_SIZE];
byte output[TaoCrypt::MD5::DIGEST_SIZE];
- file_test("input", input);
- file_test("output", output);
+ file_test((char*) "input", input);
+ file_test((char*) "output", output);
assert(memcmp(input, output, sizeof(input)) == 0);
printf("\nAll tests passed!\n");