mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fixed compiler warnings & failing test cases
When compiling with debug, don't clear buffer in 'net_clear()' - This allows us to easier find bugs in the protocol and also get repeatable test failures in test cases where someone forgot to do --reap client/mysqltest.cc: Fixed compiler warning mysql-test/t/partition_innodb_semi_consistent.test: Added missing --reap (fixes random failure) sql/net_serv.cc: When compiling with debug, don't clear buffer in 'net_clear()' - This allows us to easier find bugs in the protocol and also get repeatable test failures in test cases where someone forgot to do --reap storage/myisam/ft_boolean_search.c: Fixed compiler warnings storage/myisam/ft_parser.c: Fixed compiler warnings storage/myisam/ft_stopwords.c: Fixed compiler warnings support-files/compiler_warnings.supp: Added a lot of new suppression of not relevant warnings and warnings in systems we are not in charge of unittest/mysys/waiting_threads-t.c: Fixed compiler warnings
This commit is contained in:
@@ -657,7 +657,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
|
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)
|
if (!lines)
|
||||||
{
|
{
|
||||||
|
@@ -187,6 +187,7 @@ SELECT * FROM t1;
|
|||||||
|
|
||||||
--echo # Switch to connection con2
|
--echo # Switch to connection con2
|
||||||
connection con2;
|
connection con2;
|
||||||
|
--reap
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
|
@@ -286,7 +286,12 @@ void net_clear(NET *net, my_bool clear_buffer)
|
|||||||
#endif
|
#endif
|
||||||
DBUG_ENTER("net_clear");
|
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)
|
if (clear_buffer)
|
||||||
{
|
{
|
||||||
while ((ready= net_data_is_ready(net->vio->sd)) > 0)
|
while ((ready= net_data_is_ready(net->vio->sd)) > 0)
|
||||||
|
@@ -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_add_word= ftb_query_add_word;
|
||||||
param->mysql_ftparam= (void *)&ftb_param;
|
param->mysql_ftparam= (void *)&ftb_param;
|
||||||
param->cs= ftb->charset;
|
param->cs= ftb->charset;
|
||||||
param->doc= (char*) query;
|
param->doc= query;
|
||||||
param->length= len;
|
param->length= len;
|
||||||
param->flags= 0;
|
param->flags= 0;
|
||||||
param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO;
|
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_add_word= ftb_phrase_add_word;
|
||||||
param->mysql_ftparam= (void *)&ftb_param;
|
param->mysql_ftparam= (void *)&ftb_param;
|
||||||
param->cs= ftb->charset;
|
param->cs= ftb->charset;
|
||||||
param->doc= (char *) document;
|
param->doc= document;
|
||||||
param->length= len;
|
param->length= len;
|
||||||
param->flags= 0;
|
param->flags= 0;
|
||||||
param->mode= MYSQL_FTPARSER_WITH_STOPWORDS;
|
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)
|
if (!ftsi.pos)
|
||||||
continue;
|
continue;
|
||||||
param->doc= (char *)ftsi.pos;
|
param->doc= ftsi.pos;
|
||||||
param->length= ftsi.len;
|
param->length= ftsi.len;
|
||||||
if (unlikely(parser->parse(param)))
|
if (unlikely(parser->parse(param)))
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -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)))
|
if ((param->trunc=(doc<end && *doc == FTB_TRUNC)))
|
||||||
doc++;
|
doc++;
|
||||||
|
|
||||||
if (((length >= ft_min_word_len && !is_stopword((char*) word->pos,
|
if (((length >= ft_min_word_len && !is_stopword(word->pos,
|
||||||
word->len))
|
word->len))
|
||||||
|| param->trunc) && length < ft_max_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");
|
DBUG_ENTER("ft_parse_internal");
|
||||||
|
|
||||||
while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE))
|
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(1);
|
||||||
DBUG_RETURN(0);
|
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_add_word= ft_add_word;
|
||||||
param->mysql_ftparam= &my_param;
|
param->mysql_ftparam= &my_param;
|
||||||
param->cs= wtree->custom_arg;
|
param->cs= wtree->custom_arg;
|
||||||
param->doc= (char*) doc;
|
param->doc= doc;
|
||||||
param->length= doclen;
|
param->length= doclen;
|
||||||
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
|
param->mode= MYSQL_FTPARSER_SIMPLE_MODE;
|
||||||
DBUG_RETURN(parser->parse(param));
|
DBUG_RETURN(parser->parse(param));
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
typedef struct st_ft_stopwords
|
typedef struct st_ft_stopwords
|
||||||
{
|
{
|
||||||
const char * pos;
|
const uchar* pos;
|
||||||
size_t len;
|
size_t len;
|
||||||
} FT_STOPWORD;
|
} FT_STOPWORD;
|
||||||
|
|
||||||
@@ -30,15 +30,15 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)),
|
|||||||
FT_STOPWORD *w1, FT_STOPWORD *w2)
|
FT_STOPWORD *w1, FT_STOPWORD *w2)
|
||||||
{
|
{
|
||||||
return ha_compare_text(default_charset_info,
|
return ha_compare_text(default_charset_info,
|
||||||
(uchar *)w1->pos,w1->len,
|
w1->pos, w1->len,
|
||||||
(uchar *)w2->pos,w2->len,0,0);
|
w2->pos, w2->len, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
|
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
|
||||||
void *arg __attribute__((unused)))
|
void *arg __attribute__((unused)))
|
||||||
{
|
{
|
||||||
if (action == free_free)
|
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)
|
static int ft_add_stopword(const char *w)
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
integer.cpp: .*control reaches end of non-void function.*: 1288-1427
|
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 : .*invalid access to non-static.*
|
||||||
DictTabInfo.cpp : .*macro was used incorrectly.*
|
DictTabInfo.cpp : .*macro was used incorrectly.*
|
||||||
DbdihMain.cpp : .*unused variable.* : 6666-7013
|
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.*
|
pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.*
|
||||||
btr/btr0cur\.c: .*value computed is not used.*: 3175-3375
|
btr/btr0cur\.c: .*value computed is not used.*: 3175-3375
|
||||||
include/buf0buf\.ic: unused parameter ‘mtr’
|
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: comparison between signed and unsigned : 3100-3199
|
||||||
fil/fil0fil\.c: unused parameter
|
fil/fil0fil\.c: unused parameter
|
||||||
log/log0recv\.c: unused variable
|
log/log0recv\.c: unused variable
|
||||||
os/os0file\.c: unused parameter
|
os/os0file\.c: unused parameter
|
||||||
|
os/os0file\.c: pointer targets in assignment differ in signedness
|
||||||
handler/i_s\.cc: unused variable
|
handler/i_s\.cc: unused variable
|
||||||
sync/sync0rw\.c: unused parameter
|
sync/sync0rw\.c: unused parameter
|
||||||
sync/sync0sync\.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
|
# 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++.
|
# I think these are due to mix of C and C++.
|
||||||
#
|
#
|
||||||
storage/pbxt/ : typedef.*was ignored in this declaration
|
storage/pbxt/ : typedef.*was ignored in this declaration
|
||||||
|
ha_pbxt\.cc : variable.*might be clobbered by.*longjmp
|
||||||
|
|
||||||
#
|
#
|
||||||
# Yassl
|
# Yassl
|
||||||
include/runtime.hpp: .*pure_error.*
|
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.
|
# Groff warnings on OpenSUSE.
|
||||||
|
@@ -258,7 +258,7 @@ void do_tests()
|
|||||||
#define test_kill_strategy(X) \
|
#define test_kill_strategy(X) \
|
||||||
diag("kill strategy: " #X); \
|
diag("kill strategy: " #X); \
|
||||||
DBUG_EXECUTE("reset_file", \
|
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)); \
|
DBUG_PRINT("info", ("kill strategy: " #X)); \
|
||||||
kill_strategy=X; \
|
kill_strategy=X; \
|
||||||
do_one_test();
|
do_one_test();
|
||||||
|
Reference in New Issue
Block a user