mirror of
https://github.com/MariaDB/server.git
synced 2026-05-09 16:44:29 +02:00
many warnings (practically safe but annoying) corrected
client/mysqladmin.cc: don't use the handler after it's closed client/mysqlbinlog.cc: memory leak client/mysqldump.c: many "ignore return value" warnings, one "NULL dereference" cmd-line-utils/libedit/history.c: memory leak include/my_base.h: cleanup libmysql/libmysql.c: "return value ignored" warning myisam/mi_delete.c: "return value ignored" warning myisam/myisampack.c: "out-of-bound access" warning myisam/sort.c: "double free" warning mysys/default_modify.c: "double free" warning mysys/mf_iocache2.c: "return value ignored" warnings mysys/my_bitmap.c: s/return/DBUG_RETURN/ mysys/my_error.c: memory leak server-tools/instance-manager/parse.cc: "NULL dereference" warning sql-common/client.c: "NULL dereference" warning sql/field.cc: deadcode, "NULL dereference", "uninitialized" warnings sql/field.h: unused parameters removed from constructor sql/ha_myisam.cc: "return value ignored" warnings sql/item.cc: "return value ignored" warnings changed constructor sql/item_func.cc: "return value ignored" warnings sql/log_event.cc: uninitialized warning sql/opt_range.cc: "double free" and uninitialized warnings sql/opt_range.h: "return value ignored" warning sql/repl_failsafe.cc: "return value ignored" warning sql/set_var.cc: "return value ignored" warning sql/slave.cc: "return value ignored" warnings sql/slave.h: new prototype sql/sql_acl.cc: deadcode and "NULL dereference" warnings sql/sql_db.cc: "return value ignored" warning sql/sql_handler.cc: "NULL dereference" warning sql/sql_help.cc: "NULL dereference" warning sql/sql_insert.cc: "return value ignored" warning sql/sql_parse.cc: "return value ignored" warning one more DBUG_ASSERT sql/sql_repl.cc: "return value ignored" and memory leak warnings sql/sql_show.cc: "return value ignored" and "NULL dereference" warnings sql/sql_test.cc: "return value ignored" warning sql/table.cc: memory leak sql/uniques.cc: "return value ignored" warning endspaces deleted
This commit is contained in:
parent
348efa5220
commit
307c0b77a1
38 changed files with 273 additions and 230 deletions
|
|
@ -663,7 +663,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
|
|||
it's a keyword
|
||||
*/
|
||||
|
||||
packet->reserve(length*2 + 2);
|
||||
VOID(packet->reserve(length*2 + 2));
|
||||
quote_char= (char) q;
|
||||
packet->append("e_char, 1, system_charset_info);
|
||||
|
||||
|
|
@ -950,13 +950,13 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
|
|||
if (key_part->field)
|
||||
append_identifier(thd,packet,key_part->field->field_name,
|
||||
strlen(key_part->field->field_name));
|
||||
if (!key_part->field ||
|
||||
if (key_part->field &&
|
||||
(key_part->length !=
|
||||
table->field[key_part->fieldnr-1]->key_length() &&
|
||||
!(key_info->flags & HA_FULLTEXT)))
|
||||
{
|
||||
buff[0] = '(';
|
||||
char* end=int10_to_str((long) key_part->length /
|
||||
char* end=int10_to_str((long) key_part->length /
|
||||
key_part->field->charset()->mbmaxlen,
|
||||
buff + 1,10);
|
||||
*end++ = ')';
|
||||
|
|
@ -1732,7 +1732,8 @@ LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
|
|||
{
|
||||
MEM_ROOT *mem= thd->mem_root;
|
||||
if (allocate_lex_string)
|
||||
lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING));
|
||||
if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING))))
|
||||
return 0;
|
||||
lex_str->str= strmake_root(mem, str, length);
|
||||
lex_str->length= length;
|
||||
return lex_str;
|
||||
|
|
@ -2933,7 +2934,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
|
|||
/*
|
||||
I.e. we are in SELECT FROM INFORMATION_SCHEMA.STATISTICS
|
||||
rather than in SHOW KEYS
|
||||
*/
|
||||
*/
|
||||
if (!tables->view)
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
thd->net.last_errno, thd->net.last_error);
|
||||
|
|
@ -2946,7 +2947,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
|
|||
{
|
||||
TABLE *show_table= tables->table;
|
||||
KEY *key_info=show_table->key_info;
|
||||
show_table->file->info(HA_STATUS_VARIABLE |
|
||||
show_table->file->info(HA_STATUS_VARIABLE |
|
||||
HA_STATUS_NO_LOCK |
|
||||
HA_STATUS_TIME);
|
||||
for (uint i=0 ; i < show_table->s->keys ; i++,key_info++)
|
||||
|
|
@ -2958,7 +2959,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
|
|||
restore_record(table, s->default_values);
|
||||
table->field[1]->store(base_name, strlen(base_name), cs);
|
||||
table->field[2]->store(file_name, strlen(file_name), cs);
|
||||
table->field[3]->store((longlong) ((key_info->flags &
|
||||
table->field[3]->store((longlong) ((key_info->flags &
|
||||
HA_NOSAME) ? 0 : 1), TRUE);
|
||||
table->field[4]->store(base_name, strlen(base_name), cs);
|
||||
table->field[5]->store(key_info->name, strlen(key_info->name), cs);
|
||||
|
|
@ -2981,12 +2982,12 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
|
|||
table->field[9]->store((longlong) records, TRUE);
|
||||
table->field[9]->set_notnull();
|
||||
}
|
||||
if (!(key_info->flags & HA_FULLTEXT) &&
|
||||
(!key_part->field ||
|
||||
key_part->length !=
|
||||
if (!(key_info->flags & HA_FULLTEXT) &&
|
||||
(key_part->field &&
|
||||
key_part->length !=
|
||||
show_table->field[key_part->fieldnr-1]->key_length()))
|
||||
{
|
||||
table->field[10]->store((longlong) key_part->length /
|
||||
table->field[10]->store((longlong) key_part->length /
|
||||
key_part->field->charset()->mbmaxlen);
|
||||
table->field[10]->set_notnull();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue