mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map()
This commit is contained in:
38
sql/table.cc
38
sql/table.cc
@ -51,11 +51,13 @@ inline bool is_system_table_name(const char *name, uint length);
|
||||
|
||||
Object_creation_ctx *Object_creation_ctx::set_n_backup(THD *thd)
|
||||
{
|
||||
Object_creation_ctx *backup_ctx= create_backup_ctx(thd);
|
||||
Object_creation_ctx *backup_ctx;
|
||||
DBUG_ENTER("Object_creation_ctx::set_n_backup");
|
||||
|
||||
backup_ctx= create_backup_ctx(thd);
|
||||
change_env(thd);
|
||||
|
||||
return backup_ctx;
|
||||
DBUG_RETURN(backup_ctx);
|
||||
}
|
||||
|
||||
void Object_creation_ctx::restore_env(THD *thd, Object_creation_ctx *backup_ctx)
|
||||
@ -84,7 +86,7 @@ Default_object_creation_ctx::Default_object_creation_ctx(
|
||||
{ }
|
||||
|
||||
Object_creation_ctx *
|
||||
Default_object_creation_ctx::create_backup_ctx(THD *thd)
|
||||
Default_object_creation_ctx::create_backup_ctx(THD *thd) const
|
||||
{
|
||||
return new Default_object_creation_ctx(thd);
|
||||
}
|
||||
@ -695,7 +697,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
|
||||
if (!head[32]) // New frm file in 3.23
|
||||
{
|
||||
share->avg_row_length= uint4korr(head+34);
|
||||
share-> row_type= (row_type) head[40];
|
||||
share->transactional= (ha_choice) head[39];
|
||||
share->row_type= (row_type) head[40];
|
||||
share->table_charset= get_charset((uint) head[38],MYF(0));
|
||||
share->null_field_first= 1;
|
||||
}
|
||||
@ -2417,6 +2420,7 @@ File create_frm(THD *thd, const char *name, const char *db,
|
||||
int4store(fileinfo+34,create_info->avg_row_length);
|
||||
fileinfo[38]= (create_info->default_table_charset ?
|
||||
create_info->default_table_charset->number : 0);
|
||||
fileinfo[39]= (uchar) create_info->transactional;
|
||||
fileinfo[40]= (uchar) create_info->row_type;
|
||||
/* Next few bytes were for RAID support */
|
||||
fileinfo[41]= 0;
|
||||
@ -4548,11 +4552,11 @@ Item_subselect *TABLE_LIST::containing_subselect()
|
||||
FALSE no errors found
|
||||
TRUE found and reported an error.
|
||||
*/
|
||||
bool TABLE_LIST::process_index_hints(TABLE *table)
|
||||
bool TABLE_LIST::process_index_hints(TABLE *tbl)
|
||||
{
|
||||
/* initialize the result variables */
|
||||
table->keys_in_use_for_query= table->keys_in_use_for_group_by=
|
||||
table->keys_in_use_for_order_by= table->s->keys_in_use;
|
||||
tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
|
||||
tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
|
||||
|
||||
/* index hint list processing */
|
||||
if (index_hints)
|
||||
@ -4604,8 +4608,8 @@ bool TABLE_LIST::process_index_hints(TABLE *table)
|
||||
Check if an index with the given name exists and get his offset in
|
||||
the keys bitmask for the table
|
||||
*/
|
||||
if (table->s->keynames.type_names == 0 ||
|
||||
(pos= find_type(&table->s->keynames, hint->key_name.str,
|
||||
if (tbl->s->keynames.type_names == 0 ||
|
||||
(pos= find_type(&tbl->s->keynames, hint->key_name.str,
|
||||
hint->key_name.length, 1)) <= 0)
|
||||
{
|
||||
my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
|
||||
@ -4641,7 +4645,7 @@ bool TABLE_LIST::process_index_hints(TABLE *table)
|
||||
!index_order[INDEX_HINT_FORCE].is_clear_all() ||
|
||||
!index_group[INDEX_HINT_FORCE].is_clear_all())
|
||||
{
|
||||
table->force_index= TRUE;
|
||||
tbl->force_index= TRUE;
|
||||
index_join[INDEX_HINT_USE].merge(index_join[INDEX_HINT_FORCE]);
|
||||
index_order[INDEX_HINT_USE].merge(index_order[INDEX_HINT_FORCE]);
|
||||
index_group[INDEX_HINT_USE].merge(index_group[INDEX_HINT_FORCE]);
|
||||
@ -4649,20 +4653,20 @@ bool TABLE_LIST::process_index_hints(TABLE *table)
|
||||
|
||||
/* apply USE INDEX */
|
||||
if (!index_join[INDEX_HINT_USE].is_clear_all() || have_empty_use_join)
|
||||
table->keys_in_use_for_query.intersect(index_join[INDEX_HINT_USE]);
|
||||
tbl->keys_in_use_for_query.intersect(index_join[INDEX_HINT_USE]);
|
||||
if (!index_order[INDEX_HINT_USE].is_clear_all() || have_empty_use_order)
|
||||
table->keys_in_use_for_order_by.intersect (index_order[INDEX_HINT_USE]);
|
||||
tbl->keys_in_use_for_order_by.intersect (index_order[INDEX_HINT_USE]);
|
||||
if (!index_group[INDEX_HINT_USE].is_clear_all() || have_empty_use_group)
|
||||
table->keys_in_use_for_group_by.intersect (index_group[INDEX_HINT_USE]);
|
||||
tbl->keys_in_use_for_group_by.intersect (index_group[INDEX_HINT_USE]);
|
||||
|
||||
/* apply IGNORE INDEX */
|
||||
table->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]);
|
||||
table->keys_in_use_for_order_by.subtract (index_order[INDEX_HINT_IGNORE]);
|
||||
table->keys_in_use_for_group_by.subtract (index_group[INDEX_HINT_IGNORE]);
|
||||
tbl->keys_in_use_for_query.subtract (index_join[INDEX_HINT_IGNORE]);
|
||||
tbl->keys_in_use_for_order_by.subtract (index_order[INDEX_HINT_IGNORE]);
|
||||
tbl->keys_in_use_for_group_by.subtract (index_group[INDEX_HINT_IGNORE]);
|
||||
}
|
||||
|
||||
/* make sure covering_keys don't include indexes disabled with a hint */
|
||||
table->covering_keys.intersect(table->keys_in_use_for_query);
|
||||
tbl->covering_keys.intersect(tbl->keys_in_use_for_query);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user