diff options
-rw-r--r-- | client/mysqltest.cc | 4 | ||||
-rw-r--r-- | mysql-test/t/partition_innodb_semi_consistent.test | 1 | ||||
-rw-r--r-- | sql/net_serv.cc | 7 | ||||
-rw-r--r-- | storage/myisam/ft_boolean_search.c | 6 | ||||
-rw-r--r-- | storage/myisam/ft_parser.c | 6 | ||||
-rw-r--r-- | storage/myisam/ft_stopwords.c | 8 | ||||
-rw-r--r-- | support-files/compiler_warnings.supp | 10 | ||||
-rw-r--r-- | unittest/mysys/waiting_threads-t.c | 2 |
8 files changed, 31 insertions, 13 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index bc5c4ed76b8..891dd72edfa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -657,7 +657,9 @@ public: } while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0) - fwrite(buf, 1, bytes, stderr); + if (fwrite(buf, 1, bytes, stderr)) + die("Failed to write to '%s', errno: %d", + m_file_name, errno); if (!lines) { diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test index 6a6a7cf958e..5eda2f142c6 100644 --- a/mysql-test/t/partition_innodb_semi_consistent.test +++ b/mysql-test/t/partition_innodb_semi_consistent.test @@ -187,6 +187,7 @@ SELECT * FROM t1; --echo # Switch to connection con2 connection con2; +--reap SELECT * FROM t1; connection default; diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 73892f31ccf..f987067b9b3 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -286,7 +286,12 @@ void net_clear(NET *net, my_bool clear_buffer) #endif DBUG_ENTER("net_clear"); -#if !defined(EMBEDDED_LIBRARY) +/* + We don't do a clear in case of DBUG_OFF to catch bugs + in the protocol handling +*/ + +#if !defined(EMBEDDED_LIBRARY) && defined(DBUG_OFF) if (clear_buffer) { while ((ready= net_data_is_ready(net->vio->sd)) > 0) diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index ae494cda385..3cc47576827 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -321,7 +321,7 @@ static int _ftb_parse_query(FTB *ftb, uchar *query, mysql_ft_size_t len, param->mysql_add_word= ftb_query_add_word; param->mysql_ftparam= (void *)&ftb_param; param->cs= ftb->charset; - param->doc= (char*) query; + param->doc= query; param->length= len; param->flags= 0; param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO; @@ -702,7 +702,7 @@ static int _ftb_check_phrase(FTB *ftb, const uchar *document, param->mysql_add_word= ftb_phrase_add_word; param->mysql_ftparam= (void *)&ftb_param; param->cs= ftb->charset; - param->doc= (char *) document; + param->doc= document; param->length= len; param->flags= 0; param->mode= MYSQL_FTPARSER_WITH_STOPWORDS; @@ -1000,7 +1000,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length) { if (!ftsi.pos) continue; - param->doc= (char *)ftsi.pos; + param->doc= ftsi.pos; param->length= ftsi.len; if (unlikely(parser->parse(param))) return 0; diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index f585038f0b8..3c3efbf0906 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -175,7 +175,7 @@ uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end, if ((param->trunc=(doc<end && *doc == FTB_TRUNC))) doc++; - if (((length >= ft_min_word_len && !is_stopword((char*) word->pos, + if (((length >= ft_min_word_len && !is_stopword(word->pos, word->len)) || param->trunc) && length < ft_max_word_len) { @@ -298,7 +298,7 @@ static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param, DBUG_ENTER("ft_parse_internal"); while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE)) - if (param->mysql_add_word(param, (char*) w.pos, w.len, 0)) + if (param->mysql_add_word(param, w.pos, w.len, 0)) DBUG_RETURN(1); DBUG_RETURN(0); } @@ -319,7 +319,7 @@ int ft_parse(TREE *wtree, const uchar *doc, mysql_ft_size_t doclen, param->mysql_add_word= ft_add_word; param->mysql_ftparam= &my_param; param->cs= wtree->custom_arg; - param->doc= (char*) doc; + param->doc= doc; param->length= doclen; param->mode= MYSQL_FTPARSER_SIMPLE_MODE; DBUG_RETURN(parser->parse(param)); diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 9544c577c70..5e550b9dff5 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -20,7 +20,7 @@ typedef struct st_ft_stopwords { - const char * pos; + const uchar* pos; size_t len; } FT_STOPWORD; @@ -30,15 +30,15 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)), FT_STOPWORD *w1, FT_STOPWORD *w2) { return ha_compare_text(default_charset_info, - (uchar *)w1->pos,w1->len, - (uchar *)w2->pos,w2->len,0,0); + w1->pos, w1->len, + w2->pos, w2->len, 0, 0); } static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, void *arg __attribute__((unused))) { if (action == free_free) - my_free((uchar*) w->pos, MYF(0)); + my_free((void*) w->pos, MYF(0)); } static int ft_add_stopword(const char *w) diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 9fef92a5f5e..7911d91928b 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -4,6 +4,7 @@ # integer.cpp: .*control reaches end of non-void function.*: 1288-1427 +integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 DictTabInfo.cpp : .*invalid access to non-static.* DictTabInfo.cpp : .*macro was used incorrectly.* DbdihMain.cpp : .*unused variable.* : 6666-7013 @@ -27,13 +28,17 @@ _flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 include/buf0buf\.ic: unused parameter ‘mtr’ +fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 fil/fil0fil\.c: unused parameter log/log0recv\.c: unused variable os/os0file\.c: unused parameter +os/os0file\.c: pointer targets in assignment differ in signedness handler/i_s\.cc: unused variable sync/sync0rw\.c: unused parameter sync/sync0sync\.c: unused parameter +sync/sync0sync\.c: unused variable +ut/ut0ut\.c: ignoring return value of # # bdb is not critical to keep up to date @@ -98,10 +103,15 @@ storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used # I think these are due to mix of C and C++. # storage/pbxt/ : typedef.*was ignored in this declaration +ha_pbxt\.cc : variable.*might be clobbered by.*longjmp # # Yassl include/runtime.hpp: .*pure_error.* +.*/extra/yassl/taocrypt/.*: comparison with string literal +.*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds +.*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value +.*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function # # Groff warnings on OpenSUSE. diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c index d6c8dc31025..79dee219efb 100644 --- a/unittest/mysys/waiting_threads-t.c +++ b/unittest/mysys/waiting_threads-t.c @@ -258,7 +258,7 @@ void do_tests() #define test_kill_strategy(X) \ diag("kill strategy: " #X); \ DBUG_EXECUTE("reset_file", \ - { rewind(DBUG_FILE); ftruncate(fileno(DBUG_FILE), 0); }); \ + { rewind(DBUG_FILE); (void) ftruncate(fileno(DBUG_FILE), 0); }); \ DBUG_PRINT("info", ("kill strategy: " #X)); \ kill_strategy=X; \ do_one_test(); |