mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Code cleanups during code reviews
Ensure we get error if INSERT IGNORE ... SELECT fails Fixed wrong key_part->key_length usage in index_merge client/mysql.cc: Code cleanups & simply optimizations mysql-test/r/information_schema.result: Safety mysql-test/t/information_schema.test: Safety sql/ha_ndbcluster.cc: Code cleanups sql/item.cc: Code cleanups sql/item_subselect.cc: Code cleanups sql/item_sum.cc: Code cleanups sql/opt_range.cc: Made get_index_only_read_time() static (instad of inline) to increase portability (function was not declared before use) Simple optimization Fixed wrong key_part->key_length usage in index_merge Removed not used variable n_used_covered Indentation fixes & comment cleanups sql/parse_file.cc: Code cleanups sql/sql_base.cc: Code cleanups sql/sql_bitmap.h: Added missing return sql/sql_insert.cc: Ensure we get error if INSERT IGNORE ... SELECT fails sql/sql_select.cc: Code cleanups sql/sql_show.cc: Safety fix if a LOT of errors are ignored sql/sql_update.cc: Code cleanups sql/table.cc: Code cleanups sql/table.h: Code cleanups sql/uniques.cc: Code cleanups strings/decimal.c: Simple optimization Code cleanups
This commit is contained in:
@ -1265,7 +1265,7 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
name_buffer, wild)))
|
||||
{
|
||||
char *value=variables->value;
|
||||
const char *pos, *end;
|
||||
const char *pos, *end; // We assign a lot of const's
|
||||
long nr;
|
||||
if (show_type == SHOW_SYS)
|
||||
{
|
||||
@ -1336,8 +1336,8 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
case SHOW_SLAVE_RETRIED_TRANS:
|
||||
{
|
||||
/*
|
||||
TODO: in 5.1 with multimaster, have one such counter per line in SHOW
|
||||
SLAVE STATUS, and have the sum over all lines here.
|
||||
TODO: in 5.1 with multimaster, have one such counter per line in
|
||||
SHOW SLAVE STATUS, and have the sum over all lines here.
|
||||
*/
|
||||
pthread_mutex_lock(&LOCK_active_mi);
|
||||
pthread_mutex_lock(&active_mi->rli.data_lock);
|
||||
@ -1359,7 +1359,11 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i= 1; i < MAX_SLAVE_ERROR; i++)
|
||||
/* 10 is enough assuming errors are max 4 digits */
|
||||
int i;
|
||||
for (i= 1;
|
||||
i < MAX_SLAVE_ERROR && (uint) (end-buff) < sizeof(buff)-10;
|
||||
i++)
|
||||
{
|
||||
if (bitmap_is_set(bitmap, i))
|
||||
{
|
||||
@ -1369,6 +1373,8 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
}
|
||||
if (end != buff)
|
||||
end--; // Remove last ','
|
||||
if (i < MAX_SLAVE_ERROR)
|
||||
end= strmov((char*) end, "..."); // Couldn't show all errors
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user