mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed warnings from valgrind (not a bug)
Don't add -debug to server version if MYSQL_SERVER_PREFIX is used Indentation cleanups
This commit is contained in:
@ -917,7 +917,7 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
|
|||||||
DBUG_PRINT("enter",("cache_size: %lu", cache_size));
|
DBUG_PRINT("enter",("cache_size: %lu", cache_size));
|
||||||
|
|
||||||
DBUG_ASSERT(!info->bulk_insert &&
|
DBUG_ASSERT(!info->bulk_insert &&
|
||||||
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT));
|
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT));
|
||||||
|
|
||||||
for (i=total_keylength=num_keys=0 ; i < share->base.keys ; i++)
|
for (i=total_keylength=num_keys=0 ; i < share->base.keys ; i++)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ SHOW CREATE TABLE T1;
|
|||||||
Table Create Table
|
Table Create Table
|
||||||
T1 CREATE TABLE `T1` (
|
T1 CREATE TABLE `T1` (
|
||||||
`a` int(11) default NULL
|
`a` int(11) default NULL
|
||||||
) TYPE=MyISAM
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
RENAME TABLE T1 TO T2;
|
RENAME TABLE T1 TO T2;
|
||||||
SHOW TABLES LIKE "T2";
|
SHOW TABLES LIKE "T2";
|
||||||
Tables_in_test (T2)
|
Tables_in_test (T2)
|
||||||
@ -68,7 +68,7 @@ SHOW CREATE TABLE T1;
|
|||||||
Table Create Table
|
Table Create Table
|
||||||
T1 CREATE TABLE `T1` (
|
T1 CREATE TABLE `T1` (
|
||||||
`a` int(11) default NULL
|
`a` int(11) default NULL
|
||||||
) TYPE=InnoDB
|
) ENGINE=InnoDB DEFAULT CHARSET=latin
|
||||||
RENAME TABLE T1 TO T2;
|
RENAME TABLE T1 TO T2;
|
||||||
SHOW TABLES LIKE "T2";
|
SHOW TABLES LIKE "T2";
|
||||||
Tables_in_test (T2)
|
Tables_in_test (T2)
|
||||||
|
@ -663,9 +663,22 @@ static void make_sortkey(register SORTPARAM *param,
|
|||||||
for ( ; (field= addonf->field) ; addonf++)
|
for ( ; (field= addonf->field) ; addonf++)
|
||||||
{
|
{
|
||||||
if (addonf->null_bit && field->is_null())
|
if (addonf->null_bit && field->is_null())
|
||||||
|
{
|
||||||
nulls[addonf->null_offset]|= addonf->null_bit;
|
nulls[addonf->null_offset]|= addonf->null_bit;
|
||||||
|
#ifdef HAVE_purify
|
||||||
|
bzero(to, addonf->length);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
field->pack((char *) to, field->ptr);
|
{
|
||||||
|
uchar *end= (uchar*) field->pack((char *) to, field->ptr);
|
||||||
|
#ifdef HAVE_purify
|
||||||
|
uint length= (uint) ((to + addonf->length) - end);
|
||||||
|
DBUG_ASSERT((int) length >= 0);
|
||||||
|
if (length)
|
||||||
|
bzero(end, length);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
to+= addonf->length;
|
to+= addonf->length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -841,14 +841,11 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows)
|
|||||||
if (file->state->records == 0 &&
|
if (file->state->records == 0 &&
|
||||||
(!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
|
(!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
|
||||||
mi_disable_non_unique_index(file,rows);
|
mi_disable_non_unique_index(file,rows);
|
||||||
else
|
else if (!file->bulk_insert &&
|
||||||
if (!file->bulk_insert &&
|
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
|
||||||
(!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
|
|
||||||
{
|
|
||||||
mi_init_bulk_insert(file,
|
mi_init_bulk_insert(file,
|
||||||
current_thd->variables.bulk_insert_buff_size,
|
current_thd->variables.bulk_insert_buff_size,
|
||||||
rows);
|
rows);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enable_activate_all_index=1;
|
enable_activate_all_index=1;
|
||||||
|
@ -2105,13 +2105,11 @@ static int init_common_variables(const char *conf_file_name, int argc,
|
|||||||
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
|
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
if (*(MYSQL_SERVER_SUFFIX))
|
if (!*(MYSQL_SERVER_SUFFIX))
|
||||||
strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
|
strmov(strend(server_version),"-debug");
|
||||||
else
|
else
|
||||||
strmov(strend(server_version),"--debug");
|
|
||||||
#else
|
|
||||||
strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
|
|
||||||
#endif
|
#endif
|
||||||
|
strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
|
||||||
|
|
||||||
load_defaults(conf_file_name, groups, &argc, &argv);
|
load_defaults(conf_file_name, groups, &argc, &argv);
|
||||||
defaults_argv=argv;
|
defaults_argv=argv;
|
||||||
|
@ -1805,7 +1805,7 @@ Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
|
|||||||
if (cached_field_index < table->fields &&
|
if (cached_field_index < table->fields &&
|
||||||
!my_strcasecmp(system_charset_info,
|
!my_strcasecmp(system_charset_info,
|
||||||
table->field[cached_field_index]->field_name, name))
|
table->field[cached_field_index]->field_name, name))
|
||||||
field_ptr= table->field + cached_field_index;
|
field_ptr= table->field + cached_field_index;
|
||||||
else if (table->name_hash.records)
|
else if (table->name_hash.records)
|
||||||
field_ptr= (Field**)hash_search(&table->name_hash,(byte*) name,
|
field_ptr= (Field**)hash_search(&table->name_hash,(byte*) name,
|
||||||
length);
|
length);
|
||||||
|
@ -1279,7 +1279,7 @@ store_create_info(THD *thd, TABLE *table, String *packet)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Again we are using CURRENT_TIMESTAMP instead of NOW becaus eit is
|
Again we are using CURRENT_TIMESTAMP instead of NOW because it is
|
||||||
more standard
|
more standard
|
||||||
*/
|
*/
|
||||||
has_now_default= table->timestamp_field == field &&
|
has_now_default= table->timestamp_field == field &&
|
||||||
|
@ -628,15 +628,15 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
|
|||||||
if (!timestamps)
|
if (!timestamps)
|
||||||
{
|
{
|
||||||
sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD;
|
sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD;
|
||||||
++timestamps_with_niladic;
|
timestamps_with_niladic++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sql_field->unireg_check= Field::NONE;
|
sql_field->unireg_check= Field::NONE;
|
||||||
}
|
}
|
||||||
else if(sql_field->unireg_check != Field::NONE)
|
else if (sql_field->unireg_check != Field::NONE)
|
||||||
++timestamps_with_niladic;
|
timestamps_with_niladic++;
|
||||||
|
|
||||||
++timestamps;
|
timestamps++;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
sql_field->pack_flag=(FIELDFLAG_NUMBER |
|
sql_field->pack_flag=(FIELDFLAG_NUMBER |
|
||||||
|
Reference in New Issue
Block a user