mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/my/mysql-5.0
into mysql.com:/home/my/mysql-5.1 Merge of 'remove compiler warnings when using -Wshadow'
This commit is contained in:
@ -32,7 +32,6 @@
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
#include "ha_partition.h"
|
||||
#endif
|
||||
|
||||
enum enum_i_s_events_fields
|
||||
{
|
||||
ISE_EVENT_CATALOG= 0,
|
||||
@ -57,11 +56,11 @@ enum enum_i_s_events_fields
|
||||
};
|
||||
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static const char *grant_names[]={
|
||||
"select","insert","update","delete","create","drop","reload","shutdown",
|
||||
"process","file","grant","references","index","alter"};
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
static TYPELIB grant_types = { sizeof(grant_names)/sizeof(char **),
|
||||
"grant_types",
|
||||
grant_names, NULL};
|
||||
@ -688,10 +687,10 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
|
||||
bool mysqld_show_create_db(THD *thd, char *dbname,
|
||||
HA_CREATE_INFO *create_info)
|
||||
{
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
char buff[2048];
|
||||
String buffer(buff, sizeof(buff), system_charset_info);
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
uint db_access;
|
||||
#endif
|
||||
HA_CREATE_INFO create;
|
||||
@ -1020,7 +1019,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
HA_CREATE_INFO *create_info_arg)
|
||||
{
|
||||
List<Item> field_list;
|
||||
char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end;
|
||||
char tmp[MAX_FIELD_WIDTH], *for_str, buff[128];
|
||||
const char *alias;
|
||||
String type(tmp, sizeof(tmp), system_charset_info);
|
||||
Field **ptr,*field;
|
||||
@ -1307,8 +1306,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
but may extrapolate its existence from that of an AUTO_INCREMENT column.
|
||||
*/
|
||||
|
||||
if(create_info.auto_increment_value > 1)
|
||||
if (create_info.auto_increment_value > 1)
|
||||
{
|
||||
char *end;
|
||||
packet->append(STRING_WITH_LEN(" AUTO_INCREMENT="));
|
||||
end= longlong10_to_str(create_info.auto_increment_value, buff,10);
|
||||
packet->append(buff, (uint) (end - buff));
|
||||
@ -1338,6 +1338,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
|
||||
if (share->min_rows)
|
||||
{
|
||||
char *end;
|
||||
packet->append(STRING_WITH_LEN(" MIN_ROWS="));
|
||||
end= longlong10_to_str(share->min_rows, buff, 10);
|
||||
packet->append(buff, (uint) (end- buff));
|
||||
@ -1345,6 +1346,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
|
||||
if (share->max_rows && !table_list->schema_table)
|
||||
{
|
||||
char *end;
|
||||
packet->append(STRING_WITH_LEN(" MAX_ROWS="));
|
||||
end= longlong10_to_str(share->max_rows, buff, 10);
|
||||
packet->append(buff, (uint) (end - buff));
|
||||
@ -1352,6 +1354,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
|
||||
if (share->avg_row_length)
|
||||
{
|
||||
char *end;
|
||||
packet->append(STRING_WITH_LEN(" AVG_ROW_LENGTH="));
|
||||
end= longlong10_to_str(share->avg_row_length, buff,10);
|
||||
packet->append(buff, (uint) (end - buff));
|
||||
@ -2067,7 +2070,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
|
||||
if (show_type == SHOW_SYS)
|
||||
{
|
||||
show_type= ((sys_var*) value)->type();
|
||||
show_type= ((sys_var*) value)->show_type();
|
||||
value= (char*) ((sys_var*) value)->value_ptr(thd, value_type,
|
||||
&null_lex_str);
|
||||
}
|
||||
@ -2120,7 +2123,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
end= strend(pos);
|
||||
break;
|
||||
}
|
||||
case SHOW_CHAR_PTR:
|
||||
case SHOW_CHAR_PTR:
|
||||
{
|
||||
if (!(pos= *(char**) value))
|
||||
pos= "";
|
||||
@ -2496,19 +2499,21 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
List<char> bases;
|
||||
List_iterator_fast<char> it(bases);
|
||||
COND *partial_cond;
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
uint derived_tables= lex->derived_tables;
|
||||
int error= 1;
|
||||
enum legacy_db_type not_used;
|
||||
Open_tables_state open_tables_state_backup;
|
||||
bool save_view_prepare_mode= lex->view_prepare_mode;
|
||||
Query_tables_list query_tables_list_backup;
|
||||
lex->view_prepare_mode= TRUE;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
#endif
|
||||
DBUG_ENTER("get_all_tables");
|
||||
|
||||
LINT_INIT(end);
|
||||
LINT_INIT(len);
|
||||
|
||||
lex->view_prepare_mode= TRUE;
|
||||
lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
|
||||
|
||||
/*
|
||||
@ -2747,7 +2752,9 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
bool with_i_schema;
|
||||
HA_CREATE_INFO create;
|
||||
TABLE *table= tables->table;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
#endif
|
||||
DBUG_ENTER("fill_schema_shemata");
|
||||
|
||||
if (make_db_list(thd, &files, &idx_field_vals,
|
||||
@ -3102,7 +3109,7 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
|
||||
field->real_type() == MYSQL_TYPE_VARCHAR || // For varbinary type
|
||||
field->real_type() == MYSQL_TYPE_STRING) // For binary type
|
||||
{
|
||||
uint32 octet_max_length= field->max_length();
|
||||
uint32 octet_max_length= field->max_display_length();
|
||||
if (is_blob && octet_max_length != (uint32) 4294967295U)
|
||||
octet_max_length /= field->charset()->mbmaxlen;
|
||||
longlong char_max_len= is_blob ?
|
||||
@ -3132,10 +3139,10 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
|
||||
case MYSQL_TYPE_LONG:
|
||||
case MYSQL_TYPE_LONGLONG:
|
||||
case MYSQL_TYPE_INT24:
|
||||
field_length= field->max_length() - 1;
|
||||
field_length= field->max_display_length() - 1;
|
||||
break;
|
||||
case MYSQL_TYPE_BIT:
|
||||
field_length= field->max_length();
|
||||
field_length= field->max_display_length();
|
||||
decimals= -1; // return NULL
|
||||
break;
|
||||
case MYSQL_TYPE_FLOAT:
|
||||
@ -3854,8 +3861,8 @@ static int get_schema_key_column_usage_record(THD *thd,
|
||||
|
||||
show_table->file->get_foreign_key_list(thd, &f_key_list);
|
||||
FOREIGN_KEY_INFO *f_key_info;
|
||||
List_iterator_fast<FOREIGN_KEY_INFO> it(f_key_list);
|
||||
while ((f_key_info= it++))
|
||||
List_iterator_fast<FOREIGN_KEY_INFO> fkey_it(f_key_list);
|
||||
while ((f_key_info= fkey_it++))
|
||||
{
|
||||
LEX_STRING *f_info;
|
||||
LEX_STRING *r_info;
|
||||
|
Reference in New Issue
Block a user