mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
This commit is contained in:
@ -183,6 +183,8 @@ THD::THD()
|
||||
clear_next_insert_id(0), in_lock_tables(0), bootstrap(0),
|
||||
derived_tables_processing(FALSE), spcont(NULL)
|
||||
{
|
||||
ulong tmp;
|
||||
|
||||
stmt_arena= this;
|
||||
thread_stack= 0;
|
||||
db= 0;
|
||||
@ -269,8 +271,8 @@ THD::THD()
|
||||
protocol_prep.init(this);
|
||||
|
||||
tablespace_op=FALSE;
|
||||
ulong tmp=sql_rnd_with_mutex();
|
||||
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
|
||||
tmp= sql_rnd_with_mutex();
|
||||
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::global_query_id);
|
||||
substitute_null_with_insert_id = FALSE;
|
||||
thr_lock_info_init(&lock_info); /* safety: will be reset after start */
|
||||
thr_lock_owner_init(&main_lock_id, &lock_info);
|
||||
@ -1432,7 +1434,7 @@ bool select_max_min_finder_subselect::send_data(List<Item> &items)
|
||||
|
||||
bool select_max_min_finder_subselect::cmp_real()
|
||||
{
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
|
||||
double val1= cache->val_real(), val2= maxmin->val_real();
|
||||
if (fmax)
|
||||
return (cache->null_value && !maxmin->null_value) ||
|
||||
@ -1445,7 +1447,7 @@ bool select_max_min_finder_subselect::cmp_real()
|
||||
|
||||
bool select_max_min_finder_subselect::cmp_int()
|
||||
{
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
|
||||
longlong val1= cache->val_int(), val2= maxmin->val_int();
|
||||
if (fmax)
|
||||
return (cache->null_value && !maxmin->null_value) ||
|
||||
@ -1458,7 +1460,7 @@ bool select_max_min_finder_subselect::cmp_int()
|
||||
|
||||
bool select_max_min_finder_subselect::cmp_decimal()
|
||||
{
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
|
||||
my_decimal cval, *cvalue= cache->val_decimal(&cval);
|
||||
my_decimal mval, *mvalue= maxmin->val_decimal(&mval);
|
||||
if (fmax)
|
||||
@ -1473,7 +1475,7 @@ bool select_max_min_finder_subselect::cmp_decimal()
|
||||
bool select_max_min_finder_subselect::cmp_str()
|
||||
{
|
||||
String *val1, *val2, buf1, buf2;
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
|
||||
Item *maxmin= ((Item_singlerow_subselect *)item)->element_index(0);
|
||||
/*
|
||||
as far as both operand is Item_cache buf1 & buf2 will not be used,
|
||||
but added for safety
|
||||
|
Reference in New Issue
Block a user