mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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:
@@ -772,14 +772,14 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
|
||||
interval= sql_field->interval= typelib(stmt_root,
|
||||
sql_field->interval_list);
|
||||
List_iterator<String> it(sql_field->interval_list);
|
||||
List_iterator<String> int_it(sql_field->interval_list);
|
||||
String conv, *tmp;
|
||||
char comma_buf[2];
|
||||
int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf,
|
||||
(uchar*) comma_buf +
|
||||
sizeof(comma_buf));
|
||||
DBUG_ASSERT(comma_length > 0);
|
||||
for (uint i= 0; (tmp= it++); i++)
|
||||
for (uint i= 0; (tmp= int_it++); i++)
|
||||
{
|
||||
uint lengthsp;
|
||||
if (String::needs_conversion(tmp->length(), tmp->charset(),
|
||||
@@ -2154,7 +2154,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
HA_CHECK_OPT *),
|
||||
int (view_operator_func)(THD *, TABLE_LIST*))
|
||||
{
|
||||
TABLE_LIST *table, *save_next_global, *save_next_local;
|
||||
TABLE_LIST *table;
|
||||
SELECT_LEX *select= &thd->lex->select_lex;
|
||||
List<Item> field_list;
|
||||
Item *item;
|
||||
@@ -2185,30 +2185,33 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
|
||||
strxmov(table_name, db, ".", table->table_name, NullS);
|
||||
thd->open_options|= extra_open_options;
|
||||
table->lock_type= lock_type;
|
||||
/* open only one table from local list of command */
|
||||
save_next_global= table->next_global;
|
||||
table->next_global= 0;
|
||||
save_next_local= table->next_local;
|
||||
table->next_local= 0;
|
||||
select->table_list.first= (byte*)table;
|
||||
/*
|
||||
Time zone tables and SP tables can be add to lex->query_tables list,
|
||||
so it have to be prepared.
|
||||
TODO: Investigate if we can put extra tables into argument instead of
|
||||
using lex->query_tables
|
||||
*/
|
||||
lex->query_tables= table;
|
||||
lex->query_tables_last= &table->next_global;
|
||||
lex->query_tables_own_last= 0;
|
||||
thd->no_warnings_for_error= no_warnings_for_error;
|
||||
if (view_operator_func == NULL)
|
||||
table->required_type=FRMTYPE_TABLE;
|
||||
open_and_lock_tables(thd, table);
|
||||
thd->no_warnings_for_error= 0;
|
||||
table->next_global= save_next_global;
|
||||
table->next_local= save_next_local;
|
||||
thd->open_options&= ~extra_open_options;
|
||||
|
||||
/* open only one table from local list of command */
|
||||
{
|
||||
TABLE_LIST *save_next_global, *save_next_local;
|
||||
save_next_global= table->next_global;
|
||||
table->next_global= 0;
|
||||
save_next_local= table->next_local;
|
||||
table->next_local= 0;
|
||||
select->table_list.first= (byte*)table;
|
||||
/*
|
||||
Time zone tables and SP tables can be add to lex->query_tables list,
|
||||
so it have to be prepared.
|
||||
TODO: Investigate if we can put extra tables into argument instead of
|
||||
using lex->query_tables
|
||||
*/
|
||||
lex->query_tables= table;
|
||||
lex->query_tables_last= &table->next_global;
|
||||
lex->query_tables_own_last= 0;
|
||||
thd->no_warnings_for_error= no_warnings_for_error;
|
||||
if (view_operator_func == NULL)
|
||||
table->required_type=FRMTYPE_TABLE;
|
||||
open_and_lock_tables(thd, table);
|
||||
thd->no_warnings_for_error= 0;
|
||||
table->next_global= save_next_global;
|
||||
table->next_local= save_next_local;
|
||||
thd->open_options&= ~extra_open_options;
|
||||
}
|
||||
if (prepare_func)
|
||||
{
|
||||
switch ((*prepare_func)(thd, table, check_opt)) {
|
||||
|
||||
Reference in New Issue
Block a user